Answered

"And" function in logic not working

  • 7 June 2023
  • 7 replies
  • 47 views

I’ve created a quiz to ask what colours you have in your logo (

 

I have it so that it says ‘if you have <black> in question 3 AND <pink> in question 4, it will take you to an ending that says ‘You have Pink + Black’. But the AND doesn’t seem to function, it bumped me to a different ending entirely. 

icon

Best answer by john.desborough 8 June 2023, 15:09

View original

7 replies

 

Userlevel 5
Badge +4

Hey @PixelsPieces 

From what I can tell from your screenshot, it looks like you have all the option set within one rule. I think if you split them up by using the “Add rule” button for each scenario, then you should get the result that you want.

Let me know if that helps or if I’ve misunderstood the question.

Thanks

Joyce

I do have multiple rules. 

Example: 

If question 3 = red or yellow or orange

AND

if question 4 = blue or green or purple

then to go B

 

It looks like the AND isn’t working. It should be that both conditions need to be met but it looks like it is going to a particular ending if any of the conditions are met not both (which I would think is what AND means)

Test

Userlevel 5
Badge +4

Unfortunately I don’t think the logic is quite that smart to group them together like that. I think you’d need to add a rule for each option separately (which I know is a lot of work).

So for example

IF q3 = red
AND q4 = blue
THEN ending B

IF q3 = red
AND q4 = green
THEN ending B

etc.

Ugh. I was afraid of that.. there are 96 possibilities! 

Userlevel 7
Badge +6

@PixelsPieces - one approach that I have used for this type of scenario, is along these lines, but it means creating a couple/few more variables:

  • If question 3 = red or yellow or orange then replace v_q3_optA with “yes’
  • if question 4 = blue or green or purple then replace v_q4_optA with ‘yes’
  • if v_q3_optA = yes AND v_q4_optA = yes then go to B

yeah it means a lot of figuring out but once you have the core part of it done, you have a template for other forms that use similar logic in the future.

 

just a thought or two

 

des

Reply