Picture of Alvaro Gil
ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Alvaro Gil - Thursday, 5 November 2015, 4:40 PM
 

Hi all,

 

I'm developing a course with Chamilo and using Adapt for lessons. The problem for me is  that i want to connect the progress in the Adapt lesson to the Chamilo progress lesson.

 

I've used the following configuration for config.json:

 

{
"_defaultLanguage": "es",
"_defaultDirection": "ltr",
"_questionWeight": 1,
"_accessibility": {
"_isEnabled": true,
"_shouldSupportLegacyBrowsers": true,
"_isTextProcessorEnabled": true
},
"_drawer": {
"_showEasing": "easeOutQuart",
"_hideEasing": "easeInQuart",
"_duration": 400
},

"_spoor": {
"_advancedSettings": {
"_commitRetryDelay": "2000",
"_maxCommitRetries": "5",
"_timedCommitFrequency": "10",
"_commitOnStatusChange": "true",
"_showDebugWindow": "true"
},
"_reporting": {
"_onAssessmentFailure": "incomplete",
"_onTrackingCriteriaMet": "completed"
},
"_tracking": {
"_shouldStoreResponses": "false",
"_shouldSubmitScore": "false",
"_requireAssessmentPassed": "false",
"_requireCourseCompleted": "true"
},
"_isEnabled": "true"
}
}

 

The lesson .zip SCORM has been uploaded to Chamilo LMS correctly but when I access the lesson this message occurs:

 

ScormWrapper::initTimedCommit
ScormWrapper::getValue: _property=cmi.suspend_data
ScormWrapper::getValue: returning
ScormWrapper::getValue: _property=cmi.core.lesson_location
ScormWrapper::getValue: returning
ScormWrapper::getValue: _property=cmi.core.score.raw
ScormWrapper::getValue: returning 0
ScormWrapper::getValue: _property=cmi.core.lesson_status
ScormWrapper::getValue: returning
ScormWrapper::getStatus: invalid lesson status '' received from LMS
ScormWrapper::getValue: _property=cmi.core.student_name
ScormWrapper::getValue: returning Gomes, Álvaro
ScormWrapper::getValue: _property=cmi.suspend_data
ScormWrapper::getValue: returning
ScormWrapper::getValue: _property=cmi.core.lesson_location
ScormWrapper::getValue: returning
ScormWrapper::getValue: _property=cmi.core.score.raw
ScormWrapper::getValue: returning 0
ScormWrapper::getValue: _property=cmi.core.lesson_status
ScormWrapper::getValue: returning
ScormWrapper::getStatus: invalid lesson status '' received from LMS
ScormWrapper::getValue: _property=cmi.core.student_name
ScormWrapper::getValue: returning Gomes, Álvaro

 

The fact is that the lesson worksd fine but the progress into the lesson is not showed in chamilo. 

Any help woul be appreciated. ;) Thanks in advance. Kind regards,

Alvaro

Picture of Matt Leathes
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Matt Leathes - Thursday, 5 November 2015, 5:53 PM
 

Hi Alvaro

The error message the course is presenting is quite correct - the LMS is returning an empty value for cmi.core.lesson_status - but this is an invalid value.

The only acceptable values for lesson_status are:

  • not attempted
  • browsed
  • incomplete
  • failed
  • passed
  • completed

According to the SCORM 1.2 documentation:

If it is the student’s first attempt at the SCO the lesson_statusis set to not attempted. The LMS is responsible for setting the initial value to "not attempted".

I would suggest this requires you logging a ticket with your LMS provider to get this fixed but in the meantime you can hack the code to workaround this. You'd need to edit scormWrapper.js in the adapt-contrib-spoor extension, modifying this function to include something like

case "":
  return "incomplete";
break;

Just above the line 'default:'

Picture of Alvaro Gil
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Alvaro Gil - Friday, 6 November 2015, 1:04 PM
 

Thanks a lot! ;)  I'll give it a try. 

Picture of Alvaro Gil
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Alvaro Gil - Friday, 6 November 2015, 1:38 PM
 

Hi Matt, i've tried your solution. My function is like this:

ScormWrapper.prototype.getStatus = function() {
var status = this.getValue(this.isSCORM2004() ? "cmi.completion_status" : "cmi.core.lesson_status");

switch(status.toLowerCase()) {// workaround for some LMSes (e.g. Arena) not adhering to the all-lowercase rule
case "passed":
case "completed":
case "incomplete":
case "failed":
case "browsed":
case "not attempted":
case "not_attempted":// mentioned in SCORM 2004 docs but not sure it ever gets used
case "unknown": //the SCORM 2004 version if not attempted
return status;
break;
case ":
return "incomplete";
break;
default:
this.handleError("ScormWrapper::getStatus: invalid lesson status '" + status + "' received from LMS");
return null;
}
};

 

but when i execute "grunt build" from the console, this is the output:

