coding style improvements
authorPetr Skoda <skodak@moodle.org>
Sat, 18 Sep 2010 13:50:12 +0000 (13:50 +0000)
committerPetr Skoda <skodak@moodle.org>
Sat, 18 Sep 2010 13:50:12 +0000 (13:50 +0000)
mod/scorm/datamodels/aicclib.php
mod/scorm/locallib.php

index f57ca61..5650ca0 100644 (file)
@@ -59,6 +59,7 @@ function scorm_add_time($a, $b) {
 */
 function scorm_get_aicc_columns($row,$mastername='system_id') {
     $tok = strtok(strtolower($row),"\",\n\r");
+    $result = new object();
     $result->columns = array();
     $i=0;
     while ($tok) {
@@ -274,7 +275,7 @@ function scorm_parse_aicc($scorm) {
                             $id = $DB->insert_record('scorm_scoes',$sco);
                         }
                         if (!empty($id)) {
-                            unset($scodata);
+                            $scodata = new object();
                             $scodata->scoid = $id;
                             if (isset($element->web_launch)) {
                                 $scodata->name = 'parameters';
index 8c79447..f60d793 100755 (executable)
@@ -422,6 +422,7 @@ function scorm_get_tracks($scoid,$userid,$attempt='') {
         }
     }
     if ($tracks = $DB->get_records('scorm_scoes_track', array('userid'=>$userid, 'scoid'=>$scoid, 'attempt'=>$attempt),'element ASC')) {
+        $usertrack = new object();
         $usertrack->userid = $userid;
         $usertrack->scoid = $scoid;
         // Defined in order to unify scorm1.2 and scorm2004