Copy link to clipboard
Copied
Hello,
With Captivate, I can execute Javascript or an advanced action when drag object is accepted. (See below) This is good. How can I do the same when a drag object is rejected? Is that possible?
Thanks for any help!!
I am using Captivate 2017.
Copy link to clipboard
Copied
German! Is logical when I see your name.
If you want object actions for both correct and wrong drag actions you cannot restrict them to allow only the correct ones. What do you want to do? I know JS is hype at this moment, even for very simple workflows (I prefer the KISS principle). Are you aware of the InBuilt states for drag sources and drop targets? You don't tell what you want to do with JS. Have a look at:
Built in States for Drag&Drop objects - eLearning
An example of a D&D where I used the (simple) advanced/shared actions:
Copy link to clipboard
Copied
I need to send one kind of xAPI (Tin Can) Statement to an LRS when the object was accepted, and a different kind when it is rejected.
To be more specific, I am taking an old project and giving it xapi capabilities -- or more capabilities than you get when you publish the project as Tin Can. I don't really want to make huge Captivate changes because it was already accepted by the customer long ago.
Right now, when the answer is rejected, it flies back to its original position, and there is a quick "incorrect" feedback that dissappears after a few seconds seconds. When the answer is correct, the drag object "sticks" and there is a quick "correct" feedback. Essentially, it is impossible to get a wrong answer, but I still would like to track a wrong answer attempt with xapi.
I think if I make all three answers "acceptable", they would "stick" on the drop object, and the short "rejected" feedback will not be shown, right?
Copy link to clipboard
Copied
Is that feedback an InBuilt state, which would indeed appear for a short time? Indeed, you should allow wrong drag actions in order to have them trigger any command. That would mean the wrong drag sources are not rejected anymore, but you can allow to have them replace if only one drag source per drop target is allowed.
Copy link to clipboard
Copied
The feedback is I believe a "On Success" and "On Failure" feedback that appears because have the corresponding boxes clicked. This is the case for all three drop areas.
The problem with your proposed solution, if I understand it correctly, is that when all three drag objects are "accepted", then by definition, they are not rejected, which means the "On Failure" feedback is not shown, and the drag object does not fly back to its origin.
You proposed something like the following, correct?
Copy link to clipboard
Copied
Failure feedback is only shown after clicking the Submit button, because it is appearing after validation of the D&D. If it is a Feedback created in an InBuilt state, it will appear immediately after the drag action. You have to check that out, reason why I gave you a link to the D&D states article.
Indeed the drag object will not be sent back (Zurück) but if you keep the count (Anzahl) to 1 you can choose the option Replace (Ersetzen) but you have to uncheck 'Alle Akzeptieren'. Cannot offer you a screenshot, have only an English and a French version.
Copy link to clipboard
Copied
The feedback is an "On Reject" feedback. I think that means it's an InBuilt state? Not sure what InBuilt states are.
We want to have unlimited attempts.
I am going to conclude it is not possible to do what I want to do, but thanks for all of the help!
- Ryan
Copy link to clipboard
Copied
I offered you a link to a tutorial which explains in depth all InBuilt states for D&D, it even has an interactive movie. Of course, if you don't want to read or watch it, that is your choice. It could be possible to use an InBuilt state to have exactly the behavior that you want.
Copy link to clipboard
Copied
Hi Lilybiri,
I read the your post and I understand how you can change the InBuilt State. Thank you.
I am sorry. This does not help, however. Could you tell me how I can execute Javascript "on reject"? Giving a drag or drop object various states does not help me with this. Feel free to send English screenshots. I am sure I will be able to understand them. : )
Copy link to clipboard
Copied
This will tell you if the failure caption is showing. Just execute onSlide enter of the DD slide and change the name in the first line to the name of the failure caption/shape:
var elem = document.getElementById("Failure_Shape_1");
setInterval(function()
{
if ( elem.style.visibility === "visible")
{
console.log("SHOWING");
}
}, 500);
Copy link to clipboard
Copied
David, I don't think this is what OP wants. Failure message appears after submitting the D&D slide. He wants to use the event when a drag source is rejected in one drag action, it is an object action. But there is no object action if the accepted drag source is limited to the correct one, at least not to trigger an advanced/shared action.
Copy link to clipboard
Copied
Goctha, thanks, slight misread.