Issue Details (XML | Word | Printable)

Key: MDL-8725
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Piers Harding
Reporter: asdf
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

when setting cmi.objectives.0.id in a sco, there are javascript errors that prevent the sco from finding the lms

Created: 02/Mar/07 11:08 PM   Updated: 12/Aug/08 06:30 AM
Return to search
Component/s: SCORM
Affects Version/s: 1.7, 1.7.1
Fix Version/s: 1.7.2

Environment: scorm 2004

Database: MySQL
Participants: asdf, Dan Marsden and Piers Harding
Security Level: None
Resolved date: 14/Mar/07
Affected Branches: MOODLE_17_STABLE
Fixed Branches: MOODLE_17_STABLE


 Description  « Hide
the error is located in moodle\mod\scorm\datamodels\scorm_13.js.php, somewhere around theese lines
<?php
    $count = 0;
    $objectives = '';
    foreach($userdata as $element => $value){
        if (substr($element,0,14) == 'cmi.objectives') {
            preg_match('/.(\d+)./',$element,$matches);


the output javascript that produces the error:
    cmi.objectives..N0 = new Object();
    cmi.objectives..N0.score = new Object();
    cmi.objectives..N0.score._children = score_children;
the api is than broken, and the sco's cannto talk with the lms anymore.

the bug is triggered when the sco sets "cmi.objectives.0.id". the next time you will enter the course, the javascript code will generate an error, and prevent the api from initializing

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Dan Marsden added a comment - 11/Aug/08 05:15 PM
Hi Piers,

can you please check this? - the commit messages suggest this may only be partially fixed in HEAD - more stable files had patches committed than the files in HEAD - haven't had a good look though - you may just be able to close this bug.

thanks!

Dan


Piers Harding added a comment - 12/Aug/08 06:30 AM
Checked this across HEAD, 1.9, and 1.8 - all looks consistent with respect to handling of the array elements.