cybercussion / SCOBot

SCORM API for Content. JavaScript library, QUnit tests and examples.
https://cybercussion.com
156 stars 34 forks source link

Trouble with scorm.setvalue('adl.nav.request', 'continue'); #1

Closed BlazeCell closed 11 years ago

BlazeCell commented 11 years ago

I'm having trouble getting the LMS to move on to the next SCO after calling

scorm.setvalue('adl.nav.request', 'continue');

I copied the ScoBot.finish() function and came up with this:

/**
 * Next
 * This will move to the next sco in the sequence.
 * @returns {String} 'true' or 'false'
 */
this.next = function ()
{
    if (isStarted)
    {
        scorm.debug(settings.prefix + ": I am moving next...", 3);
        scorm.setvalue('adl.nav.request', 'continue');
        updateStatus();
        scorm.commit();
    }
    return notStartedYet();
};

But whenever I call my ScoBot.next() function, the SCO page does not move on to the next one in the manifest.

I've tried calling

scorm.set('success_status', 'passed');

to work with updateStatus() but I'm still getting no dice.

It appears to me that SCORM_API is set up to create standalone SCOs, not a squence of SCOs in a single content package, so maybe I'm trying to do something that's not intended... =/

Any direction on this issue would most appreciated.

Thank you.

cybercussion commented 11 years ago

Hi, Try setting the adl.nav.request then call SB.commit then SB.finish or SB.suspend depending.

My partner says adl.nav.request is a 4th Edition feature so that might be the next place to look.

Thanks, Mark

Sent from my iPhone

On Dec 4, 2012, at 7:47 PM, BlazeCell notifications@github.com wrote:

I'm having trouble getting the LMS to move on to the next SCO after calling

scorm.setvalue('adl.nav.request', 'continue'); I copied the ScoBot.finish() function and came up with this:

/**

  • Next
  • This will move to the next sco in the sequence.
  • @returns {String} 'true' or 'false' */ this.next = function () { if (isStarted) { scorm.debug(settings.prefix + ": I am moving next...", 3); scorm.setvalue('adl.nav.request', 'continue'); updateStatus(); scorm.commit(); } return notStartedYet(); }; But whenever I call my ScoBot.next() function, the SCO page does not move on to the next one in the manifest.

I've tried calling

scorm.set('success_status', 'passed'); to work with updateStatus() but I'm still getting no dice.

It appears to me that SCORM_API is set up to create standalone SCOs, not a squence of SCOs in a single content package, so maybe I'm trying to do something that's not intended... =/

Any direction on this issue would most appreciated.

Thank you.

— Reply to this email directly or view it on GitHub.

cybercussion commented 11 years ago

Ok, not on my phone now.

Looks like a recommendation might be to go this way -

this.next = function() {
    if(isStarted) {  // Sorry my previous example had a ! (checking false instead of true)
        scorm.debug(settings.prefix + ": I am moving next.  Is continue allowed? " + scorm.getvalue('adl.nav.request_valid.continue'), 3);
        //if (scorm.getvalue('adl.nav.request_valid.continue') === 'true') {  // This value can be 'true' or 'false'  as well as 'unknown' string.
            // Then call 'continue'
            //scorm.setvalue('adl.nav.request', 'continue');
        //}
        SB.commit();
        scorm.setvalue('adl.nav.request', 'continue'); // The LMS will do its work to check the validity of the navigation on/after commit
        return SB.suspend(); // or finish() -  you could use SB[scorm.get('exit_type')](); to so it uses your default behavior.
    } else {
        return notStartedYet();
    }
}

We looked into 3rd Edition and looks like ADL stuff is there so ignore my message about 4th edition. You may need to set some scoring values to satisfy the LMS, but I'd have to look into the rules. I think 'continue' may be enough, but your right I didn't get to any ADL requests yet in my project. Thanks for attempting to get that part going.

Mark

BlazeCell commented 11 years ago

