Skip to main content
jarry
Participating Frequently
November 18, 2014
Question

Captivate and Javascript - possible to use Quiz Reporting functionality without user interaction?

  • November 18, 2014
  • 2 replies
  • 1252 views

Hi everyone,

I'm hoping to find a way to be able to have Adobe Edge interactivity and animation with Captivate's LMS and reporting capabilities.

Basically, what I would like to do is:

- Have Adobe Edge Animate interactions/animations across multiple Captivate slides using the HTML5 Animation media.

- These Edge animations will have custom Javascript to communicate back to Captivate (using Common JS interface) and tell it to go to the next slide, etc.

Captivate is basically just being used as a container for the Edge content in this case.

What we'd like to work beyond this is quiz reporting. So, if a user completes some kind of Edge quiz, Captivate is still able to award them points somehow. However, as far as I can tell, most custom quiz reporting functions require a mouse click or keypress to validate/submit, and we're trying to keep all the interactive elements inside Edge only.

Since it is not possible to use Javascript to change many of the system variables that are read-only, I thought it might be possible to use an invisible text entry box instead. So, if the user interacts correctly with the Edge content, the Edge javascript will assign a text entry box variable in Captivate with something like 'Correct'. The text entry box would have the validate option turned on, and the success action would be to continue to the next slide.

However, it seems as though the text entry box variable cannot be assigned, as it does not changed when I test it (using Captivate only). Captivate also won't seem to validate the box unless the user clicks on a submit button or makes a keypress.

Similarly, a simple button cannot be told through variables or actions to 'press itself' and submit quiz reporting data.

Can anyone think of something I may have missed, or some other workaround?

    This topic has been closed for replies.

    2 replies

    kerrynStahls
    Participant
    October 14, 2015

    I came across this same issue while trying to build a better pre-test in Captivate. This is the basic run down of what you need to do:

    1. Create a variable in CP for your score (let's call it "vScore") and set it from your Edge Animations

    2. When the user completes the test make the slide go to next slide set to play for 3 seconds (we'll call this the "computation slide").

    3. For the "computation slide" on Enter Action use Execute Javascript and do something like what follows to get your variable from CP and push it to the LMS.


    --- Code Window ---

    //set up a Javascript variable to capture the variable from Captivate

    var myScore = window.cpAPIInterface.getVariableValue('vScore');

    //at this point it is still a string so let's make it a number

    var myScore = Number(myScore);

    //now let's send it to the LMS

    SCORM_objAPI.LMSSetValue('cmi.core.score.raw', myScore);

    SCORM_objAPI.LMSSetValue('cmi.core.lesson_status', 'passed');

    SCORM_objAPI.LMSCommit('');

    ---

    If you want to be able to do things like overwrite the score or remember a previous score you'll have to mess around with additional variables but the "meat and potatoes" is all there.

    I hope this works out for you!

    Lilybiri
    Legend
    November 18, 2014

    I'm not sure it can help, but I described a workaround in this blog post, for custom questions.

    Report Custom Questions - part 2 - Captivate blog

    Since only interactive objects can be scored and included in the total score (cpInfoPointsscored) I created two (shape) buttons that would transfer the score. That can be a next button. One of the buttons has score 0, the other one score equal to the total score of the question. Based on a conditional action (where you can use the variable transferred from Edge) you show either of them.

    jarry
    jarryAuthor
    Participating Frequently
    November 19, 2014

    You're right about the interactive objects being the only "scorable" items, Lilybiri. And your workaround could work, but is there a way of firing the conditional action directly from Edge? Otherwise it seems you would have to pass the variable from Edge to Captivate, have the user click an initial Captivate button to run the conditional action, which would then show the various scoring buttons.