Pages: 1
Topic closed
I need to make a 10 question quiz game. I am using two imported lists, one is questions and the other is answers.
I need to know how to generate the questions randomly and if the player answers correctly, then they don't get asked that same question again.
If they get it incorrect, it will not be deleted and will be asked again randomly later.
Does anyone know how to do this?
THANK YOU SO MUCH!
Offline
Use:
when gf clicked delete (all v) of [done v] set [score v] to [0] set [question# v] to [1] repeat (length of [questions v]) repeat until <not<[done v] contains (question#)> > set [question# v] to (pick random (1) to (length of [questions v]) ) end ask (item (question#) of [questions v]) and wait if <(answer)=(item (question#) of [questions v])> change [score v] by (1) add (question#) to [done v] say [Correct.] for (2) secs else say [Wrong.] for (2) secs end end
Last edited by trinary (2012-03-05 00:18:47)
Offline
Trinary,
I have the exact same need but your answer is too advanced for me just now.
I want to do a quiz which isn't over until all questions have been answered
correctly.
If a student gets one wrong, it goes back into the pile and re-emerges at random
later on. If a student gets one right, that question is eliminated and will not be re-asked.
Could you give a pseudo code description of how that should be tackled?
Offline
sarahmi wrote:
Trinary,
I have the exact same need but your answer is too advanced for me just now.
I want to do a quiz which isn't over until all questions have been answered
correctly.
If a student gets one wrong, it goes back into the pile and re-emerges at random
later on. If a student gets one right, that question is eliminated and will not be re-asked.
Could you give a pseudo code description of how that should be tackled?
Well, you'd first want to check if the answer was right.
Then, if it was, you delete it from a list of questions. Otherwise, save it in a variable, delete it from the list, then
insert (old question) at (any v) of [questions v]
Offline
Topic closed
Pages: 1