Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Hi Lilybiri,
Thanks for your update.
Here is what I've now tried:
For the first options in the two widgets (learning interactions), I have changed "Choose cost" to "Cost" to get rid of the space between the two words, and likewise "Choose amount" is now just "Amount".
I have removed the pause action from the list of actions that are triggered by the calculate button.
I have added two text containers and these now contain references to the two widgets cbo1 and cbo2. These correctly update and show the values of the two widgets on alternative entries on to the slide. However, they remain unchanged on every other entry. So the problem still remains as before.
Here is a video of this project in action:
Copy link to clipboard
Copied
Did you use the On Enter event of the slide to clear the variables:
Assign cbo1 with v_null
Assign cbo2 with v_null
The variable v_null is just an empty variable. Because Captivate cannot distinguish numbers from strings, that is the only way within Captivate (can be done with JS without any doubt) to clear a variable. More details: Where is Null? - Captivate blog
Copy link to clipboard
Copied
Hi Lilybiri,
Thanks for persevering with this.
Re assigning widgets with null values: I hadn't done this earlier but did so about an hour ago, as you can see here:
fig 1
As you can see the action is linked to the Enter Action of slide 1. However, the problem remains as it was. THE WIDGETS ARE NOT WORKING AS EXPECTED
==================================
I have also just run the project in Internet Explorer outside of Captivate. So this is not just a preview. Again, THE WIDGETS ARE NOT WORKING AS EXPECTED. The error console shows the following:
fig 2
Judging by this error message, the widgets don't appear to exist when I re-enter the slide after coming back from slide 2. The error is reported as occurring on line 1 of the widget files but these files appear to be OK. Here for example, is the file for Widget_4804.htm:
<!DOCTYPE HTML><HTML><HEAD><TITLE>Adobe Captivate Widget</TITLE><META NAME="generator" content="Adobe Captivate 6"></META><script type="text/javascript" src="../wr_4798/jquery-1.7.1.js"></script><script type="text/javascript" src="../../assets/js/OpenAjaxManagedHub-all.js"></script><script type="text/javascript">function init(){ hubClient = new OpenAjax.hub.IframeHubClient({HubClient: {onSecurityAlert: function() {} } }); hubClient.connect(function() { var id = hubClient.getClientID(); hubClient.publish(id+"_loaded","loaded"); });}function deInit() { if(hubClient) { hubClient.disconnect(); } } jQuery(document).ready(function() { init();});</script></HEAD><BODY><div ID="Widget_3981_resource_use">
<div id="description_div"></div>
</div ><script type="text/javascript" src="resource_use.js"></script></BODY></HTML>
Line 1 column 1 is obviously OK. So I guess the problem is occurring before this point?
==================================
I've also run this in Firefox and found that the widgets ARE WORKING AS EXPECTED. However, there are lots of errors being thrown up in the console:
fig 3
==================================
I've now run this in Chrome and the widgets ARE WORKING AS EXPECTED. However, again the log files show that errors are being generated which relate to the widgets. As you can see here:
fig 4.
==================================
Finally, I've run this in Safari and found that the widgets ARE NOT WORKING AS EXPECTED. Here is a screen shot of the error message that I got:
fig 5
To sum up then, the widgets work in 2/4 browsers but they are throwing up errors in all cases.
Given the problems that I'm experiencing, It's difficult to see how one can have confidence that Adobe has solved the HTML5 workflow.
Copy link to clipboard
Copied
I had many of the same issues/errors as you are reporting. After a couple of days, I was able to solve them all, even the Firefox issues.
You will have to edit the resource_use.js files for the widgets, but you can save that for last. In my files it was converting numbers to strings and then using that for a comparison, which never works. I also added code to stop portions of the code from executing if it had been previously run.
Start by doing these steps:
In the CPM.js change: noteOn to start and noteOff to stop;
Unminify the OpenAjaxManagedHub-all.js and CPXHRLoader.js files. I use jspretty.com
Do not use Adobes "new" index.html template. It should not include the webkit fix.
Fix Firefox char error:
Find:
<TITLE>Adobe Captivate Widget</TITLE><META NAME="generator" content="Adobe Captivate 6">
Replace
<TITLE>Adobe Captivate Widget</TITLE><META NAME="generator" content="Adobe Captivate 6"><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
That will get you started. There are several more, but they are specific to my widget I'm sure. But probably similar. I kept a copy of the wr folder and just replaced my published output with the "fixed" wr folder every time I published. I will eventually edit the widgets.
Also, if you could tell me the file location of the widget/interaction you used, I could see if I get the same errors?
Copy link to clipboard
Copied
Hi TLCMediaDesign,
Thank you for your reply. I do appreciate this.
However, given the problems that I've encountered with a simple select with just a couple of options, I've lost confidence that Captivate will able to support my development workflow. Even if I resolve the widgets data issue, the widgets themselves are - from a design perspective - far from ideal: for example, one cannot have fonts larger than 14pts. There is also of course the issue of space characters in the widget data elements. This can also be fixed by modifying the underlying JavaScript, but of course one uses Captivate precisely to avoid having to delve into system files. It's meant to be a fast development environment for developing e-learning but it is sadly lacking. I know that Adobe have spent a lot of time and effort in enabling e-learning content across mobile devices but for me, they haven't delivered on the basics: how is it possible not to have a working select out of the box when Captivate is touted as being able to produce HTML5?
For the time being therefore, I have decided that if I need to tinker with Adobe's files, I may as well to switch to developing in HTML, CSS and JavaScript. At least in this environment, I can be sure that whatever I produce will meet my requirements.
Kind regards,
Irfan Virk
Copy link to clipboard
Copied
Just another answer: I logged a feature request to be able to have a font size greater than 14, and really hope it will be done. This is the only interaction with that limitation.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now