Skip to main content
AskingAboutJS
Inspiring
January 2, 2017
Question

Drag & Drop Failures?

  • January 2, 2017
  • 1 reply
  • 618 views

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.

    This topic has been closed for replies.

    1 reply

    Lilybiri
    Legend
    January 2, 2017

    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:

    Drag&Drop in 2016 with Captivate 9 - Captivate blog

    AskingAboutJS
    Inspiring
    January 2, 2017

    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.

    Lilybiri
    Legend
    January 2, 2017

    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.