MDL-32507 SCORM fix some strict standard errors
authorDan Marsden <dan@danmarsden.com>
Mon, 7 May 2012 20:59:54 +0000 (08:59 +1200)
committerDan Marsden <dan@danmarsden.com>
Mon, 7 May 2012 21:00:46 +0000 (09:00 +1200)
mod/scorm/datamodels/scormlib.php
mod/scorm/locallib.php
mod/scorm/player.php

index d3a1ab9..10c4555 100644 (file)
@@ -90,6 +90,7 @@ function scorm_get_manifest($blocks, $scoes) {
                 case 'ORGANIZATION':
                     $identifier = $block['attrs']['IDENTIFIER'];
                     $organization = '';
+                    $scoes->elements[$manifest][$organization][$identifier] = new stdClass();
                     $scoes->elements[$manifest][$organization][$identifier]->identifier = $identifier;
                     $scoes->elements[$manifest][$organization][$identifier]->parent = '/';
                     $scoes->elements[$manifest][$organization][$identifier]->launch = '';
@@ -113,6 +114,7 @@ function scorm_get_manifest($blocks, $scoes) {
                     array_push($parents, $parent);
 
                     $identifier = $block['attrs']['IDENTIFIER'];
+                    $scoes->elements[$manifest][$organization][$identifier] = new stdClass();
                     $scoes->elements[$manifest][$organization][$identifier]->identifier = $identifier;
                     $scoes->elements[$manifest][$organization][$identifier]->parent = $parent->identifier;
                     if (!isset($block['attrs']['ISVISIBLE'])) {
index 3a35b2f..7065221 100644 (file)
@@ -410,6 +410,7 @@ function scorm_insert_track($userid, $scormid, $scoid, $attempt, $element, $valu
             $id = $track->id;
         }
     } else {
+        $track = new stdClass();
         $track->userid = $userid;
         $track->scormid = $scormid;
         $track->scoid = $scoid;
@@ -534,7 +535,7 @@ function scorm_get_user_data($userid) {
 
 function scorm_grade_user_attempt($scorm, $userid, $attempt=1) {
     global $DB;
-    $attemptscore = null;
+    $attemptscore = new stdClass();
     $attemptscore->scoes = 0;
     $attemptscore->values = 0;
     $attemptscore->max = 0;
index 53051db..570543d 100644 (file)
@@ -164,6 +164,7 @@ if ($mode == 'browse') {
 }
 $orgstr = '&currentorg='.$currentorg;
 
+$SESSION->scorm = new stdClass();
 $SESSION->scorm->scoid = $sco->id;
 $SESSION->scorm->scormstatus = 'Not Initialized';
 $SESSION->scorm->scormmode = $mode;