Running "requirejs:compile" (requirejs) task
Error: Parse error using esprima for file: /home/alvagorn2/Descargas/adapt_authoring-master/adapt_framework/Tutorial/src/extensions/adapt-contrib-spoor/js/scorm/wrapper.js
Error: Line 174: Unexpected token ILLEGAL
In module tree:
core/js/app
extensions/extensions
extensions/adapt-contrib-spoor/js/adapt-contrib-spoor
extensions/adapt-contrib-spoor/js/scorm

{ [Error: Error: Parse error using esprima for file: /home/alvagorn2/Descargas/adapt_authoring-master/adapt_framework/Tutorial/src/extensions/adapt-contrib-spoor/js/scorm/wrapper.js
Error: Line 174: Unexpected token ILLEGAL
In module tree:
core/js/app
extensions/extensions
extensions/adapt-contrib-spoor/js/adapt-contrib-spoor
extensions/adapt-contrib-spoor/js/scorm

at /home/alvagorn2/Descargas/adapt_authoring-master/adapt_framework/Tutorial/node_modules/grunt-contrib-requirejs/node_modules/requirejs/bin/r.js:28015:47
]
originalError:
{ [Error: Parse error using esprima for file: /home/alvagorn2/Descargas/adapt_authoring-master/adapt_framework/Tutorial/src/extensions/adapt-contrib-spoor/js/scorm/wrapper.js
Error: Line 174: Unexpected token ILLEGAL]
fileName: '/home/alvagorn2/Descargas/adapt_authoring-master/adapt_framework/Tutorial/src/extensions/adapt-contrib-spoor/js/scorm/wrapper.js',
moduleTree:
[ 'extensions/adapt-contrib-spoor/js/scorm',
'extensions/adapt-contrib-spoor/js/adapt-contrib-spoor',
'extensions/extensions',
'core/js/app' ] } }

 

Thanks for your help, Matt, any help would be appreciated.;) kind regards,

 

Álvaro.

 

Picture of Alvaro Gil
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Alvaro Gil - Friday, 6 November 2015, 2:21 PM
 

Now the Error is not present but when i complete the Adapt lesson, the Lesson in Chamilo don't show the progress. That's the exit in the ScormWrapper debug window:

 

ScormWrapper::initTimedCommit
ScormWrapper::getValue: _property=cmi.suspend_data
ScormWrapper::getValue: returning {"completion":"-111111111","questions":"","_isCourseComplete":true,"_isAssessmentPassed":false}
ScormWrapper::getValue: _property=cmi.core.lesson_location
ScormWrapper::getValue: returning
ScormWrapper::getValue: _property=cmi.core.score.raw
ScormWrapper::getValue: returning 0
ScormWrapper::getValue: _property=cmi.core.lesson_status
ScormWrapper::getValue: returning
ScormWrapper::getValue: _property=cmi.core.student_name
ScormWrapper::getValue: returning Gil Íñigo, Álvaro
ScormWrapper::getValue: _property=cmi.suspend_data
ScormWrapper::getValue: returning {"completion":"-111111111","questions":"","_isCourseComplete":true,"_isAssessmentPassed":false}
ScormWrapper::getValue: _property=cmi.core.lesson_location
ScormWrapper::getValue: returning
ScormWrapper::getValue: _property=cmi.core.score.raw
ScormWrapper::getValue: returning 0
ScormWrapper::getValue: _property=cmi.core.lesson_status
ScormWrapper::getValue: returning
ScormWrapper::getValue: _property=cmi.core.student_name
ScormWrapper::getValue: returning Gil Íñigo, Álvaro

 

Thanks again ;)

 

Picture of Matt Leathes
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Matt Leathes - Friday, 6 November 2015, 3:15 PM
 

It's a little bit hard to tell from the way the forums format the code, but I think the issue is that you've put

case ";

(as in case-space-doublequote-semicolon)

instead of

case "";

(case-space-doublequote-doublequote-semicolon)

or

case '';

(case-space-singlequote-singlequote-semicolon)

When you try again, make sure you upload to your LMS in such a way that it clears any previous tracking data (or creates a new SCO). Because you've already completed it once Adapt has remembered that in the suspend_data, so now it won't trigger the event that sets the lesson_status to completed.

Picture of Alvaro Gil
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Alvaro Gil - Friday, 6 November 2015, 5:45 PM
 

I think i've done well:

1.- Corrected the single quoted

2.- Deleted Lesson in Chamilo

3.- grunt build

4  zip the build file

5  uploaded lesson into Chamilo

 

I start the lesson in  Chamilo and this is the output: 

 

It seems Ok(No errors) but then i complete the Adapt lesson and nothing happens to lesson in Chamilo. Frustrating. Any suggestion ? Thanks again ;) 

Picture of Matt Leathes
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Matt Leathes - Friday, 6 November 2015, 7:31 PM
 

