Post by thomas on Mar 9, 2021 11:03:02 GMT
Hello,
I have a problem calculating score of checks questions:
I have a problem calculating score of checks questions:
I want to mimick a shopping list.
For now i just setup test items but in the end i will replace that by about 20 items per questions with float prices. I want to check if people didn't went over the budget i gave them (10 euros) therefore i do :
For now i just setup test items but in the end i will replace that by about 20 items per questions with float prices. I want to check if people didn't went over the budget i gave them (10 euros) therefore i do :
page: begin
l: Info1
t: info
You will have to shop items for a maximum of 10€
l: Q0
t: check
o: random
q: Question 1: Vegetables and fruits
- {score=1.1} 1.1 € - Test 1
- {score=2.2} 2.2 € - Test 2
- {score=3.3} 3.3 € - Test 3
- {score=4.4} 4.4 € - Test 4
l: Q1
t: check
o: random
q: Question 2: Meat and other fresh product
- {score=1.1} 1.1 € - Test 1
- {score=2.2} 2.2 € - Test 2
- {score=3.3} 3.3 € - Test 3
- {score=4.4} 4.4 € - Test 4
l: Q2
t: check
o: random
q: Question 3: Other product
- {score=1.1} 1.1 € - Test 1
- {score=2.2} 2.2 € - Test 2
- {score=3.3} 3.3 € - Test 3
- {score=4.4} 4.4 € - Test 4
page: end
l: budget1
t: set
- sum $Q0 $Q1 $Q2
l: jump1
t: jump
- if $budget1 <= 10 then goto Final
l: Info1
t: info
You will have to shop items for a maximum of 10€
l: Q0
t: check
o: random
q: Question 1: Vegetables and fruits
- {score=1.1} 1.1 € - Test 1
- {score=2.2} 2.2 € - Test 2
- {score=3.3} 3.3 € - Test 3
- {score=4.4} 4.4 € - Test 4
l: Q1
t: check
o: random
q: Question 2: Meat and other fresh product
- {score=1.1} 1.1 € - Test 1
- {score=2.2} 2.2 € - Test 2
- {score=3.3} 3.3 € - Test 3
- {score=4.4} 4.4 € - Test 4
l: Q2
t: check
o: random
q: Question 3: Other product
- {score=1.1} 1.1 € - Test 1
- {score=2.2} 2.2 € - Test 2
- {score=3.3} 3.3 € - Test 3
- {score=4.4} 4.4 € - Test 4
page: end
l: budget1
t: set
- sum $Q0 $Q1 $Q2
l: jump1
t: jump
- if $budget1 <= 10 then goto Final
l: Info2
t: info
You went over budget ! You used {$budget1} € please redo it using a maximum of 10 €.
t: info
You went over budget ! You used {$budget1} € please redo it using a maximum of 10 €.
l: Final
t: info
Well done ! You used {$budget1} €.
t: info
Well done ! You used {$budget1} €.
My first question is here the set budget1 has really strange results.
If i select items only from Q0 my budget 1 will have 5 time bigger value that the normal value it should have.
If i select items only from Q2 my budget 1 will have 3 time bigger value that the normal value it should have.
If i select items only from Q1 my budget 1 will have a inexistant value ??
I suspect all this come from the check questions. I want to sum inner questions score and then add all questions together.
My secondary question is :
If they went over budget, the perfect solution would be to reset budget1 to 0 and jump to Q0. But i read on the forum this was not possible yet.
For now i put again the same questions with another name so people can redo it one time if they went over budget. This solution is fine.