1 import questions
, statistic
6 if self
.method
== "BadQuestions":
7 qid
= self
.FindBadQuestion()
8 elif self
.method
== "GoodQuestions":
9 qid
= self
.FindGoodQuestion()
10 elif self
.method
== "NewQuestions":
11 qid
= self
.FindNewQuestion()
13 qid
= self
.FindAnyQuestion()
15 self
.q
.AskQuestion (qid
)
17 self
.question
= self
.q
.question
18 self
.answera
= self
.q
.answera
19 self
.answerb
= self
.q
.answerb
20 self
.answerc
= self
.q
.answerc
21 self
.answerd
= self
.q
.answerd
22 self
.answercorrect
= self
.q
.answercorrect
23 self
.hint
= self
.q
.hint
24 self
.correct
, self
.wrong
= self
.s
.ThisQuestion (self
.id)
26 def EvalQuestion(self
, answer
):
27 if self
.q
.correct
== answer
:
32 self
.s
.IncreaseCounter (self
.id, c
, answer
)
36 def FindAnyQuestion(self
):
37 nq
= int (r
.random()*self
.q
.nquestions
)
38 return self
.q
.questions
[nq
][0]
40 def FindNewQuestion(self
):
43 def FindBadQuestion(self
):
46 def FindGoodQuestion(self
):
50 self
.q
= questions
.Questions()
51 self
.s
= statistic
.Statistic()