From 37ca1722cdfd4d835eab32f0e1977fd943b40e90 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Tue, 8 May 2012 08:59:54 +1200 Subject: [PATCH] MDL-32507 SCORM fix some strict standard errors --- mod/scorm/datamodels/scormlib.php | 2 ++ mod/scorm/locallib.php | 3 ++- mod/scorm/player.php | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mod/scorm/datamodels/scormlib.php b/mod/scorm/datamodels/scormlib.php index d3a1ab96859..10c4555ea97 100644 --- a/mod/scorm/datamodels/scormlib.php +++ b/mod/scorm/datamodels/scormlib.php @@ -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'])) { diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 3a35b2f4a37..7065221841a 100644 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -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; diff --git a/mod/scorm/player.php b/mod/scorm/player.php index 53051dbc6c8..570543d06c9 100644 --- a/mod/scorm/player.php +++ b/mod/scorm/player.php @@ -164,6 +164,7 @@ if ($mode == 'browse') { } $orgstr = '¤torg='.$currentorg; +$SESSION->scorm = new stdClass(); $SESSION->scorm->scoid = $sco->id; $SESSION->scorm->scormstatus = 'Not Initialized'; $SESSION->scorm->scormmode = $mode;