Skip to main content
Inspiring
August 1, 2017
Question

Clearing Variable when replaying a slide

  • August 1, 2017
  • 1 reply
  • 517 views

I created an elaborate slide with 8 spots to use a click box to create a score. Every time the click box is clicked a variable "buttonpressed" is incremented by 1. I gave the learner the option to try again. I used an Advanced Action when they answer yes to "do you want to try again" to assign "buttonpressed" to zero then restart the slide. Unfortunately it keeps the original score. Assigning the variable "buttonpressed" with zero does seem not work.

    This topic has been closed for replies.

    1 reply

    Lilybiri
    Legend
    August 1, 2017

    You have to use an empty variable (or JS). I usually have such a variable v_null and then use the command:

      Assign myVar with v_null

    I explained this work flow many years ago:

    Where is Null? - Captivate blog

    RStedmanAuthor
    Inspiring
    August 1, 2017

    Still a complete failure. When the slide restarts it still gives me the old score. I used this advanced action to try and clear the score

    Lilybiri
    Legend
    August 1, 2017

    In that case there must be a logical bug. I need complete information and screenshots of all actions with the events used to trigger them. The action that you showed, is this triggered by the On Enter event of the slide? In that case, are you sure that the event occurs. This is linked with my next question.

    What do you mean by 'when the slide restart'?  How is this restart orchestrated please? How did you test? Which version are you using. Is it meant for SWF or HTML5 output. I know that at this moment there is a bug in CP2017, where the On Enter action of a slide is not executed if you use just jump again to that slide, you need to insert a dummy slide as a workaround. I showed this in a blog post:

    Playing a dice game, using While loop - Captivate blog