lesson status

lesson status

by Stéphan Stephan -
Number of replies: 25

Hi,

i don't agree with the following behavior of recent scorm module :

when a user loads a page,  the page sets its status to incomplete and when he quits, the page (on unload) sends a Finish command. There the scorm module sets the lesson status to "completed", why ? The status should stay "incomplete".

I've commented the lines 486 and 452 (cmi.core.lesson_status = completed ;) of moodle/mod/scorm/datamodels/scorm1_2.js.php and moodle/mod/scorm/datamodels/scorm1_3.js.php respectively to get the correct behavior.

Regards,

Stéphan

Average of ratings: -
In reply to Stéphan Stephan

Re: lesson status

by Roberto Pinna -
Picture of Core developers Picture of Plugin developers
This is what I understanded from the specification (page 3-25).
Please tell me if I missed.

Bobo.





Attachment scorm1.2spec.gif
In reply to Roberto Pinna

Re: lesson status

by Stéphan Stephan -

You are right, if the lesson status is not set by the page (that is what i understand when the recommendations says "there is no problem").

Here is an example :

my page has the following events:

1) onload : set status "incomplete"

2) onunload : send LMSFinish() (doesn't touch to the status)

3) also in the page, there is a button that the user must click to set the status "completed" (so that the user can say "i have understood this lesson").

However, under the scorm module, when the user leaves the page without clicking on the button, the status is set to "completed" : it should stay "incomplete" since the page has set (onload) the status "incomplete".

In reply to Stéphan Stephan

Re: lesson status

by Stéphan Stephan -

Finally, it looks like a bug :

the very first time i load the page (as the one described above), and then i quit, the lesson has status "completed".

The second time i load the page, and then i quit, it has status "incomplete".

Regards,

Stéphan

In reply to Stéphan Stephan

Re: lesson status

by brent simpson -
Stephan:
We're having similar problems with the packages we're trying to generate with eXe; a little different. eXe packages seem to only register with the LMS every other page/SCO you navigate to (we currently treat every page/node as a SCO - but will implement some choice in this aspect of authoring later).

We are currently using the Javascript from one of the ADL examples; the ADL samples seem a little "overcomplicated" to me, but I'm a lousy javascript programmer and have yet to tackle a rewrite just for eXe/Moodle. It seems like it might be a good project for the Moodle community though - to collaborate on a Javascript library for simplifying the SCORM functionality for content authors.

There is an example of our SCORM 1.2 packages running in Moodle and a way to download this package here: http://newped2.auckland.ac.nz/moodle/course/view.php?id=12

brent

eXe developer
open source authoring



In reply to brent simpson

Re: lesson status

by Stéphan Stephan -

