Variable Initialization is problematic | Community
Skip to main content
Question

Variable Initialization is problematic


Hi,

I’m trying to make a quiz where….. on correct selection…. I’ll add +10 to score and go to next question. Upon wrong selection, I’ll go to a statement screen which is considered as Hint. Now, once the Hint screen is accessed, I go back to my question …… where this time…. upon any selection…. I don’t want my score to update….. for this

I’ve created a boolean variable is_hint_active_q1 for question 1, is_hint_active_q2 for question 2… and so on.

my question screen

question’s logic ==>



Now on the hint screen


the hint’s logic ==>
 


Now, when I’m running this quiz form…
​​​​​​​if you see the is_hint_active_q1 variable initializing with yes, although I specifically mentioned this to be yes at the Hint (statement) screen. 

please help me…. How can I initialize the variable with ​​​​​​​no

 

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • December 20, 2023

@john.desborough might be able to provide some variable advice for you! 


john.desborough
Forum|alt.badge.img+6

@sounak123 @Liz - it seems that the logic should be more like this:

 

on q1;

  • if q1 = B & D AND is_hint_active_q1=yes  add 0 to score
  • if q1=b&d and is_hint_active_q1 - no add 10 to score
  • if q1 - b&d go to q2
  • otherwise go to s1

on s1

  • make sure you set the is_hint_active_q1 yes using the replace function before you send them back to q1

des


  • Explorer
  • December 21, 2023

Just to make things simpler, I’m creating quiz form again…… where first question has two answers and 2nd has one correct answer.

 

Question 1:

Question 1 Hint:
 

Question 2
 

Question 2 Hint
 

 

These two are my initialized variables.

as per
@john.desborough ‘s sugggestion


Question 1 Logics:


Hint 1 Logic:
 


Question 2 Logic (having 1 correct answer)

NB: S3 is just a final submit statement
 



Question 2 Hint Logic
 


NOw , whenever I’m previewing this….. the hint state is coming as yes….. and even if I’m accessing the hint of the question, I can still score… my intention was… whenever the hint statement is accessed…. I shouldn’t score…
Same problem coming for question 2 as well.
 


this is my starting screen:
I”m selecting one correct and one incorrect
​​​​​​​

Hint page is coming and it’s yes. So I shouldn’t get any score… now after I click the correct options… The hint variable gets automatically to “no”….. and I get score (please see the last screenshot of thank you screen) even after accessing the hint.
 


Same goes for question 2 as well
The hint variable is yes, even if I initialized with no, it’s coming as yes.

​​Now clicking on wrong option can lead me to Hint screen and now I shouldn’t be able to get score after answering this question correctly.
 


after clicking on Continue, I go to question 2 again and select the correct option.
 

NOw after final submit==>
​​​​​​​

​​​
Now even after leading to Hints, I’m able to score 20 ( i.e. 2 correct answers) ….. but I want to get score at the first go only and upon selecting wrong option… I want to show the hint screen and then whatever user selects (on correct answer go to next question.. and on wrong go to hint) …. it’d not give my any score.

Please help me achieve this. ​


john.desborough
Forum|alt.badge.img+6

@sounak123 - you need to do the same logic implementation for q2 ie add the hint2 is yes then score = 0 … 

 

i am not seeing it in the logic. 

 

des


  • Explorer
  • December 22, 2023

Question 1 is not working according to the expectation sir.

 

I want to add score while I’m correctly choosing the right answer…. if I choose the wrong one by mistake I want to access the hint screen.

 

If you could see, question 2 has ==>
 

logic when is_hint_active_q2 = yes

 

and is_hint_active_q2 = no
 

 

and hint logic
 


still it isn’t working well… I’ll request you to kindly use this form ==>
 

https://mv9wvhcf7mw.typeform.com/to/VVRYVKH5

this has exact same logic as I showed in my previous reply….

 

still if you kindly respond and see the score…. it’s not coming as expected.


Reply