Forum Discussion

KatherineBurrow's avatar
KatherineBurrow
Community Member
3 months ago

How to use result of random draw from question bank to affect variable on next slide?

I'm trying to create a game and I have no idea if there's a way to do this (either obvious or a workaround):

Slide 3.2 is a 'draw from question bank' slide, and the question is drawn randomly.

Slide 3.3 is a regular slide, and I want a layer to show when the timeline starts if the user got the randomly drawn question on Slide 3.2 incorrect.

Everything I can think of variable-wise is hampered by the fact that the question is drawn randomly (vs. a specific question slide), but I really need the random draw for replayability.

Any thoughts or ideas? Thanks!

  • AndrewHanley's avatar
    AndrewHanley
    Community Member

    Hi Katherine.

    Tom's solution has nailed it here and will work great.

    However as a slight variation, you might actually just need 1 T/F variable. This would record if they got the random draw Q correct (true) or incorrect (false)

    Set this variable to FALSE by default.

    Now all you need is a single trigger on each of your question's CORRECT layer. This trigger would set the variable to true.

    Now regardless of which question they draw, you will know if they got it correct or not. 

    Hope it helps!

  • Yes, as long as the draw only pulls 1 question, I agree with Andrew about using just 1 T/F variable. 

    However, if they might revisit the slide with the draw (e.g., for another "round" of the game), be sure to add a trigger somewhere that resets the variable back to False. 

    Or, in addition to a set-variable-to-True trigger on each Correct layer, include a set-variable-to-False trigger on each Incorrect layer.

  • Thanks, everyone!! I’ve been banging my head against a wall for several hours. This is perfect.