2
* Copyright (C) 2009 Jordi Mas i Hernàndez <jmas@softcatala.org>
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; either version 2 of the
7
* License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* General Public License for more details.
14
* You should have received a copy of the GNU General Public
15
* License along with this program; if not, write to the
16
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
* Boston, MA 02111-1307, USA.
22
using System.Collections.Generic;
27
public class AnalogiesQuestionAnswer : Analogies
29
static protected Dictionary <int, Analogy> analogies;
30
static protected ArrayListIndicesRandom analogies_indices;
31
static protected int analogies_index = 0;
33
public AnalogiesQuestionAnswer ()
35
if (analogies == null)
36
analogies = AnalogiesFactory.Get (Analogy.Type.QuestionAnswer);
39
public override string Name {
40
get { return Catalog.GetString ("Question and answer");}
43
public override ArrayListIndicesRandom Indices {
44
get { return analogies_indices; }
45
set { analogies_indices = value; }
48
public override int CurrentIndex {
49
get { return analogies_index; }
50
set { analogies_index = value; }
53
public override Dictionary <int, Analogy> List {
54
get { return analogies; }
57
public override void Initialize ()
64
if (current.answers != null)
65
right_answer = current.answers [current.right];