Skip to main content
Participating Frequently
June 8, 2015
Question

Why do drop down widgets only provide the correct value on first use but fail to do so after coming back to a slide?

  • June 8, 2015
  • 1 reply
  • 1172 views

This problem is described below in a project with two slides.

The first slide contains two widget with drop down values and a button which is used to divide the value of the first widget by the value in the second widget e.g. 200/10. The calculate  button is linked to advanced actions.

This works correctly the first time that I enter this slide. However, if I go onto the next slide but then come back to the first slide, it does not work.  Below is a sequence of images which shows this:

fig 1 - First option in widget 1 is "Choose cost" and in widget 2 is "Choose amount". The other values in the first widget are 200 and 400 and the values in the second widget are 10 and 20.

fig 2  - works correctly and shows 20 in the result box. I then store the result in a text area next to the label Answer 1

fig 3 - I have now moved on to slide 2. This just contains a button to return to slide 1.

fig 4 - Now back on slide 1 again. This time I get a NaN error message. Despite the fact that the widgets are showing 400 and 10 respectively, the underlying values appear to be the text strings from the first options in the widgets i.e. "Choose cost" and "Choose amount" and this is why NaN has appeared in the result box.

fig 5 - now back on slide 2 again for a second time.

fig 6 - now back on slide 1 for third time - this time the widgets will work correctly again. The correct result of 40 is shown and I can store this next to Answer 2.

It seems then, that the widgets will only provide the correct values after a second entry onto a slide i.e. they work on the 1st, 3rd, 5th, etc. entries on to a slide but not on the 2nd, 4th, 6th, etc. entries.

The captivate development screen looks like this:

.

And the advanced action screen looks like this:

Would appreciate any thoughts on how to resolve this issue.

This topic has been closed for replies.

1 reply

Lilybiri
Legend
June 8, 2015

No need for the pause at all, any advanced action will never release the playhead.

I suppose cbo1 and cbo2 are the variables associated with the two dropdown interactions?  Why do you use two variables for the result: both temp_var and result? I don't see any reason.

You are talking about a widget, I think you mean a learning interaction if you are using Captivate 8.0.1.242? Can you confirm?

Recently I blogged about this interaction: Dropdown Interaction - tips - Captivate blog  Typically each interaction is reset when you leave the slide.

Fan VirkAuthor
Participating Frequently
June 8, 2015

Lilybiri,,

Thanks for your prompt response.

Re pause: yes you're right the pause is not necessary. It was left in because in an earlier experiment I had used it to pause the play head. However, it doesn't affect the outcome of the problem that I'm experiencing.

Re cbo1 and cbo2: yes they are associated with the dropdown interactions.

Re temp_var and result: I used temp_var as a holding variable to echo using an alert function call in an earlier experiment. Again, it doesn't affect the outcome.

Re widgets: yes these are learning interactions. I've used the term widget because that is how they are shown when they are inserted into a slide. Typically, Captivate labels them, Widget_1, Widget_2, etc.

Re your blog: I did read this blog on Dropdown Interactions, but I couldn't see a solution to my problem.

Re captivate version: yes I'm using version 8.0.1.242

Lilybiri
Legend
June 8, 2015

It is difficult when I'm not able to reproduce the problem at all. You could try to reset the variables to the value of a null variable (empty variable v_null) using the On Enter event of slide 2. It doesn't seem to be necessary to me. NaN means that is it not a number. There was a problem with HTML5 output for calculations in the first version of 8, but not in the updated one. Can you track the values of the variables cbo1 and cbo2 by inserting them in a text container to see what is happening?