I'm sorry i don't have time enough to help, but have a look at the second example below ; it is very basic javascript i wrote (i'm just a teacher) that implements scorm's "lesson_status", "session_time", and "mastery_score" only. It has no copyright at all.

Also, as i said above if i comment some lines in the moodle scorm module, everything works fine on my moodle (http://mathosphere.net) and in reload player.

Regards,

Stéphan

In reply to brent simpson

Re: lesson status

by brent simpson -
We managed to fix the above problem with eXe SCORM content by changing the body to this:

<body onload="loadPage()" onunload="unloadPage()" onbeforeunload="unloadPage()">

minus the Xs that moodle puts in ...

We're using the ADL APIWrapper.js and SCOfunctions.js. Now we're getting a "completed" tick on each visit. There still seems to be a bug though in the very last SCO; it looks like the javascript function for "previous" on the last sco is not being set correctly and it tries to play itself again and again.

brent.
open source authoring!



In reply to Stéphan Stephan

Re: lesson status

by Eduardo Hernandez -

Stéphan,

maybe, peharps it's a bug, but but....have you run your SCO under ADL Selft-Test Suite?, or RELOAD SCORM Player?, These tools are a good help when trying to debug or see how SCOs behave. If the LMS is setting the lesson as "incomplete" or "complete", it is because the content is sending information to do so.

And could you please share the code of your SCO to take a look?. There are several sample codes out there that when calling LMSFinish, they wrap the call with a different function name and they also call the server to set the status, or score, etc. If I'm not wrong the Macromedia Dreamweaver extension works like this.

Cheers,
Eduardo

In reply to Stéphan Stephan

Re: lesson status

by Roberto Pinna -
Picture of Core developers Picture of Plugin developers
Ok,
bug found.

On Monday afternoon, when I was side by side with Martin big grin, I re-read the documentation and I've seen the light, so I've patched the problem.

Many many thanks for your help.

Cheers,
Bobo.

PS: I've just updated the CVS both for 1.5 and develop
In reply to Roberto Pinna

Re: lesson status

by Stéphan Stephan -

On the CVS, which files have been modified ? I don't see any change for 6 days (am i looking at the correct place : cvs on sourceforge ?).

Thanks YOU,

Stéphan

In reply to Roberto Pinna

Re: lesson status

by WenChen Hol -
about the last sco's previous button won't go back. I saw the logic error in the lib.php ( near the bottom ) function scorm_display_structure(.....)
 ************** original line **************
if (($nextid == 0) && (scorm_count_launchable($scorm->id,$currentorg) >1))
 { $previd = $sco->id; }
 ****************************************************************
add '&& ( $nextsco!==false)' to the if condition should solve the problem *****************************************************************
if (($nextid == 0) && (scorm_count_launchable($scorm->id,$currentorg) > 1) && ( $nextsco!==false)) {
$previd = $sco->id;
}
In reply to Roberto Pinna

Re: lesson status

by Hurko Mendiguren -
Hello Roberto,

I just checked the bug that you are telling in the message, but inside of the CVS i can't find any file uploaded or upgraded... can you explain which files we need, i just download scorm1_2.js.php and scorm1_3.js.php but it seem the same file that come out with moodle 1.5.

Cheers,

Urko.
In reply to Hurko Mendiguren

Re: lesson status

by Roberto Pinna -
Picture of Core developers Picture of Plugin developers
Sorry,
in this days I can't update CVS and the last update I have done seems lost.
I will try to resolve this problem today if I can and update the CVS.
Attached you can find the corrected version of scorm1_2.js.php file.

Bobo.
In reply to Roberto Pinna

Re: lesson status

by Roberto Pinna -
Picture of Core developers Picture of Plugin developers
Now CVS it's ok both HEAD and MOODLE15_STABLE.

Sorry for the big delay for the patch, but I had some troubles in the last two weeks.

Cheers,
Bobo.
In reply to Roberto Pinna

Re: lesson status

by Stéphan Stephan -

Well, i'm sorry but i still don't find recent change on cvs...

Regards,

Stéphan

In reply to Stéphan Stephan

Re: lesson status

by Roberto Pinna -
Picture of Core developers Picture of Plugin developers
I've checked now the MOODLE_15_STABLE CVS branch and it's updated.

Have you tried to rename your modified scorm1_2.js.php file?
I've lost much time, in past, when I'd a modified version of a file and the CVS doesn't update it just because mine was much updated.

Cheers,
Bobo.
In reply to Roberto Pinna

Re: lesson status

by Stéphan Stephan -

Found ! Thank you.

Well, it's an other problem, but now all my courses are in popup windows, and scorm (advanced) parameters don't change anything !

Regards,

Stéphan

In reply to Stéphan Stephan

Re: lesson status

by Chardelle Busch -
Picture of Core developers
Well great,

Now you've screwed up a good thing. I had everything working fine before this last upgrade to SCORM. I created a scorm with several scos, and after clicking continue I would get the green tick for each sco. Now, I get the "incomplete" orange tick after each sco and never get the completed tick.

I do not understand the logic of this fix, when does a sco get completed if not on unload? Stephan, you mention a "complete" type of button that must be clicked, I thought that was what the Continue and Exit buttons were for, and if a user exited without hitting a button (for example by just closing the browser), then the sco was left unfinished. These lessons do not have a score set, so maybe that is where the problem is, but whatever the reason, would someone tell me how I can change it so that my scorms work again.

If this is the problem, for each sco I have: Xonload="SCOInitialize()" Xonunload="SCOFinish()" Xonbeforeunload="SCOFinish()"

I am using Dreamweaver L5 to create my manifest.

Thanks,
Chardelle
In reply to Stéphan Stephan

Re: lesson status

by Stéphan Stephan -

About the popup bug, i found this :

line 85 of playscorm.php is :

    if ($scorm->popup = 1) {

and it should be :

    if ($scorm->popup == 1) {

Regards,
Stéphan

In reply to Stéphan Stephan

Re: lesson status

by Roberto Pinna -
Picture of Core developers Picture of Plugin developers
Hi Stéphan,
thanks I've just patch the CVS HEAD version.
Please, be carefull, you are using moodle 1.6 dev.
I still working on it and it may be full of bugs because it's in development.

Don't use this version on a production system!

If you found some bugs please use the bugs report system at:
http://moodle.org/bugs/

Many peaple in this forum use, only, the stable release. If you report a bug about the develop release, here, you may confuse them.

Please continue to debug my code.

Cheers,
Bobo.
In reply to Roberto Pinna

Re: lesson status

by Stéphan Stephan -

Ok, thank you for the clarification, i need it.

I thought CVS was just there to patch known bugs one the current version (1.5).

Regards,
Stéphan

In reply to Stéphan Stephan

Re: lesson status

by Roberto Pinna -
Picture of Core developers Picture of Plugin developers
CVS is divided in some branch, so you can refer to a specific branch or at the HEAD.
The HEAD is the developing branch, it's only recommended to developers.

You can learn how Moodle branches work in the CVS documentation page:
http://moodle.org/doc/?file=cvs.html#n4

Cheers,
Bobo.
In reply to Roberto Pinna

Re: lesson status

by Stéphan Stephan -

Thank you again, but on sourceforge, the directories cvs/moodle/moodle_15 and cvs/moodle/moodle_cvs are empty, the files i've downloaded come from cvs/moodle/moodle (the HEAD ?) : can you give us a link where we have to download patched files for last stable release ?

Thanks,
Stéphan