Thanks for replying, Mark.

Unfortunately, your proposed fix isn't working either. I'm getting an error in the console that says:

SCOBot: You didn't call 'start()' yet, or you already terminated, ignoring.
cybercussion commented 11 years ago

Sorry, take the "!" off "if (isStarted)". It was late and I goofed.

Also please note I updated a 'makeBoolean' call to turn the string returned from 'adl.nav.request_valid.continue'. That would of failed. Sample above updated.

BlazeCell commented 11 years ago

I've tried your latest fix, but it's unfortunately still not working.

This is what I get in the console when I trigger the next() function:

LOG: SCOBot: I am suspending... 
SCORM_API: Terminating true [object HTMLObjectElement] 
LOG: SCORM_API: completion_status = incomplete|| success_status = passed 
LOG: SCORM_API: Committing data 
LOG: SCORM_API: Terminated. 
cybercussion commented 11 years ago

I adjusted the code above to trace out whether your LMS is providing support for 'continue'. See - scorm.debug(settings.prefix + ": I am moving next. Is continue allowed? " + scorm.getvalue('adl.nav.request_valid.continue'), 3); That should narrow down if the LMS is returning 'false'. You could attempt to not check for support, and set it anyway but that might shed some light to if the LMS features support to advance to the next SCO on terminate.

BlazeCell commented 11 years ago

Well, I'm using ADL's example LMS, so I don't think support for the 'continue' feature is the issue as the example content packages from ADL work fine.

brandonbradley commented 11 years ago

Which of ADL's examples are you finding work fine? It could be how something is specified in the manifest too.

BlazeCell commented 11 years ago

I've tried ADL's:

You can find those resources here: http://www.adlnet.gov/capabilities/scorm#tab-learn

cybercussion commented 11 years ago

BlazeCell, I'm taking a look at the scenario quick to identify what would make a LMS evaluate the manifest seq & nav tree as something that can be continued. Right now I did a quick test and its getting evaluated as 'false'. Have a feeling it may be some parameters in the CAM (imsmanifest.xml) that need to be adjusted. I'll follow up in a bit.

cybercussion commented 11 years ago

BlazeCell, In order to enable Flow you'd have to add -

<imsss:sequencing>
      <imsss:controlMode choice="false" choiceExit="false" flow="true" forwardOnly = "true"/>
</imsss:sequencing>

to a tier above your SCO items in the manifest.

I added this to the project now and updated some tests so everything checked out. I had to add this sequencing information at the top tier/item above my QUnit tests (3). If I enabled 'continue' it auto-advanced thru all of them and worked fine.

Let me know if you have any other issues.

Notes: If any one else has this issue, understand that the LMS can have buttons available within the UI around the SCO. Based on setting commit, the LMS will calculate whether the adl.nav.request_valid.continue is 'true', 'false' and prior to that it may respond 'unknown'. Along with the next, and previous buttons you can make it so the user/student has or has no choice, and can go forward only or allow them to go backwards. There are other settings done on each SCO within the adlnav:presentation element which may hide the features to take them out of the flow.

<adlnav:presentation>
    <adlnav:navigationInterface>
        <adlnav:hideLMSUI>continue</adlnav:hideLMSUI>
        <adlnav:hideLMSUI>previous</adlnav:hideLMSUI>
        <adlnav:hideLMSUI>suspendAll</adlnav:hideLMSUI>
    </adlnav:navigationInterface>
</adlnav:presentation>

So a SCO may use 'adl.nav.request_valid.continue' if they wish to display the "continue" button, but you can just attempt to set:

scorm.setvalue('adl.nav.request', 'continue');

and when the SCO terminates the LMS will advance you to the next SCO in the tree if its allowed. It is all hinged on your imsmanifest.xml being configured. I've committed what was discussed here to the project so it would have an example.

cybercussion commented 11 years ago

I'm going to close this out. If you have any other questions please feel free.