Answered

Help with complex conditional logic with Security Question for double scores

  • 26 September 2022
  • 3 replies
  • 58 views

Good morning, i’m experiencing a problem while developing a complex survery, where the user can get points from multi-answer questions and, if the number of answers are the same for each group, he/she will be redirected to security questions in order to unbalance the score.

Example:

Questions from 1 to 7: Choose between A, B, C, D, E, F, G.

Each choice has a different ending, based on score (IF A score > others, THEN redirect to ending A) 

In our tests, the user ends up very often with the same score for 2 answer, so we decided to implement a security question that must work like this: 

    

IF the score for answer A is the same for answer B, THEN redirect the user to a custom page (will be one for every pair, in this case the pair is A-B) where the user can choose between A and B to unbalance the score, answering A or B will then add score to the answer and redirect to the correct ending.

I’m unable to do this on Typeform because of the missing of a variable comparator (IF @varA == @varB THEN ….), i’ve seen some form of comparators here in the forum but it’s not working as intended. 

 

Kindly asking for help :) thanks!     

icon

Best answer by john.desborough 26 September 2022, 22:52

View original

3 replies

Userlevel 7
Badge +5

@john.desborough do you have any setups like this? 😯

Userlevel 7
Badge +6

@Liz @SchreberTech - i have done this - in part: the hard part is in the calculations of the ties - and the ‘number’ of ties. Unless you can guarantee that only a max of two variables can have a tie score, i think it works out that (out of 7 variables):

  • there can only be one unique score of 6 (ie A is gt B and A is gt C… and A is GT G then go to ending A; same if B is greater than all the others) 
  • if there is no unique high score, then you have to look at evaluating how many could have the same score: there are a possibilities that the high score in the variables could be at a ‘count’ of 5 or 4 for ties. 
  • you would need to create some variables have the ability to record a ‘tie status’ 
    • ie v_is_A_tied_5, v_is_B_tied_5, etc as text variables and set them to ‘no’ to start with 
    • then when you do your logic rules, you establish if there is a unique count of 6, if not you check A to see how many times it is greater than the others, if it is 5, then once you are done the same for all the others, you need to do something like this: 
      • if A count is 5 AND A count = B count then replace v_is_A_tied_5 with tied-5 (and then replace v_is_B_tied_5 with tied-5)
      • to the same with the other variables to set the is_x_tied variables
      • then do the logic to determine which variables are tied at 5 and walk the path to the tie breaker question for 2 or 3 variable combinations would could be tied at 5 (A-b, a-c, a-d, etc… abc abd, abe… acd… 

it gets uglier if you have to go down to high score of 4 across the seven variables. 

 

Userlevel 7
Badge +5

Hi @SchreberTech How did Des’s suggestion above go for you? Let us know if you need any other help with it!

Reply