Question

Multiple logic corresponding to Score in the same question.

  • 19 August 2021
  • 9 replies
  • 194 views

Badge

Here’s a simple use case:

There are 3 questions, and all questions are weighted with 1 point each (which I add to the “score” variable).

For question 1 and 2, I just add 1 to score if the user answers correctly. No further logic.
At question 3, I want to keep a checkpoint on Score. In the third question, if customer answers correctly, I first add 1 to score, and then implement following logic:
a) If the score is less than 2, end the quiz.
b) If the score is greater or equal to 2, reset the score to 0 and proceed to next question.


This logic fails when answer to question 3 is the deciding factor. Supposing a customer answers question 1 correctly and question 2 incorrectly, in that case answering question 3 correctly should take the customer to next question (because score > 2 including that question) and answering it incorrectly should end the quiz (because score is < 2).

Practically, Typeform ends my quiz in both the cases. If I answer 3 correctly, it does not take the updated score into account. How do I solve this?

Screenshot of logic for question 3:

 

 

 


9 replies

Userlevel 7
Badge +5

Hello @SanjeevRao! Welcome to the Typeform Community! :tada:

You can make this work with Typeform! I've created a small tutorial to show you how you can get this done.

1. After you create all of your questions, go to "Logic < Advanced < Branching & Calculations".
2. Add 1 point to the @score of your first two questions in case they get the right answer (I think you already did it!). Then, jump to the famous questions number 3! Hehe
Typeform - Create 🔊 2021-08-20 at 11.40.49 AM
3. Add 1 point to the @score of question number 3 as well. After that, you'll add a new condition - "If @score is lower than 2 then jump to 'Final' ". 
Typeform - Create 🔊 2021-08-20 at 11.43.53 AM
4. You'll need to add a new condition - "If @score is greater or equal to 2, (then reset the score to 0) and proceed to question number 5".
Typeform - Create 🔊 2021-08-20 at 11.46.13 AM
​​​​​​​5. To reset the score, you'd need to create two conditions to subtract the exact number of points.
I.e. If score is 2, subtract 2 and If score is 1, subtract 1.
6. Make sure to save your logic and then it should work as expected. 

That's it! Let me know if it works for you! I think it'll! :wink:

P.S. I love languages! Make sure to share your use case with me, I'm very interested to know how Typeform is helping you! :blue_heart:

Badge

Hello Gabi,

Thanks for your message. 

Great to know your love for languages. In fact I am a PM at Babbel (language learning company) and looking to use Typeform to conduct a language quiz for our learners.

I’m not sure if I missed something but If you look at the screenshots I have attached in my question, I have followed the same instructions you mentioned.

A. At question 3, I add 1 point to the @score variable. 
B. If the score at question 3 is less than 2, I end the quiz and jump to “Submit form”
C. If the score is >= 2, I multiply @score by 0 to reset the score (so i don’t need to set multiple conditions to subtract different scores). Since the score is >=2, naturally the typeform should jump to next question (since the logic for ending the quiz only kicks in when @score < 2).

Use case: If the customer answers first question correctly, second incorrectly, and third correctly, @score should reset to 0 and customer should advance to next question.

Problem is if the customer answers first question correctly, second incorrectly and third incorrectly, the quiz still ends. It looks like typeform is not adding 1 point to the @score before processing points (B) and (C) that I have mentioned above.

Basically, (B) is getting executed irrespective of whether I answer question correctly or incorrectly. Looking forward to a resolution on this :)

Incase you have authorization to access my form: https://admin.typeform.com/form/vw42KBAY/create

Best,

Sanjeev

 

Badge

Hello @Gabi Amaral ,

Good morning. Have you found any resolution to my query?

Looking forward to hearing from you.

 

Best,

Sanjeev

Badge

Asking the same question again because the last one didn’t get resolved: 

 

Here’s a simple use case:

There are 3 questions, and all questions are weighted with 1 point each (which I add to the “score” variable).

For question 1 and 2, I just add 1 to score if the user answers correctly. No further logic.
At question 3, I want to keep a checkpoint on Score. In the third question, if customer answers correctly, I first add 1 to score, and then implement following logic:
a) If the score is less than 2, end the quiz.
b) If the score is greater or equal to 2, reset the score to 0 and proceed to next question.


This logic fails when answer to question 3 is the deciding factor. Supposing a customer answers question 1 correctly and question 2 incorrectly, in that case answering question 3 correctly should take the customer to next question (because score > 2 including that question) and answering it incorrectly should end the quiz (because score is < 2).

Practically, Typeform ends my quiz in both the cases. If I answer 3 correctly, it does not take the updated score into account. How do I solve this?

Screenshot of logic for question 3:

 

 

 

Userlevel 7
Badge +5

Hey @SanjeevRao! I apologize for taking so long to reply. 

Can you send me some screenshots of how you set up your logic jumps? This way, it'd be easier for me to understand the current behavior. :blush:

I've created a similar form on my account to reproduce this situation and it seems is working just fine to me, so I'd love to compare my logic to yours. 

Wishing you a great day! :sunny:

Badge

Hello @Gabi Amaral ,

Good afternoon.

I have already sent the screenshots of the logic jump for the third question in the question I posted. Are you expecting something else? Am I missing something?

By logic jump, you mean Logic → Branching and Calculations, correct?

I am attaching the screenshots again here:

 

 

 

I created this form using the above logic: (https://1j5htafaw55.typeform.com/to/vw42KBAY)

 

If you answer question 1 correctly (Option A), question 2 incorrectly (Option B), question 3 correctly (Option A), it should jump to question 4 as score = 2 after answering question 3 correctly. Instead Typeform ends the quiz.

Looking forward to your thoughts on this.

 

Best regards,
Sanjeev

Userlevel 7
Badge +6

@SanjeevRao - this is from another user

I believe that one of the root causes of your problem is from setting the “Always jump to” to go to  specific page, rather than using a logic rule to route your user. 

if you are trying to use the score values to guide your users to a particular question, then avoid the use of ‘always jump to” and use a logic rule that might say ‘if @score is = 2 then jumpto question 3’ 

 

just a thought

 

des

Badge

Hi @john.desborough ,

Thank you for your response. 

I think you are looking at question 1 and 2 (labelled 2 and 3 in the screenshots) which have a value in “Always jump to”. However, those questions are not the problem here since there is anyway no logic or branching in those questions. 

The problem is in question 2 (labelled 4 in screenshot) which is “How do you say ‘how are you’ in Spanish?” The logic is in that question and is not working. If you look at my last and second last screenshot, there is no value in “Always jump to” for that question.

PS. I anyway removed the “Always jump to” values from all my question. The logic in question 3 (labelled 4) is still not working.

Userlevel 7
Badge +6

@SanjeevRao- when i look at your screenshots it appears that you have two instructions on what you want the logic to do on that question if the same condition is entered. i captured them below: 

if score is greater than = 2 multiply by 0, and 

if score is greater than = 2 jump to q5

in between these you have a ‘if score is less than 2, go to submit. 

the order of your logic operations needs to be evaluated and avoiding any conflicts

 

at this instance, if the score is less than two and you want to user to submit, put that as the first routing statement. then do your evaluation on if score is gte 2. 

I would also suggest creating another variable and using that as opposed to score, a system variable. 

just some additional thoughts

 

 

 

 

Reply