Details
Description
My company develops SCORM packages for corporate clients. For one particular client we have used the "prerequisites" functionality of SCORM. The SCORM file consists of a couple of lessons and each lesson has the previous lesson as a prerequisite.
In Moodle 1.6.x this worked perfectly. In the navigation menu only available lessons would be clickable (see attachment). In the current version of Moodle this does not work anymore: all lessons are always clickable. I think that this is not the expected behaviour...
Please email me privately if you need an example SCORM package for testing. I cannot post it in a public forum (the clients owns it...)
I really hope this can be resolved as soon as possible!
Kind regards,
Hans de Zwart
Attachments
-
- MDL-11188-moodle19.patch
- 08/Aug/08 5:50 AM
- 30 kB
- Piers Harding
-
$i18n.getText("admin.common.words.hide")
- prereqfix.zip
- 03/Mar/08 10:53 PM
- 10 kB
- Zoltán Szarvas
-
- patch/prereqfix.patch 3 kB
- patchedfiles/scormlib.php 44 kB
- patchedfiles/scorm_12lib.php 18 kB
-
$i18n.getText("admin.common.words.hide")
- prereqmoodletestv0100.zip
- 04/Aug/08 9:30 PM
- 12 kB
- Arjen Vrielink
-
- adlcp_rootv1p2.xsd 4 kB
- imscp_rootv1p1p2.xsd 15 kB
- imsmanifest.xml 2 kB
- imsmd_rootv1p2p1.xsd 22 kB
- ims_xml.xsd 1 kB
- v20080804/APIWrapper.js 14 kB
- v20080804/sco1.html 0.5 kB
- v20080804/sco2.html 0.5 kB
- v20080804/sco3.html 0.5 kB
$i18n.getText("admin.common.words.show")- prereqmoodletestv0100.zip
- 04/Aug/08 9:30 PM
- 12 kB
- Arjen Vrielink
-
- scorm_prerequisites.png
- 30 kB
- 10/Sep/07 6:22 PM
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions
I tested your changes and it seems that works fine only for items in an unique organization :
If item prerequisites for another item is in the same organization it is not accessible while the first item isn't completed
but if the item prerequisites is in another organization, nothing appears on the tree...
I hope i was comprehensible, my english is far from being perfect..
Thanks for this first patch!
Sorry my comment is not really exact !!!
In fact, it's not exactly when item prerequisites is in another organisation that it's without effect, it's when the package uses item as organisation (with items under it in the tree view).....
Hello Antoine,
I am not sure that I understand you..... ![]()
What I would like to have is the same functionality that used to be in version 1.6.
Can you confirm that your SCORM package works the same in 1.6 as in 1.8? Or are there still differences?
Kind regards,
Hans de Zwart
Hello Hans
First, sorry for my fuzzy explanations...I will try to be clearer ;o)
I confirm, with the patch integration, the prerequisites management by the Scorm player works fine in these case :
- Multiple organizations with items required an item completed in the same or in another organization
- Single organization
But in this case prerequisites are not working :
- Single organization but with overlapping items (one item contain multiple items)
It isn't very important, i just remake all my Scorm packages...
Thanks for your help
Cordially,
A.F
- Multiple organizations with items required an item completed in the same or in another organization
- Single organization
- Single organization but with overlapping items (one item contain multiple items)
So you mean that things like & and | do not work?
This is known problem which, it seems, has never worked...
Thanks for getting back!
Aïe !!
In fact, pre-requisite block items without problem but ...
when the required item is completed others items are always blocked....
Have you the same problem?
Hi, I just started using SCORM packages for Moodle a few days ago and I went in with the reload editor to add prerequisite tags to all of the SCOs to prevent accessing the next SCO until you had viewed the previous. I'm using Moodle 1.8.x and writing the SCORM as 1.2 compliant, everything else about the SCORM works fine but it just refuses to recognize the prerequisites, I double checked the XML in the manifest and it looks fine, does this pertain to this bug or is there something that I'm missing? All of my items are under a single organization if that clarifies the structure of what i'm talking about.
Hello Eric,
Yes it seems that that is the problem... Have you tried the above mentioned patch?
Hi Hans, Yeah, I just tried the patch, the results essentially were that any SCORM that i was testing without prerequisites(1.2 or 2004) was perfectly fine and was unaffected, but 1.2 SCORM with prereqs ended up breaking (the SCOs didn't show up anymore) and the 2004 SCORM with sequencing just ended up the same (sequencing not working) so I guess maybe I'll just have to give up on it for now but thanks for the help though.
Hi, I checked the patch, it works fine, thanks. One thing: if the aicc_script contains quotation marks (for example sco="completed"), it will not work, because the returned string contain the escape slashes (added by addslashes()). After I have added the stripslashes() call, it worked:
- if (empty($optionaldatas->prerequisites) || scorm_eval_prerequisites($optionaldatas->prerequisites,$usertracks)) {
+ if (empty($optionaldatas->prerequisites) || scorm_eval_prerequisites(stripslashes($optionaldatas->prerequisites),$usertracks)) {
Kind regards,
Szazo
- if (empty($optionaldatas->prerequisites) || scorm_eval_prerequisites($optionaldatas->prerequisites,$usertracks)) { + if (empty($optionaldatas->prerequisites) || scorm_eval_prerequisites(stripslashes($optionaldatas->prerequisites),$usertracks)) {
Hi,
I continued debugging, I guess I found why the complex prerequisites (containing | or &) doesn't work. In the scorm_eval_prerequisites() function there are some statements like this:
if (!isset($usertracks[$item])) {
return false;
}
The $usertracks contain data only about scoes that have been visited. If one of the sco of the formula never been seen, the above statement will be true, and the whole prerequisites function returns false.
For example, the following formula always returns false (false means the sco is locked) if one of the scoes never been seen, even if one of the scoes is "complete":
(sco1="complete" | sco2="complete")
In the following patch a parallel $usertracks array is created with name $prerequsertracks. It contains all of the data of $usertracks and also contains an object with status 'notattempted'. So the scorm_eval_prerequisites() will continue running, even if there are scoes in formula that have never been seen.
It seems to work (but perhaps not the most nice solution), please check it.
(I also found that '&' signs are not imported correctly if they are in CDATA section, I submitted this bug about this: http://tracker.moodle.org/browse/MDL-12342)
The patch includes Hans's patch (thanks Hans):
— scorm_12lib_old.php Fri Nov 16 11:08:16 2007
+++ scorm_12lib.php Sun Nov 25 23:59:40 2007
@@ -193,6 +193,7 @@ function scorm_get_toc($user,$scorm,$lis
// Retrieve user tracking data for each learning object
//
$usertracks = array();
+ $prerequsertracks = array();
foreach ($scoes as $sco) {
if (!empty($sco->launch)) {
if ($usertrack=scorm_get_tracks($sco->id,$user->id,$attempt)) {
@@ -200,6 +201,11 @@ function scorm_get_toc($user,$scorm,$lis
$usertrack->status = 'notattempted';
}
$usertracks[$sco->identifier] = $usertrack;
+ $prerequsertracks[$sco->identifier] = $usertrack;
+ } else {
+ // set default 'notattempted' status for scoes have never been seen.
+ $usertrack->status = 'notattempted';
+ $prerequsertracks[$sco->identifier] = $usertrack;
}
}
}
@@ -254,8 +260,8 @@ function scorm_get_toc($user,$scorm,$lis
}
$nextsco = next($scoes);
$nextisvisible = false;
- if (($nextsco !== false) && ($optionaldatas = scorm_get_sco($nextsco->id, SCO_DATA))) {
- if (!isset($optionaldatas->isvisible) || (isset($optionaldatas->isvisible) && ($optionaldatas->isvisible == 'true'))) {
+ if (($nextsco !== false) && ($nextoptionaldatas = scorm_get_sco($nextsco->id, SCO_DATA)))Unknown macro: {+ if (!isset($nextoptionaldatas->isvisible) || (isset($nextoptionaldatas->isvisible) && ($nextoptionaldatas->isvisible == 'true'))) { $nextisvisible = true; } }
@@ -328,7 +334,7 @@ function scorm_get_toc($user,$scorm,$lis
$previd = $sco->id;
}
} - if (empty($sco->prerequisites) || scorm_eval_prerequisites($sco->prerequisites,$usertracks)) {
+ if (empty($optionaldatas->prerequisites) || scorm_eval_prerequisites(stripslashes($optionaldatas->prerequisites),$prerequsertracks)) {
if ($sco->id == $scoid) { $result->prerequisites = true; }
- if (($nextsco !== false) && ($optionaldatas = scorm_get_sco($nextsco->id, SCO_DATA))) {
- if (!isset($optionaldatas->isvisible) || (isset($optionaldatas->isvisible) && ($optionaldatas->isvisible == 'true'))) {
+ if (($nextsco !== false) && ($nextoptionaldatas = scorm_get_sco($nextsco->id, SCO_DATA))) Unknown macro: {+ if (!isset($nextoptionaldatas->isvisible) || (isset($nextoptionaldatas->isvisible) && ($nextoptionaldatas->isvisible == 'true'))) { $nextisvisible = true; } }@@ -328,7 +334,7 @@ function scorm_get_toc($user,$scorm,$lis $previd = $sco->id; } }
- if (empty($sco->prerequisites) || scorm_eval_prerequisites($sco->prerequisites,$usertracks)) { + if (empty($optionaldatas->prerequisites) || scorm_eval_prerequisites(stripslashes($optionaldatas->prerequisites),$prerequsertracks)) { if ($sco->id == $scoid) { $result->prerequisites = true; }
I need to try this for my setup, but no time to mess with code. Does anyone have a complete and updated version of the above code that has been corrected in the scorm_12lib.php module. Basically just need the updated / corrected version of scorm_12lib.php
Please attach here wit the Attach File option in the top left of this page.
Thanks
Joe C.
Dear Joseph!
I have attached my version of the patch and patched files. It also includes the bugfix for http://tracker.moodle.org/browse/MDL-12342 BUG (scormlib.php)
Note that Moodle 1.8.3+ version required to use this bug fix.
The patch can be found in .zip under the bugfix\patch directory with name prereqfix.patch. Applying this patch:
1. Copy this file into the moodle/mod/scorm/datamodels directory of the installed Moodle..
2. Go to the moodle/mod/scorm/datamodels directory.
3. Apply the patch using the following command: patch -i prereqfix.patch
Instead of patching, you can copy the already patched files. These files can be found in .zip, under the bugfix\patchedfiles directory. Just copy these files into the moodle/mod/scorm/datamodels directory of the installed Moodle (please create backup, before overwriting files).
Regards
Szazo
we really need a test scorm object that contains pre-requisites that we can use to reproduce this bug, can someone please either upload an object to this tracker item, or e-mail myself or Piers with a scorm object to use for testing?
thanks,
![]()
Dan
Hey Dan,
Thanks for going through all these SCORM bugs! I am still watching them all (good that the missing database field will be picked up). I am on a holiday but have asked one of my co-worker to find one of the SCORM objects that used this functionality and post it to you.
Thanks again,
Hans
Basic SCORM for testing functionality described in this bug-report
Dan: fyi, I'm a colleague of Hans and I uploaded a SCORM object containing pre-requisites so you can reproduce the bug. I think it works pretty straight-forward; if you upload the scorm you shouldn't be able to do Item 2 and Item 3. Item 2 should become available only after completing item 1, item 3 after item 2.
Hope this helps
Thanks Arjen!
We really need more objects to be added to the Scorm Repository here:
http://moodle.org/mod/data/view.php?d=50
would be great if you could add this object or others if you are happy with them being publicly available!
Piers - can you please have a look at this one?
thanks!
![]()
Dan
Hi Arjen - thanks for attaching the test SCORM - I have taken this and created a couple of other prerequisite tests based on it (2*{...} and && and || etc), are you OK with me uploading these and your SCORM object attached to this issue, in the database here: http://moodle.org/mod/data/view.php?d=50 ?
Cheers,
Piers Harding.
Please feel free to add it to the repository. I just uploaded it myself but I'm not sure whether you need more descriptive data.
Hans -
Patch file MDL-11188-moodle19.patch contains the complete set of changes required for the rewrite of prerequisite handling for STABLE19. Because the file upload handling is currently being redeveloped in HEAD (and currently doesnt work), I have not been able to test this there, although I have done a good amount of testing in STABLE19.
It would be very helpfull if you could test this independently for me, before I proceed with committing to STABLE19 and STABLE18.
Thanks.
Piers Harding.
Hello Piers,
I only now see your request to me (back from holidays). Is testing still relevant? Or can I just try it whenever next one of our clients uses the functionality?
Thank you very much for your efforts!
Kind regards,
Hans
Hi Hans - this should have made it into the weekly downloadable update for Moodle, so if you upgrade to that then it should be possible to test it.
Cheers,
Piers Harding.
One of our programmers (Frank Kootte), has looked at the problem, and to me it seems like he solved it. There seems to be a problem in /mod/scorm/datamodels/scorm_12lib.php.
Based on his changes I have created the following (I cannot upload) an attachment! patch. I would appreciate it if somebody could check the patch, commit it to CVS and then close the bug.
Thanks!
— scorm_12lib.php 2007-06-21 04:29:31.000000000 +0200
+++ scorm_12lib_new.php 2007-09-17 15:37:14.000000000 +0200
@@ -252,8 +252,8 @@
}
$nextsco = next($scoes);
$nextisvisible = false;
+ if (($nextsco !== false) && ($nextoptionaldatas = scorm_get_sco($nextsco->id, SCO_DATA)))
@@ -325,7 +325,7 @@
$previd = $sco->id;
}
}
+ if (empty($optionaldatas->prerequisites) || scorm_eval_prerequisites($optionaldatas->prerequisites,$usertracks)) {
if ($sco->id == $scoid) { $result->prerequisites = true; }