It would help to see the debug window output at the point you complete the course, just so I can see whether the course is setting the lesson_status to 'completed' or not...

Picture of Alvaro Gil
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Alvaro Gil - Saturday, 7 November 2015, 3:13 PM
 

That's the debug window output when the course is completed in Adapd:

 

Picture of Alvaro Gil
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Alvaro Gil - Saturday, 7 November 2015, 7:10 PM
 

I send the complete Course Scorm.log as attached file. It seems ok... 

Picture of Matt Leathes
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Matt Leathes - Monday, 9 November 2015, 12:07 PM
 

I'm afraid not.

Around the point you see _isCourseComplete change from false to true in the suspend_data you should also be seeing a call to set cmi.core.lesson_status to 'completed'.

Is your config.json still exactly the same as it was in your original post?

Picture of Alvaro Gil
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Alvaro Gil - Tuesday, 10 November 2015, 2:27 AM
 

Yes. I have to say that with another lesson is exactly the same behaviour, the same outpput with "_isCourseComplete":true" but with no "cmi.core.lesson_status"

I'm generating the lessons with Adapt Builder.

 

Could be Adapt Builder the cause of this? 

 

Thanks a lot;)

Picture of Matt Leathes
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Matt Leathes - Tuesday, 10 November 2015, 10:17 AM
 

I can't really see how Adapt Builder could be the cause... it's not impossible but seems fairly unlikely.

The mostly likely explanation for the scenario you're experiencing is that your 'tracking criteria' are set wrong i.e. you're got _requireAssessmentPassed set to true and/or _requireCourseCompleted set to false - which is why I was asking about your config.json setup.

Picture of Alvaro Gil
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Alvaro Gil - Tuesday, 10 November 2015, 6:08 PM
 

That's the situation:

 

I've a lesson with no assessments.

Now it works, but the 100% completed at LMS(Chamilo) is not shown inmediately when I complete the lesson in Adapt., It needs some seconds. In fact, I  think the LMS does not show the result until I close the lesson and go back to the LMS(then the 100% is shown).

Is there any parameter I can configure for doing the refresh of the value occurs inmediately?. 

 

Thanks for your help and patience;) 

 

Picture of Matt Leathes
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Matt Leathes - Wednesday, 11 November 2015, 2:54 PM
 

Hi Alvaro

Probably not... the course completion sequence of events is:

  • you complete all the non-optional blocks, triggering the courseComplete event within Adapt
  • the spoor extension hears this event and checks to see if all the completion criteria have been met or not
  • if they have been met, it takes the value stored in _onTrackingCriteriaMet (config.json) and sets it as the lesson_status
  • because the lesson_status has changed, LMSCommit() is called, this should trigger the LMS' SCORM API to save all tracking data back to the server.

However, while I suspect the LMS is saving the data back to the server OK it will likely not completely update it until LMSFinish() is called; this must be called only when the user has completely finished with their session on the course and you know no more tracking calls will be made. Adapt calls this when the browser window is closed.

Picture of Ben Simons
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Ben Simons - Wednesday, 18 November 2015, 8:54 AM
 

Hi Matt, 

I don't know if this got sorted, but I am experiencing the same issues. Originally I was getting an API adapter message pop-up, but I have got rid of that using your hacked code, however it is not sending data to the LMS at all. I saw that Alvaro had a course without an assessment and that it was communicating with the LMS so I changed my settings in config but that still didn't work. Any ideas?

 

Also When I go back into the course it doesn't work, it throws up a processADLNavRequest error, any idea what this is?



Picture of Matt Leathes
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Matt Leathes - Wednesday, 18 November 2015, 10:02 AM
 

Hi Ben

That processADLNavRequest error is being generated by the LMS and not Adapt. The page it originates from (/TravisPerkins/LMS/student/APIAdapter.htm) does not exist in Adapt.

It also looks like the course has connected to the SCORM 2004 API Adapter, is that what you want it to do? I seem to recall from an earlier post you wanted to force it to use SCORM 1.2. In fact, the errors showing in your SCORM Log seem to be identical to the ones you were getting here.

When you say 'Originally I was getting an API adapter message pop-up' and that you got rid of it using hacked code... what was the error and what was the hack? The one to force your course to be SCORM 1.2 or the one in this post I shared with Alvaro?

Picture of Ben Simons
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Ben Simons - Wednesday, 18 November 2015, 11:01 AM
 

Hi Matt,

I stopped being an idiot, and re read your last comment on my last post, all it needed was the advancedsettings to be moved up and into the spoor brackets as it was currently sitting outside of them. Very silly move by me but it is all sorted now. 

 

Many thanks

Picture of Matt Leathes
Re: ScormWrapper::getStatus: invalid lesson status '' received from LMS
by Matt Leathes - Wednesday, 18 November 2015, 12:22 PM
 

No problem at all, we all have moments like that! Nothing like computers for making you aware of how dumb you can be sometimes, eh?