Copy link to clipboard
Copied
Does anyone understand how a "failure" works?
I have written a JavaScript which should execute "on failure", but I am not sure what classifies as a "failure".
My Drag & Drop has a "reset" button to return everything to its original spot and allow the user to keep trying until they get the correct answer, at which point it executes another JavaScript to go to the next slide (working).
I turned on "failure caption" for debugging, but apparently dragging an incorrect combination of sources does not count as a failure?
How my project currently works:
- There are 6 sources.
- There are 3 targets.
- When the correct sources are dragged onto the correct targets, it goes to the next slide (working).
Thank you in advance.
Copy link to clipboard
Copied
I would never use JS for showing captions in D&D because that functionality is built in.
If you use the default work flow, the Failure caption will appear. But the Failure ACTION which you need to trigger the JS only occurs after the last attempt. That is the same as for default quiz slides, but there it is better labeled 'Last Attempt' instead of 'Failure'. Since you have Infinite attempts, that Last attempt never occurs....Since I'm not a JS expert, only use it when the functionality of Captivate or its advanced actions are missing something, don't really know how you trigger this JS script. What I just explained about the action, and more tips can be found in:
Drag&Drop tips - Captivate blog
Maybe you could use the InBuilt states, if you are on CP9, and show a failure caption that way:
Copy link to clipboard
Copied
I used captivate's "failure caption" to test whether failures occured or not. The reason I am using JS is because I am trying to make my own version of google analytics which records data every time a wrong answer (failure) occurs.
Copy link to clipboard
Copied
Failure occurs, but the Failure action should be renamed Last Attempt: that event is not occurring for Infinite attempts.
The failure caption should appear for each failed attempts however, it combines the Retry and the Failure caption of a normal quesiton slide. If it doesn't appear for you, something must be wrong with the setup.
Copy link to clipboard
Copied
Oh. Do you know if there is a way to have the sources auto reset when a failure occurs? I would prefer to not have the reset button.
From your links it seems auto resetting can only be done by going back to the frame at the start of the slide? But that is still with the button. I would like to connect it with the failure.
Copy link to clipboard
Copied
No, since an intermediate failure cannot trigger an action. You could add a shape button to try to Re-enter the slide.
Copy link to clipboard
Copied
Ah. I believe I can't re-enter the slide or reset the frame either, because of the analytics. It's tied with the OnLoad event and requires mistakes being recorded.
I made a quick video showing my project: CapD&DVid - YouTube
Notes: I didn't record my mouse, but what I did was:
- Choose an incorrect combination.
- Press the reset button.
- Choose the correct combination (auto success triggers and takes me to the next level).
Copy link to clipboard
Copied
I'm out of ideas in that case, never had such a use case until now. Sorry.
Copy link to clipboard
Copied
That's fine. Thank you for your time and effort.