Template for a Quiz
This worksheet is a template to make a quiz. To use it, you have to :
1. Precise the number of questions. This number is represented with the numeric variable n.
2. Create texts Q1, Q2, Q3, … each containing one question.
3. Create a list Q ={Q1,Q2, Q3, …}
4. Create texts A1, A2, A3, ... containing the answer A) to the corresponding question.
5. Create a list A = {A1, A2, A3, …}
6. Make the same things as in 4. and 5. for the answers B, C, and D.
7. Create a list of good GA of good answers.
8. Create 4 Boolean variables a, b, c, and d to check the good answer for each question.
9. Create a Boolean variable Good that will be true when the good answer is checked and false otherwise.
10. Create a numeric variable Score to count the good answers.
11. Create a numeric variable q for the number of current question.
12. Create a text variable Ans = If(a, "a", If(b, "b", If(c, "c", If(d, "d", "?")))) to keep the selected answer.
13. Create a button Start with script
q=0
a=false
b=false
c=false
d=false
Good=Ans ≟ Element[GA, q]
Score=If[q==0,0,If[Good,Score+1,Score]]
14. Create a button New Question to get a new question. The script of this button is
Score=If[Good,Score+1,Score]
q=q+1
a=false
b=false
c=false
d=false
15. Attach to each of the Boolean variable an update script as
b=false a=false a=false a=false
c=false for variable a, c= false for b b=false for c b=false for d
d=false d=false d=false c=false