Quiz calculator using variables | Community
Skip to main content
Answered

Quiz calculator using variables


Hello,
I am trying to create a quiz calculator with 7 questions and 7 variables. The variables are all numeric, with initial value = 0.


The idea is that depending on which answer you choose in each of the questions, it adds an amount to each of the variables.
For example:
If in question 1 you choose option A, add @mini=+5 and @indu=+2 (and the rest of the variables remain zero).
If it is question 2, choose option C, sama @nord=+4 and @mini=+2-
So the result would be @mini=5+2=7 indu=2 and nord=4.


Then I am sending the results using a URL of the type mydomain.com/mypage/?mini=(result)&nord=(result)&indu=(result)

The URL works fine and shows me the data, but the summation is not done right.

Is it possible to create this kind of calculators using variables?

Thank you. All the best.

Best answer by dagalar

Thank you for the idea @john.desborough ,

Using the troubleshooting pages I saw where the problem was.

 

Again, thank you!

View original

4 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14904 replies
  • August 29, 2023

@john.desborough is definitely your math/variables guru!


john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • 5271 replies
  • August 29, 2023

@dagalar - my suggestion is to insert a statement page between each question - temporary troubleshooting pages - and use the @recall function to display the variable values after each calculation. that should give you an idea of where the issue first appears.

it would also help us troubleshoot where logic issues might be. 

also: are the questions marked as required? 

 

des


  • Author
  • Explorer
  • 1 reply
  • Answer
  • August 30, 2023

Thank you for the idea @john.desborough ,

Using the troubleshooting pages I saw where the problem was.

 

Again, thank you!


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14904 replies
  • August 30, 2023

Glad to hear that helped, @dagalar . Let us know if you have any other questions. 


Reply