MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trail...
authorPetr Skoda <skodak@moodle.org>
Sun, 1 Nov 2009 15:24:58 +0000 (15:24 +0000)
committerPetr Skoda <skodak@moodle.org>
Sun, 1 Nov 2009 15:24:58 +0000 (15:24 +0000)
37 files changed:
mod/scorm/aicc.php
mod/scorm/backuplib.php
mod/scorm/datamodel.php
mod/scorm/datamodels/aicclib.php
mod/scorm/datamodels/scorm_12.js.php
mod/scorm/datamodels/scorm_12lib.php
mod/scorm/datamodels/scorm_13lib.php
mod/scorm/datamodels/scormlib.php
mod/scorm/datamodels/sequencinglib.php
mod/scorm/db/access.php
mod/scorm/db/install.php
mod/scorm/db/upgrade.php
mod/scorm/index.php
mod/scorm/lib.php
mod/scorm/locallib.php
mod/scorm/mod_form.php
mod/scorm/rd.js
mod/scorm/report.php
mod/scorm/restorelib.php
mod/scorm/settings.php
mod/scorm/styles.php
mod/scorm/version.php
mod/scorm/view.php
mod/survey/backuplib.php
mod/survey/db/access.php
mod/survey/db/install.php
mod/survey/db/upgrade.php
mod/survey/graph.php
mod/survey/index.php
mod/survey/lib.php
mod/survey/mod_form.php
mod/survey/report.php
mod/survey/restorelib.php
mod/survey/save.php
mod/survey/version.php
mod/survey/view.php
mod/url/mod_form.php

index e7d91b9..e042868 100755 (executable)
@@ -14,7 +14,7 @@
                        $tempkey = strtolower($key);
                        $_POST[$tempkey] = $value;
        }
-    
+
     $command = required_param('command', PARAM_ALPHA);
     $sessionid = required_param('session_id', PARAM_ALPHANUM);
     $aiccdata = optional_param('aicc_data', '', PARAM_RAW);
 
                                                  $value = '';
                                                  if (is_numeric($values[0])) {
-                                                     $value = trim($values[0]); 
+                                                     $value = trim($values[0]);
                                                      $id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $element, $value);
                                                  }
                                                  $score = $value;
             echo "error=3\r\nerror_text=Invalid Session ID\r\n";
         }
     }
-?>
\ No newline at end of file
index 50921ec..7267a29 100755 (executable)
@@ -1,10 +1,10 @@
-<?php //$Id$
+<?php
     //This php script contains all the stuff to backup/restore
     //scorm mods
 
     //This is the "graphical" structure of the scorm mod:
     //
-    //                      scorm                                      
+    //                      scorm
     //                   (CL,pk->id)-------------------------------------
     //                        |                                         |
     //                        |                                         |
@@ -78,7 +78,7 @@
         fwrite ($bf,full_tag("UPDATEFREQ",4,false,$scorm->updatefreq));
         fwrite ($bf,full_tag('TIMEMODIFIED',4,false,$scorm->timemodified));
         $status = backup_scorm_scoes($bf,$preferences,$scorm->id);
-        
+
         //if we've selected to backup users info, then execute backup_scorm_scoes_track
         if ($status) {
             if (backup_userdata_selected($preferences,'scorm',$scorm->id)) {
         }
         return $status;
     }
-  
+
    //Backup scorm_scoes_data contents (executed from scorm_backup_scorm_scoes)
     function backup_scorm_scoes_data ($bf,$preferences,$sco) {
         global $CFG, $DB;
         }
         return $status;
     }
-   
+
    //Backup scorm_scoes_track contents (executed from scorm_backup_mods)
     function backup_scorm_scoes_track ($bf,$preferences,$scorm) {
         global $CFG, $DB;
             $status =fwrite ($bf,start_tag('SEQ_RULECONDS',4,true));
             //Iterate over each sco
             foreach ($scorm_seq_ruleconditions as $seq_rulecondition) {
-                //Start sco 
+                //Start sco
                 $status =fwrite ($bf,start_tag('SEQ_RULECOND',5,true));
                 //Print track contents
                 fwrite ($bf,full_tag('ID',6,false,$seq_rulecondition->id));
             $status =fwrite ($bf,start_tag('SEQ_RULECOND_DATAS',4,true));
             //Iterate over each sco
             foreach ($scorm_seq_ruleconditions as $seq_rulecondition) {
-                //Start sco 
+                //Start sco
                 $status =fwrite ($bf,start_tag('SEQ_RULECOND_DATA',5,true));
                 //Print track contents
                 fwrite ($bf,full_tag('ID',6,false,$seq_rulecondition->id));
             $status =fwrite ($bf,start_tag('SEQ_ROLLUPRULES',4,true));
             //Iterate over each sco
             foreach ($scorm_seq_rolluprules as $seq_rolluprule) {
-                //Start sco 
+                //Start sco
                 $status =fwrite ($bf,start_tag('SEQ_ROLLUPRULE',5,true));
                 //Print track contents
                 fwrite ($bf,full_tag('ID',6,false,$seq_rolluprule->id));
             $status =fwrite ($bf,start_tag('SEQ_ROLLUPRULECONDS',4,true));
             //Iterate over each sco
             foreach ($scorm_seq_rollupruleconditions as $seq_rolluprulecondition) {
-                //Start sco 
+                //Start sco
                 $status =fwrite ($bf,start_tag('SEQ_ROLLUPRULECOND',5,true));
                 //Print track contents
                 fwrite ($bf,full_tag('ID',6,false,$seq_rolluprulecondition->id));
@@ -330,7 +330,7 @@ function backup_scorm_seq_objective ($bf,$preferences,$sco) {
             $status =fwrite ($bf,start_tag('SEQ_OBJECTIVES',4,true));
             //Iterate over each sco
             foreach ($scorm_seq_objectives as $seq_objective) {
-                //Start sco 
+                //Start sco
                 $status =fwrite ($bf,start_tag('SEQ_OBJECTIVE',5,true));
                 //Print track contents
                 fwrite ($bf,full_tag('ID',6,false,$seq_objective->id));
@@ -362,7 +362,7 @@ function backup_scorm_seq_objective ($bf,$preferences,$sco) {
             $status =fwrite ($bf,start_tag('SEQ_MAPINFO',4,true));
             //Iterate over each sco
             foreach ($scorm_seq_objectives as $seq_objective) {
-                //Start sco 
+                //Start sco
                 $status =fwrite ($bf,start_tag('SEQ_MAPINF',5,true));
                 //Print track contents
                 fwrite ($bf,full_tag('ID',6,false,$seq_objective->id));
@@ -381,7 +381,7 @@ function backup_scorm_seq_objective ($bf,$preferences,$sco) {
         }
         return $status;
     }
-   
+
    ////Return an array of info (name,value)
    function scorm_check_backup_mods($course,$user_data=false,$backup_unique_code,$instances=null) {
        if (!empty($instances) && is_array($instances) && count($instances)) {
@@ -506,7 +506,7 @@ function backup_scorm_seq_objective ($bf,$preferences,$sco) {
                                         FROM {scorm} a
                                        WHERE a.course = ?", array($course));
     }
-   
+
     //Returns an array of scorm_scoes id
     function scorm_scoes_track_ids_by_course ($course) {
         global $CFG, $DB;
@@ -525,4 +525,4 @@ function backup_scorm_seq_objective ($bf,$preferences,$sco) {
                                         FROM {scorm_scoes_track} s
                                        WHERE s.scormid = ?", array($instanceid));
     }
-?>
+
index ab462de..7d55d7b 100755 (executable)
@@ -1,7 +1,7 @@
 <?php
     require_once('../../config.php');
     require_once('locallib.php');
-        
+
     $id = optional_param('id', '', PARAM_INT);       // Course Module ID, or
     $a = optional_param('a', '', PARAM_INT);         // scorm ID
     $scoid = required_param('scoid', PARAM_INT);  // sco ID
@@ -86,4 +86,4 @@
             echo "\n".$request;
         }
     }
-?>
+
index dd45646..bfa56ba 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 function scorm_add_time($a, $b) {
     $aes = explode(':',$a);
@@ -548,4 +548,4 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
     return $result;
 }
 
-?>
+
index 6b7142f..999bbfd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
     require_once($CFG->dirroot.'/mod/scorm/locallib.php');
-    
+
     if (isset($userdata->status)) {
         if ($userdata->status == '') {
             $userdata->entry = 'ab-initio';
@@ -144,11 +144,11 @@ function SCORMapi1_2() {
     scorm_reconstitute_array_element($scorm->version, $userdata, 'cmi.objectives', array('score'));
     scorm_reconstitute_array_element($scorm->version, $userdata, 'cmi.interactions', array('objectives', 'correct_responses'));
     ?>
-    
+
     if (cmi.core.lesson_status == '') {
         cmi.core.lesson_status = 'not attempted';
-    } 
-    
+    }
+
     //
     // API Methods definition
     //
@@ -160,7 +160,7 @@ function SCORMapi1_2() {
             if (!Initialized) {
                 Initialized = true;
                 errorCode = "0";
-                <?php 
+                <?php
                     if (scorm_debugging($scorm)) {
                         //echo 'alert("Initialized SCORM 1.2");';
                         echo 'LogAPICall("LMSInitialize", param, "", errorCode);';
@@ -173,14 +173,14 @@ function SCORMapi1_2() {
         } else {
             errorCode = "201";
         }
-        <?php 
+        <?php
             if (scorm_debugging($scorm)) {
                 echo 'LogAPICall("LMSInitialize", param, "", errorCode);';
             }
         ?>
         return "false";
     }
-    
+
     function LMSFinish (param) {
         errorCode = "0";
         if (param == "") {
@@ -197,8 +197,8 @@ function SCORMapi1_2() {
                     if (<?php echo $scorm->auto ?> == 1) {
                         setTimeout('top.document.location=top.next;',500);
                     }
-                }    
-                <?php 
+                }
+                <?php
                     if (scorm_debugging($scorm)) {
                         //echo 'alert("Finished SCORM 1.2");';
                         echo 'LogAPICall("LMSFinish", param, "", 0);';
@@ -211,14 +211,14 @@ function SCORMapi1_2() {
         } else {
             errorCode = "201";
         }
-        <?php 
+        <?php
             if (scorm_debugging($scorm)) {
                 echo 'LogAPICall("LMSFinish", param, "", errorCode);';
             }
         ?>
         return "false";
     }
-    
+
     function LMSGetValue (element) {
         errorCode = "0";
         if (Initialized) {
@@ -236,7 +236,7 @@ function SCORMapi1_2() {
                         }
                             if (subelement == element) {
                             errorCode = "0";
-                            <?php 
+                            <?php
                                 if (scorm_debugging($scorm)) {
                                    //echo 'alert(element+": "+eval(element));';
                                     echo 'LogAPICall("LMSGetValue", element, eval(element), 0);';
@@ -276,14 +276,14 @@ function SCORMapi1_2() {
         } else {
             errorCode = "301";
         }
-        <?php 
+        <?php
             if (scorm_debugging($scorm)) {
                 echo 'LogAPICall("LMSGetValue", element, "", errorCode);';
             }
         ?>
         return "";
     }
-    
+
     function LMSSetValue (element,value) {
         errorCode = "0";
         if (Initialized) {
@@ -309,7 +309,7 @@ function SCORMapi1_2() {
                                         }
                                         if (elementIndexes[i+1] == eval(subelement+'.'+elementIndex+'._count')) {
                                             eval(subelement+'.'+elementIndex+'._count++;');
-                                        } 
+                                        }
                                         if (elementIndexes[i+1] > eval(subelement+'.'+elementIndex+'._count')) {
                                             errorCode = "201";
                                         }
@@ -346,7 +346,7 @@ function SCORMapi1_2() {
                                     if ((value >= ranges[0]) && (value <= ranges[1])) {
                                         eval(element+'=value;');
                                         errorCode = "0";
-                                        <?php 
+                                        <?php
                                             if (scorm_debugging($scorm)) {
                                                 echo 'LogAPICall("LMSSetValue", element, value, errorCode);';
                                                 //echo 'alert(element+":= "+value);';
@@ -363,7 +363,7 @@ function SCORMapi1_2() {
                                         eval(element+'=value;');
                                     }
                                     errorCode = "0";
-                                    <?php 
+                                    <?php
                                         if (scorm_debugging($scorm)) {
                                             echo 'LogAPICall("LMSSetValue", element, value, errorCode);';
                                             //echo 'alert(element+":= "+value);';
@@ -387,20 +387,20 @@ function SCORMapi1_2() {
         } else {
             errorCode = "301";
         }
-       <?php 
+       <?php
         if (scorm_debugging($scorm)) {
             echo 'LogAPICall("LMSSetValue", element, value, errorCode);';
         }
         ?>
         return "false";
     }
-    
+
     function LMSCommit (param) {
         errorCode = "0";
         if (param == "") {
             if (Initialized) {
                 result = StoreData(cmi,false);
-                <?php 
+                <?php
                     if (scorm_debugging($scorm)) {
                         echo 'LogAPICall("Commit", param, "", 0);';
                         //echo 'alert("Data Commited");';
@@ -413,23 +413,23 @@ function SCORMapi1_2() {
         } else {
             errorCode = "201";
         }
-        <?php 
+        <?php
             if (scorm_debugging($scorm)) {
                 echo 'LogAPICall("LMSCommit", param, "", 0);';
             }
         ?>
         return "false";
     }
-    
+
     function LMSGetLastError () {
-     <?php 
+     <?php
         if (scorm_debugging($scorm)) {
             echo 'LogAPICall("LMSGetLastError", "", "", errorCode);';
         }
     ?>
         return errorCode;
     }
-    
+
     function LMSGetErrorString (param) {
         if (param != "") {
             var errorString = new Array();
@@ -444,14 +444,14 @@ function SCORMapi1_2() {
             errorString["403"] = "Element is read only";
             errorString["404"] = "Element is write only";
             errorString["405"] = "Incorrect data type";
-            <?php 
+            <?php
             if (scorm_debugging($scorm)) {
                 echo 'LogAPICall("LMSGetErrorString", param,  errorString[param], 0);';
             }
              ?>
             return errorString[param];
         } else {
-           <?php 
+           <?php
             if (scorm_debugging($scorm)) {
                 echo 'LogAPICall("LMSGetErrorString", param,  "No error string found!", 0);';
             }
@@ -459,12 +459,12 @@ function SCORMapi1_2() {
            return "";
         }
     }
-    
+
     function LMSGetDiagnostic (param) {
         if (param == "") {
             param = errorCode;
         }
-        <?php 
+        <?php
             if (scorm_debugging($scorm)) {
                 echo 'LogAPICall("LMSGetDiagnostic", param, param, 0);';
             }
@@ -583,7 +583,7 @@ function SCORMapi1_2() {
         }
         datastring += '&attempt=<?php echo $attempt ?>';
         datastring += '&scoid=<?php echo $scoid ?>';
-        
+
         var myRequest = NewHttpReq();
         result = DoRequest(myRequest,"<?php p($CFG->wwwroot) ?>/mod/scorm/datamodel.php","id=<?php p($id) ?>&sesskey=<?php echo sesskey() ?>"+datastring);
         results = String(result).split('\n');
index ae69e2a..2f50dfb 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 /**
 * This is really a little language parser for AICC_SCRIPT
 * evaluates the expression and returns a boolean answer
@@ -332,4 +332,4 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
     return $result;
 }
 
-?>
+
index 33bee3b..329ba5e 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='normal',$attempt='',$play=false) {
     global $CFG, $DB, $PAGE, $OUTPUT;
@@ -223,4 +223,4 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
     return $result;
 }
 
-?>
+
index 93765bd..14b4cec 100644 (file)
@@ -808,4 +808,3 @@ class xml2Array {
    }
 
 }
-?>
\ No newline at end of file
index bba997a..6c87d06 100755 (executable)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 require ('scormlib.php');
 
 function scorm_seq_evaluate($scoid,$usertracks) {
@@ -39,7 +39,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) {
     $seq->nextactivity = null;
     $seq->deliveryvalid = null;
     $seq->attempt = $attempt;
-    
+
     $seq->identifiedactivity = null;
     $seq->delivery = null;
     $seq->deliverable = false;
@@ -61,7 +61,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) {
                 $seq->sequencing = 'start';
             } else {
                 $seq->exception = 'NB.2.1-1'; /// Sequencing session already begun
-            } 
+            }
         break;
         case 'resumeall_':
             if (empty($seq->currentactivity)) {
@@ -73,7 +73,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) {
                 }
             } else {
                 $seq->exception = 'NB.2.1-1'; /// Sequencing session already begun
-            } 
+            }
         break;
         case 'continue_':
         case 'previous_':
@@ -81,7 +81,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) {
                 $sco = $seq->currentactivity;
                 if ($sco->parent != '/') {
                     if ($parentsco = scorm_get_parent($sco)) {
-                        
+
                          if (isset($parentsco->flow) && ($parentsco->flow == true)) {//I think it's parentsco
                             // Current activity is active !
                             if (scorm_seq_is('active',$sco->id,$userid)) {
@@ -132,7 +132,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) {
                 $seq->exception = 'NB.2.1-2'; /// Current activity not defined
             }
         break;
-        default: /// {target=<STRING>}choice 
+        default: /// {target=<STRING>}choice
             if ($targetsco = $DB->get_record('scorm_scoes', array('scorm'=>$sco->scorm,'identifier'=>$request))) {
                 if ($targetsco->parent != '/') {
                     $seq->target = $request;
@@ -141,7 +141,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) {
                         if (!isset($parentsco->choice) || ($parent->choice == true)) {
                             $seq->target = $request;
                         }
-                    } 
+                    }
                 }
                 if ($seq->target != null) {
                     if (empty($seq->currentactivity)) {
@@ -165,7 +165,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) {
                                             $seq->exception = 'NB.2.1-8'; /// Violates control mode
                                             return $seq;
                                         }
-                                    } 
+                                    }
                                 } else {
                                     $seq->navigation = false;
                                     $seq->termination = null;
@@ -235,8 +235,8 @@ function scorm_seq_termination ($seq,$userid) {
             }
             /// Terminate Descendent Attempts Process
 
-            
-            if ($ancestors = scorm_get_ancestors($sco)) { 
+
+            if ($ancestors = scorm_get_ancestors($sco)) {
                 foreach ($ancestors as $ancestor) {
                     scorm_seq_end_attempt($ancestor,$userid,$seq);
                     $seq->currentactivity = $ancestor;
@@ -260,7 +260,7 @@ function scorm_seq_termination ($seq,$userid) {
                     // return $seq;
                 }
             }
-            if ($ancestors = scorm_get_ancestors($sco)) { 
+            if ($ancestors = scorm_get_ancestors($sco)) {
                 foreach ($ancestors as $ancestor) {
                     scorm_seq_set('active',$ancestor->id,$userid,false);
                     scorm_seq_set('suspended',$ancestor->id,$userid);
@@ -279,7 +279,7 @@ function scorm_seq_termination ($seq,$userid) {
             $seq->termination = true;
         break;
         case 'abandonall':
-            if ($ancestors = scorm_get_ancestors($sco)) { 
+            if ($ancestors = scorm_get_ancestors($sco)) {
                 foreach ($ancestors as $ancestor) {
                     scorm_seq_set('active',$ancestor->id,$userid,false);
                     $seq->currentactivity = $ancestor;
@@ -307,7 +307,7 @@ function scorm_seq_end_attempt($sco,$userid,$seq) {
             if (!scorm_seq_is('suspended',$sco->id,$userid)) {
                 if (!isset($sco->completionsetbycontent) || ($sco->completionsetbycontent == 0)) {
                     if (!scorm_seq_is('attemptprogressstatus',$sco->id,$userid,$seq->attempt)) {
-                  // if (!scorm_seq_is('attemptprogressstatus',$sco->id,$userid)) { 
+                  // if (!scorm_seq_is('attemptprogressstatus',$sco->id,$userid)) {
                         scorm_seq_set('attemptprogressstatus',$sco->id,$userid);
                         scorm_seq_set('attemptcompletionstatus',$sco->id,$userid);
                     }
@@ -338,7 +338,7 @@ function scorm_seq_end_attempt($sco,$userid,$seq) {
             }
             if ($suspended) {
                 scorm_seq_set('suspended',$sco,$userid);
-            } else { 
+            } else {
                 scorm_seq_set('suspended',$sco,$userid,false);
             }
         }
@@ -386,12 +386,12 @@ function scorm_seq_exit_action_rules($seq,$userid) {
         }
     }
     if ($exittarget != null) {
-        $commons = array_slice($ancestors,0,scorm_find_common_ancestor($ancestors,$exittarget)); 
+        $commons = array_slice($ancestors,0,scorm_find_common_ancestor($ancestors,$exittarget));
+
         /// Terminate Descendent Attempts Process
-        if ($commons) { 
+        if ($commons) {
             foreach ($commons as $ancestor) {
-                
+
                 scorm_seq_end_attempt($ancestor,$userid,$seq->attempt);
                 $seq->currentactivity = $ancestor;
             }
@@ -452,7 +452,7 @@ function scorm_seq_rule_check ($sco, $rule){
              }
          }
          $bag [$rule->id] = $rulecond->cond;
-    
+
     }
     if (empty($bag)){
         $cond = 'unknown';
@@ -465,7 +465,7 @@ function scorm_seq_rule_check ($sco, $rule){
     if ($rule->conditioncombination = 'all'){
         foreach ($bag as $con){
                 $cond = $cond.' and '.$con;
-            
+
         }
     }
     else{
@@ -479,7 +479,7 @@ function scorm_seq_rule_check ($sco, $rule){
 
 function scorm_seq_overall_rollup($sco,$userid){//Carlos
 
-     if ($ancestors = scorm_get_ancestors($sco)) { 
+     if ($ancestors = scorm_get_ancestors($sco)) {
             foreach ($ancestors as $ancestor) {
                 if(!scorm_is_leaf($ancestor)){
                     scorm_seq_measure_rollup($sco,$userid);
@@ -489,7 +489,7 @@ function scorm_seq_overall_rollup($sco,$userid){//Carlos
 
             }
 
-     } 
+     }
 }
 
 /* For this next function I have defined measure weight and measure status as records with the attempt = 0 on the scorm_scoes_track table. According to the page 89 of the SeqNav.pdf those datas give us some information about the progress of the objective*/
@@ -505,7 +505,7 @@ function scorm_seq_measure_rollup($sco,$userid){
 
     foreach ($objectives as $objective){
 
-        if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not 
+        if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not
             $targetobjective = $objective;
             break;
         }
@@ -517,18 +517,18 @@ function scorm_seq_measure_rollup($sco,$userid){
         foreach ($children as $child){
             $child = scorm_get_sco ($child);
             if (!isset($child->tracked) || ($child->tracked == 1)){
-    
+
                 $rolledupobjective = null;// we set the rolled up activity to undefined
                 $objectives = $DB->get_records('scorm_seq_objective', array('scoid'=>$child->id));
                 foreach ($objectives as $objective){
-                    if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not 
+                    if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not
                         $rolledupobjective = $objective;
                         break;
                     }
                 }
                 if ($rolledupobjective != null){
                     $child = scorm_get_sco($child->id);
-                
+
                     $countedmeasures = $countedmeasures + ($child->measureweight);
                     if (!scorm_seq_is('objectivemeasurestatus',$sco->id,$userid)) {
                         $normalizedmeasure = $DB->get_record('scorm_scoes_track', array('scoid'=>$child->id,'userid'=>$userid,'element'=>'objectivenormalizedmeasure'));
@@ -536,13 +536,13 @@ function scorm_seq_measure_rollup($sco,$userid){
                         $valid = true;
                     }
 
-                    
-                    
+
+
                 }
             }
         }
 
-                         
+
         if(!$valid){
 
             scorm_seq_set('objectivemeasurestatus',$sco->id,$userid,false);
@@ -553,21 +553,21 @@ function scorm_seq_measure_rollup($sco,$userid){
                 scorm_seq_set('objectivemeasurestatus',$sco->id,$userid);
                 $val=$totalmeasure/$countedmeasures;
                 scorm_seq_set('objectivenormalizedmeasure',$sco->id,$userid,$val);
-                
+
             }
             else{
                 scorm_seq_set('objectivemeasurestatus',$sco->id,$userid,false);
-                
+
             }
         }
 
     }
-    
+
 }
 
 function scorm_seq_objective_rollup($sco,$userid){
     global $DB;
-    
+
     scorm_seq_objective_rollup_measure($sco,$userid);
     scorm_seq_objective_rollup_rules($sco,$userid);
     scorm_seq_objective_rollup_default($sco,$userid);
@@ -586,26 +586,26 @@ function scorm_seq_objective_rollup($sco,$userid){
             foreach($rolluprules as $rolluprule){
                 $rollupruleconds = $DB->get_records('scorm_seq_rolluprulecond', array('rollupruleid'=>$rolluprule->id));
                 foreach($rollupruleconds as $rolluprulecond){
-                 
+
                     switch ($rolluprulecond->cond!='satisfied' && $rolluprulecond->cond!='completed' && $rolluprulecond->cond!='attempted'){
-                            
+
                            scorm_seq_set('objectivesatisfiedstatus',$sco->id,$userid, false);
 
                         break;
                     }
                 }
 
-    
+
         }
     }
-*/  
+*/
 }
 
 function scorm_seq_objective_rollup_measure($sco,$userid){
     global $DB;
 
     $targetobjective = null;
-    
+
 
     $objectives = $DB->get_records('scorm_seq_objective', array('scoid'=>$sco->id));
     foreach ($objectives as $objective){
@@ -618,11 +618,11 @@ function scorm_seq_objective_rollup_measure($sco,$userid){
 
         if($targetobjective->satisfiedbymeasure){
 
-            
+
             if (!scorm_seq_is('objectiveprogressstatus',$sco->id,$userid)) {
 
                 scorm_seq_set('objectiveprogressstatus',$sco->id,$userid,false);
-                                
+
             }
 
             else{
@@ -650,7 +650,7 @@ function scorm_seq_objective_rollup_measure($sco,$userid){
                 else{
 
                     scorm_seq_set('objectiveprogressstatus',$sco->id,$userid,false);
-                
+
                 }
             }
         }
@@ -662,24 +662,24 @@ function scorm_seq_objective_rollup_default($sco,$userid){
     global $DB;
 
     if (!(scorm_seq_rollup_rule_check($sco,$userid,'incomplete')) && !(scorm_seq_rollup_rule_check($sco,$userid,'completed'))){
-        
+
             $rolluprules = $DB->get_record('scorm_seq_rolluprule', array('scoid'=>$sco->id,'userid'=>$userid));
             foreach($rolluprules as $rolluprule){
                 $rollupruleconds = $DB->get_records('scorm_seq_rolluprulecond', array('rollupruleid'=>$rolluprule->id));
                 foreach($rollupruleconds as $rolluprulecond){
-                 
+
                     if ($rolluprulecond->cond!='satisfied' && $rolluprulecond->cond!='completed' && $rolluprulecond->cond!='attempted'){
-                            
+
                            scorm_seq_set('objectivesatisfiedstatus',$sco->id,$userid, false);
 
                         break;
                     }
                 }
 
-    
+
             }
     }
-    
+
 }
 
 
@@ -690,18 +690,18 @@ function scorm_seq_objective_rollup_rules($sco,$userid){
 
     $objectives = $DB->get_records('scorm_seq_objective', array('scoid'=>$sco->id));
     foreach ($objectives as $objective){
-        if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not 
+        if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not
             $targetobjective = $objective;
             break;
         }
     }
     if ($targetobjective != null){
 
-        
+
 
         if(scorm_seq_rollup_rule_check($sco,$userid,'notsatisfied')){//with not satisfied rollup for the activity
 
-           
+
             scorm_seq_set('objectiveprogressstatus',$sco->id,$userid);
             scorm_seq_set('objectivesatisfiedstatus',$sco->id,$userid,false);
         }
@@ -764,7 +764,7 @@ function scorm_seq_rollup_rule_check ($sco,$userid,$action){
                         }
                     }
                 }
-                
+
             }
             $change = false;
 
@@ -843,7 +843,7 @@ function scorm_seq_evaluate_rollupcond($sco,$conditioncombination,$rolluprulecon
         $condit = scorm_evaluate_cond($rolluprulecond,$sco,$userid);
 
         if($rule->operator=='not'){// If operator is not, negate the condition
-            if ($rule->cond != 'unknown'){            
+            if ($rule->cond != 'unknown'){
                 if ($condit){
                     $condit = false;
                 }
@@ -879,7 +879,7 @@ function scorm_seq_evaluate_rollupcond($sco,$conditioncombination,$rolluprulecon
              else{
 
                 $val = false;
-                 
+
                 if($b == 'unknown'){
                      $unk = true;
                 }
@@ -900,11 +900,11 @@ function scorm_seq_evaluate_rollupcond($sco,$conditioncombination,$rolluprulecon
 
 function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){
     global $DB;
-    
+
             $res = false;
 
             switch ($rolluprulecond->cond){
-                
+
                 case 'satisfied':
                      if($r=$DB->get_record('scorm_scoes_track', array('scoid'=>$sco->id,'userid'=>$userid,'element'=>'objectivesatisfiedstatus'))) {
                         if($r->value == true){
@@ -930,7 +930,7 @@ function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){
                         if($r->value == true){
                             $res = true;
                         }
-    
+
                     }
 
                 break;
@@ -942,10 +942,10 @@ function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){
                                if($r->value){
                                   $res = true;
                                }
-    
+
                             }
                         }
-    
+
                     }
                 break;
 
@@ -956,13 +956,13 @@ function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){
                                 if($r->value > 0){
                                     $res = true;
                                 }
-    
+
                             }
                         }
-    
+
                     }
                 break;
-                
+
 
                 case 'attemptLimitExceeded':
                     if ($r = $DB->get_record('scorm_scoes_track', array('scoid'=>$sco->id,'userid'=>$userid,'element'=>'activityprogressstatus'))) {
@@ -973,17 +973,17 @@ function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){
                                        if($r->value >= $r2->value){
                                            $res = true;
                                        }
-    
+
                                    }
-                    
+
                                 }
-    
+
                             }
-                    
+
                         }
-    
+
                     }
-                    
+
                 break;
 
                 case 'activityProgressKnown':
@@ -994,13 +994,13 @@ function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){
                                 if($r->value){
                                     $res = true;
                                 }
-    
+
                             }
-                    
+
                         }
-    
+
                     }
-                    
+
                 break;
             }
             return $res;
@@ -1017,7 +1017,7 @@ function scorm_seq_check_child ($sco, $action, $userid){
       if (!$sco->rollupobjectivesatisfied){
         $included = true;
         if (($action == 'satisfied' && $sco->requiredforsatisfied == 'ifnotsuspended') || ($action == 'notsatisfied' && $sco->requiredfornotsatisfied == 'ifnotsuspended')){
-            
+
             if (!scorm_seq_is('activityprogressstatus',$sco->id,$userid) || ((($r->value)>0)&& !scorm_seq_is('suspended',$sco->id,$userid))){
                 $included = false;
             }
@@ -1052,7 +1052,7 @@ function scorm_seq_check_child ($sco, $action, $userid){
 
             }
             else{
-                
+
                 if (($action == 'completed' && $sco->requiredforcompleted == 'ifattempted') || ($action == 'incomplete' && $sco->requiredforincomplete == 'ifattempted')){
                     if (!scorm_seq_is('activityprogressstatus',$sco->id,$userid) || (($r->value)==0)){
                         $included = false;
@@ -1085,45 +1085,45 @@ function scorm_seq_sequencing ($scoid,$userid,$seq) {
         //TODO: undefined $sco!
              $seq = scorm_seq_start_sequencing($sco,$userid,$seq); //We'll see the parameters we have to send, this should update delivery and end
             $seq->sequencing = true;
-           
-            
+
+
             break;
-            
+
         case 'resumeall':
             $seq = scorm_seq_resume_sequencing($sco,$userid,$seq); //We'll see the parameters we have to send, this should update delivery and end
             $seq->sequencing = true;
-            
-            
-          
+
+
+
             break;
 
         case 'exit':
              $seq = scorm_seq_exit_sequencing($sco,$userid,$seq); //We'll see the parameters we have to send, this should update delivery and end
             $seq->sequencing = true;
 
-           
-          
+
+
             break;
 
         case 'retry':
             $seq = scorm_seq_retry_sequencing($sco,$userid,$seq); //We'll see the parameters we have to send, this should update delivery and end
             $seq->sequencing = true;
-            
-          
+
+
             break;
 
         case 'previous':
             $seq = scorm_seq_previous_sequencing($sco,$userid,$seq);// We'll see the parameters we have to send, this should update delivery and end
             $seq->sequencing = true;
 
-         
+
             break;
 
         case 'choice':
             $seq = scorm_seq_choice_sequencing($sco,$userid,$seq);// We'll see the parameters we have to send, this should update delivery and end
-             $seq->sequencing = true; 
-             
-      
+             $seq->sequencing = true;
+
+
             break;
 
     }
@@ -1132,7 +1132,7 @@ function scorm_seq_sequencing ($scoid,$userid,$seq) {
         $seq->sequencing = false;
         return $seq;
     }
-    
+
     $seq->sequencing= true;
     return $seq;
 }
@@ -1178,7 +1178,7 @@ function scorm_seq_resume_all_sequencing($scoid,$userid,$seq){
         return $seq;
     }
     $seq->delivery = $DB->get_record('scorm_scoes', array('scoid'=>$scoid,'userid'=>$userid));//we assign the sco to the delivery
-    
+
 }
 
 function scorm_seq_continue_sequencing($scoid,$userid,$seq){
@@ -1214,7 +1214,7 @@ function scorm_seq_previous_sequencing($scoid,$userid,$seq){
         $seq->exception = 'SB.2.8-1';
         return $seq;
     }
-    
+
     $currentact= $seq->currentactivity;
     if ($currentact->parent != '/') {//if the activity is the root and is leaf
         $parent = scorm_get_parent ($activity); // TODO: undefined!!
@@ -1253,7 +1253,7 @@ function scorm_seq_exit_sequencing($scoid,$userid,$seq){
          $seq->endsession = true;
          return $seq;
      }
-        
+
     $seq->endsession = false;
     return $seq;
 }
@@ -1270,7 +1270,7 @@ function scorm_seq_retry_sequencing($scoid,$userid,$seq){
         $seq->exception = 'SB.2.10-2';
         return $seq;
     }
-    
+
     if (!scorm_is_leaf($seq->currentactivity)){
         $res = scorm_seq_flow($seq->currentactivity,'forward',$seq,true,$userid);
         if($res != null){
@@ -1319,7 +1319,7 @@ function scorm_seq_flow_activity_traversal ($activity, $userid, $direction, $chi
         $seq->nextactivity = $activity;
         return $seq;
     }
-     
+
     $rulch = scorm_seq_rules_check($sco, 'skipped'); // TODO: undefined
     if ($rulch != null){
         $seq = scorm_seq_flow_tree_traversal ($activity, $direction, false, $prevdirection, $seq,$userid);//endsession and exception
@@ -1329,7 +1329,7 @@ function scorm_seq_flow_activity_traversal ($activity, $userid, $direction, $chi
             return $seq;
         }
         else{
-            
+
             if ($prevdirection = 'backward' && $seq->traversaldir == 'backward'){
                 $seq = scorm_seq_flow_tree_traversal ($activity,$direction,false,null,$seq,$userid);
                 $seq = scorm_seq_flow_activity($seq->identifiedactivity, $userid, $direction, $childrenflag, $prevdirection, $seq,$userid);
@@ -1406,7 +1406,7 @@ function scorm_seq_flow_tree_traversal ($activity,$direction,$childrenflag,$prev
         }
         if (scorm_is_leaf ($activity) || !$childrenflag){
             if ($children[$siz-1]->id == $activity->id){
-    
+
                 $seq = scorm_seq_flow_tree_traversal ($parent, $direction, false, null, $seq,$userid);
                 // I think it's not necessary to do a return in here
             }
@@ -1442,10 +1442,10 @@ function scorm_seq_flow_tree_traversal ($activity,$direction,$childrenflag,$prev
                 return $seq;
             }
         }
-        
+
     }
     if($direction = 'backward'){
-        
+
          if ($activity->parent == '/'){
             $seq->traversaldir = null;
             $seq->nextactivity = null;
@@ -1486,7 +1486,7 @@ function scorm_seq_flow_tree_traversal ($activity,$direction,$childrenflag,$prev
                      $seq->traversaldir = 'forward';
                      $seq->nextactivity = $children[0];
                      return $seq;
-                     
+
                  }
                  else{
                      $children = scorm_get_children ($activity);
@@ -1497,7 +1497,7 @@ function scorm_seq_flow_tree_traversal ($activity,$direction,$childrenflag,$prev
 
              }
              else{
-                 
+
                      $seq->traversaldir = null;
                      $seq->nextactivity = null;
                      $seq->exception = 'SB.2.1-2';
@@ -1526,7 +1526,7 @@ function scorm_limit_cond_check ($activity,$userid){
     global $DB;
 
     if (isset($activity->tracked) && ($activity->tracked == 0)){
-        
+
         return false;
     }
 
@@ -1534,55 +1534,55 @@ function scorm_limit_cond_check ($activity,$userid){
         return false;
     }
 
-    if (!isset($activity->limitcontrol) || ($activity->limitcontrol == 1)){ 
+    if (!isset($activity->limitcontrol) || ($activity->limitcontrol == 1)){
         $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'activityattemptcount'));
         if (scorm_seq_is('activityprogressstatus',$activity->id,$userid) && ($r->value >=$activity->limitattempt)){
             return true;
         }
     }
 
-     if (!isset($activity->limitabsdurcontrol) || ($activity->limitabsdurcontrol == 1)){    
+     if (!isset($activity->limitabsdurcontrol) || ($activity->limitabsdurcontrol == 1)){
         $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'activityabsoluteduration'));
         if (scorm_seq_is('activityprogressstatus',$activity->id,$userid) && ($r->value >=$activity->limitabsduration)){
             return true;
         }
     }
 
-    if (!isset($activity->limitexpdurcontrol) || ($activity->limitexpdurcontrol == 1)){ 
+    if (!isset($activity->limitexpdurcontrol) || ($activity->limitexpdurcontrol == 1)){
         $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'activityexperiencedduration'));
         if (scorm_seq_is('activityprogressstatus',$activity->id,$userid) && ($r->value >=$activity->limitexpduration)){
             return true;
         }
     }
-    
-     if (!isset($activity->limitattabsdurcontrol) || ($activity->limitattabsdurcontrol == 1)){  
+
+     if (!isset($activity->limitattabsdurcontrol) || ($activity->limitattabsdurcontrol == 1)){
         $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'attemptabsoluteduration'));
         if (scorm_seq_is('activityprogressstatus',$activity->id,$userid) && ($r->value >=$activity->limitattabsduration)){
             return true;
         }
     }
 
-    if (!isset($activity->limitattexpdurcontrol) || ($activity->limitattexpdurcontrol == 1)){   
+    if (!isset($activity->limitattexpdurcontrol) || ($activity->limitattexpdurcontrol == 1)){
         $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'attemptexperiencedduration'));
         if (scorm_seq_is('activityprogressstatus',$activity->id,$userid) && ($r->value >=$activity->limitattexpduration)){
             return true;
         }
     }
 
-    if (!isset($activity->limitbegincontrol) || ($activity->limitbegincontrol == 1)){   
+    if (!isset($activity->limitbegincontrol) || ($activity->limitbegincontrol == 1)){
         $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'begintime'));
         if (time()>=$activity->limitbegintime){
             return true;
         }
     }
 
-    if (!isset($activity->limitbegincontrol) || ($activity->limitbegincontrol == 1)){   
+    if (!isset($activity->limitbegincontrol) || ($activity->limitbegincontrol == 1)){
         if (time()<$activity->limitbegintime){
             return true;
         }
     }
 
-    if (!isset($activity->limitendcontrol) || ($activity->limitendcontrol == 1)){   
+    if (!isset($activity->limitendcontrol) || ($activity->limitendcontrol == 1)){
 
         if (time()>$activity->limitendtime){
             return true;
@@ -1667,7 +1667,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
             return $seq;
 
         }
-        
+
         $children = scorm_get_children (scorm_get_parent ($sco));
         $pos1 = array_search($children, $sco);
         $pos2 = array_search($seq->currentactivity, $sco);
@@ -1826,7 +1826,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
                 }
             }
         }
-        break;  
+        break;
     }
 
     if(scorm_is_leaf ($sco)){
@@ -1848,7 +1848,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
     else{
         return $seq;
     }
-  
+
 }
 
 function scorm_seq_choice_flow ($constrained, $traverse, $seq){
@@ -2034,13 +2034,13 @@ function scorm_content_delivery_environment ($seq,$userid){
     //ONCE THE DELIVERY BEGINS (How should I check that?)
 
     if(isset($activity->tracked) || ($activity->tracked == 0)){
-        //How should I track the info and what should I do to not record the information for the activity during delivery? 
+        //How should I track the info and what should I do to not record the information for the activity during delivery?
         $atabsdur = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'attemptabsoluteduration'));
         $atexpdur = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'attemptexperiencedduration'));
     }
     return $seq;
 
+
 }
 function scorm_clear_suspended_activity($act,$seq){
     global $DB;
@@ -2059,7 +2059,7 @@ function scorm_clear_suspended_activity($act,$seq){
                         }
                         else{
                             $children = scorm_get_children($activity);
-                            $bool= false; 
+                            $bool= false;
                             foreach ($children as $child){
                                 if(scorm_seq_is('suspended',$child->id,$userid)){
                                     $bool= true;
@@ -2091,7 +2091,7 @@ function scorm_select_children_process($scoid,$userid){
                 case 'oneachnewattempt':
                 case 'never':
                 break;
-             
+
                 case 'once':
                     if(!scorm_seq_is('activityprogressstatus',$scoid,$userid)){
                         if(scorm_seq_is('selectioncountsstatus',$scoid,$userid)){
@@ -2115,7 +2115,7 @@ function scorm_select_children_process($scoid,$userid){
                         }
                     }
                 break;
-               
+
             }
 
         }
@@ -2132,10 +2132,10 @@ function scorm_randomize_children_process($scoid,$userid){
 
              switch($r->value) {
 
-                
+
                 case 'never':
                 break;
-             
+
                 case 'oneachnewattempt':
                 case 'once':
                     if(!scorm_seq_is('activityprogressstatus',$scoid,$userid)){
@@ -2151,7 +2151,7 @@ function scorm_randomize_children_process($scoid,$userid){
                                 array_splice($children,$pos,1);
                                 $i--;
                             }
-                            
+
                             $clist = serialize ($childlist);
                             scorm_seq_set('availablechildren', $scoid, $userid, false);
                             scorm_seq_set('availablechildren', $scoid, $userid, $clist);
@@ -2160,9 +2160,9 @@ function scorm_randomize_children_process($scoid,$userid){
                         }
                     }
                 break;
-             
-               
-               
+
+
+
             }
 
         }
@@ -2178,11 +2178,11 @@ function scorm_terminate_descendent_attempts ($activity,$userid,$seq){
 
                     foreach ($activitypath as $sco) {
                         scorm_seq_end_attempt($sco,$userid,$seq->attempt);
-                       
+
                     }
                 }
             }
-        } 
+        }
 }
 
 function scorm_sequencing_exception($seq){
@@ -2338,7 +2338,7 @@ function scorm_sequencing_exception($seq){
             case 'SB.2.10-3':
                 echo $OUTPUT->notification("Flow Sequencing Control Model Violation");
             break;
-            
+
             case 'SB.2.11-1':
                 echo $OUTPUT->notification("Sequencing session has not begun");
             break;
@@ -2363,13 +2363,13 @@ function scorm_sequencing_exception($seq){
             case 'DB.2-1':
                 echo $OUTPUT->notification("Identified activity is already active");
             break;
-                     
+
         }
-               
+
     }
 }
 
 
 
 
-?>
+
index 173bf64..20676a3 100644 (file)
@@ -88,4 +88,3 @@ $mod_scorm_capabilities = array(
     )
 );
 
-?>
\ No newline at end of file
index f7b5ca9..c9feba3 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file replaces:
 //   * STATEMENTS section in db/install.xml
index 945b08b..997edb8 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file keeps track of upgrades to
 // the scorm module
@@ -429,4 +429,4 @@ function xmldb_scorm_upgrade($oldversion) {
     return $result;
 }
 
-?>
+
index 7bef611..4ea04b0 100755 (executable)
@@ -99,4 +99,4 @@
 
     echo $OUTPUT->footer();
 
-?>
+
index b7a9065..154e4ad 100755 (executable)
@@ -664,7 +664,7 @@ function scorm_get_post_actions() {
  */
 function scorm_option2text($scorm) {
     $scorm_popoup_options = scorm_get_popup_options_array();
-    
+
     if (isset($scorm->popup)) {
         if ($scorm->popup == 1) {
             $optionlist = array();
@@ -689,7 +689,7 @@ function scorm_option2text($scorm) {
 /**
  * Implementation of the function for printing the form elements that control
  * whether the course reset functionality affects the scorm.
- * 
+ *
  * @param object $mform form passed by reference
  */
 function scorm_reset_course_form_definition(&$mform) {
@@ -791,7 +791,7 @@ function scorm_get_file_areas($course, $cm, $context) {
 
 /**
  * File browsing support
- * 
+ *
  * @todo Document this function
  */
 function scorm_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) {
@@ -809,7 +809,7 @@ function scorm_get_file_info($browser, $areas, $course, $cm, $context, $filearea
 
         $filepath = is_null($filepath) ? '/' : $filepath;
         $filename = is_null($filename) ? '.' : $filename;
-    
+
         $urlbase = $CFG->wwwroot.'/pluginfile.php';
         if (!$storedfile = $fs->get_file($context->id, $filearea, 0, $filepath, $filename)) {
             if ($filepath === '/' and $filename === '.') {
@@ -843,7 +843,7 @@ function scorm_get_file_info($browser, $areas, $course, $cm, $context, $filearea
     } else if ($filearea === 'scorm_package') {
         $filepath = is_null($filepath) ? '/' : $filepath;
         $filename = is_null($filename) ? '.' : $filename;
-    
+
         $urlbase = $CFG->wwwroot.'/pluginfile.php';
         if (!$storedfile = $fs->get_file($context->id, $filearea, 0, $filepath, $filename)) {
             if ($filepath === '/' and $filename === '.') {
@@ -884,7 +884,7 @@ function scorm_pluginfile($course, $cminfo, $context, $filearea, $args, $forcedo
     if (!$cm = get_coursemodule_from_instance('scorm', $cminfo->instance, $course->id)) {
         return false;
     }
-    
+
     require_login($course, true, $cm);
 
     if ($filearea === 'scorm_content') {
index 938b1af..5a660b6 100755 (executable)
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
 
 require_once("$CFG->dirroot/mod/scorm/lib.php");
 
@@ -739,13 +739,13 @@ function scorm_view_display ($user, $scorm, $action, $cm, $boxwidth='') {
             <div class='scorm-center'>
                 <?php print_string('organizations','scorm') ?>
                 <form id='changeorg' method='post' action='<?php echo $action ?>'>
-                    <?php 
+                    <?php
                     $select = new html_select();
                     $select->options = $orgs;
                     $select->name = 'organization';
                     $select->selectedvalue = $organization;
                     $select->add_action('change', 'submit_form_by_id', array('id' => 'changeorg'));
-                    echo $OUTPUT->select($select); 
+                    echo $OUTPUT->select($select);
                     ?>
                 </form>
             </div>
index 108a78c..4088e62 100644 (file)
@@ -372,4 +372,4 @@ class mod_scorm_mod_form extends moodleform_mod {
         parent::set_data($default_values);
     }
 }
-?>
+
index e4eebcf..3817890 100644 (file)
@@ -14,14 +14,14 @@ function scorm_set_next(url) {
 
 function scorm_get_element_style(obj, prop, cssProp) {
     var ret = '';
-    
+
     if (obj.currentStyle) {
         ret = obj.currentStyle[prop];
     } else if (document.defaultView && document.defaultView.getComputedStyle) {
         var compStyle = document.defaultView.getComputedStyle(obj, null);
         ret = compStyle.getPropertyValue(cssProp);
     }
-    
+
     if (ret == 'auto') ret = '0';
     return ret;
 }
@@ -43,14 +43,14 @@ function scorm_resize () {
         winwidth = document.body.clientWidth;
         winheight = document.body.clientHeight;
     }
-                              
-    var header = document.getElementById('header');   
+
+    var header = document.getElementById('header');
     var content = document.getElementById('content');
     var headerheight = 0;
     if (content) {
         headerheight = content.offsetTop;
     }
-    
+
     var footer = document.getElementById('footer');
     var imsnavbar = document.getElementById('tochead');
     var scormtop = document.getElementById('scormtop');
@@ -69,9 +69,9 @@ function scorm_resize () {
 
     var topmargin = parseInt(scorm_get_element_style(document.getElementsByTagName('body')[0], 'marginTop', 'margin-top'));
     var bottommargin = parseInt(scorm_get_element_style(document.getElementsByTagName('body')[0], 'marginBottom', 'margin-bottom'));
-    
-    var totalheight = headerheight + 
-                        footerheight + 
+
+    var totalheight = headerheight +
+                        footerheight +
                         scormtopheight+
                         topmargin +
                         bottommargin+10; // +10 to save a minor vertical scroll always present!
@@ -84,11 +84,11 @@ function scorm_resize () {
     var finalheighttoc = winheight - totalheighttoc;
     if (finalheighttoc <= 0) {
         finalheighttoc = winheight;
-    }                        
+    }
     var finalheight = winheight - totalheight;
     if (finalheight <= 0) {
         finalheight = winheight;
-    }                        
+    }
     var toctree = document.getElementById('toctree');
     if (toctree != null){
         var toctreeHeight = toctree.offsetHeight;
index 967a059..10b6560 100755 (executable)
@@ -23,7 +23,7 @@
     if ($action !== '') {
         $url->param('action', $action);
     }
-    
+
     if (!empty($id)) {
         $url->param('id', $id);
         if (! $cm = get_coursemodule_from_id('scorm', $id)) {
     if (empty($noheader)) {
         echo $OUTPUT->footer();
     }
-?>
+
index a9d8362..73cfd32 100755 (executable)
@@ -1,4 +1,4 @@
-<?php //$Id$
+<?php
     //This php script contains all the stuff to backup/restore
     //reservation mods
 
@@ -90,7 +90,7 @@
                     foreach ($oldoptions as $oldoption) {
                         list($element,$value) = explode('=',$oldoption);
                         $element = trim($element);
-                        $value = trim($value); 
+                        $value = trim($value);
                         switch ($element) {
                             case 'width':
                                 $scorm->width = $value;
                         $scorm->launch = $launchsco->new_id;
                         $DB->update_record('scorm',$scorm);
                     }
-                } 
-                
+                }
+
             } else {
                 $status = false;
             }
 
             //The structure is equal to the db, so insert the scorm_scoes
             $newid = $DB->insert_record ("scorm_scoes",$sco);
-            
+
             if ($newid) {
                 //We have the newid, update backup_ids
                 backup_putid($restore->backup_unique_code,"scorm_scoes", $oldid, $newid);
                     $status = scorm_scoes_tracks_restore_mods ($scorm_id,$info,$restore);
                 }
             }
-        }    
-        
+        }
+
         return $status;
     }
 
 
         //Get the discussions array
         $objectives = array();
-        
+
         if (!empty($info['MOD']['#']['SEQ_OBJECTIVES']['0']['#']['SEQ_OBJECTIVE'])) {
             $objectives = $info['MOD']['#']['SEQ_OBJECTIVES']['0']['#']['SEQ_OBJECTIVE'];
         }
             $objective->objectiveid = backup_todb($obj_info['#']['OBJECTIVEID']['0']['#']);
             $objective->satisfiedbymeasure = backup_todb($obj_info['#']['SATISFIEDBYMEASURE']['0']['#']);
             $objective->minnormalizedmeasure = backup_todb($obj_info['#']['MINNORMALIZEDMEASURE']['0']['#']);
-            
+
             //The structure is equal to the db, so insert the forum_discussions
             $newid = $DB->insert_record ("scorm_seq_objective",$objective);
 
             //Now restore the scorm_seq_mapinfo for each objective
 
             $status = scorm_seq_mapinfo_restore_mods ($sco_id,$newid,$obj_info,$restore);
-               
+
         }
 
         return $status;
 
         //Get the discussions array
         $rolluprules = array();
-        
+
         if (!empty($info['MOD']['#']['SEQ_ROLLUPRULES']['0']['#']['SEQ_ROLLUPRULE'])) {
             $rolluprules = $info['MOD']['#']['SEQ_ROLLUPRULES']['0']['#']['SEQ_ROLLUPRULE'];
         }
             $rolluprule->minimumpercent = backup_todb($rol_info['#']['MINIMUMPERCENT']['0']['#']);
             $rolluprule->conditioncombination = backup_todb($rol_info['#']['CONDITIONCOMBINATION']['0']['#']);
             $rolluprule->action = backup_todb($rol_info['#']['ACTION']['0']['#']);
-            
+
             //The structure is equal to the db, so insert the forum_discussions
             $newid = $DB->insert_record ("scorm_seq_rolluprule",$rolluprule);
 
             //Now restore the scorm_seq_mapinfo for each objective
 
             $status = scorm_seq_rolluprulecond_restore_mods ($sco_id, $newid,$obj_info,$restore);
-               
+
         }
 
         return $status;
 
         //Get the discussions array
         $ruleconds = array();
-        
+
         if (!empty($info['MOD']['#']['SEQ_RULECONDS']['0']['#']['SEQ_RULECOND'])) {
             $ruleconds = $info['MOD']['#']['SEQ_RULECONDS']['0']['#']['SEQ_RULECOND'];
         }
 
             //We'll need this later!!
             $oldid = backup_todb($rul_info['#']['ID']['0']['#']);
-            
-            $rulecond->scoid = $sco_id;      
+
+            $rulecond->scoid = $sco_id;
             $rulecond->conditioncombination = backup_todb($rul_info['#']['CONDITIONCOMBINATION']['0']['#']);
             $rulecond->minimumpercent = backup_todb($rul_info['#']['RULETYPE']['0']['#']);
             $rulecond->action = backup_todb($rul_info['#']['ACTION']['0']['#']);
-            
+
             //The structure is equal to the db, so insert the forum_discussions
             $newid = $DB->insert_record ("scorm_seq_ruleconds",$rulecond);
 
             //Now restore the scorm_seq_mapinfo for each objective
 
             $status = scorm_seq_rulecond_restore_mods ($sco_id, $newid,$obj_info,$restore);
-               
+
         }
 
         return $status;
 
         //Get the discussions array
         $rulecondsd = array();
-        
+
         if (!empty($info['MOD']['#']['SEQ_RULECOND_DATAS']['0']['#']['SEQ_RULECOND_DATA'])) {
             $rulecondsd = $info['MOD']['#']['SEQ_RULECOND_DATAS']['0']['#']['SEQ_RULECOND_DATA'];
         }
 
-        
+
         for($i = 0; $i < sizeof($rulecondsd); $i++) {
             $ruld_info = $rulecondsd[$i];
                      //Debug
 
             //We'll need this later!!
             $oldid = backup_todb($rul_info['#']['ID']['0']['#']);
-            
-            $rulecondd->scoid = $sco_id;      
+
+            $rulecondd->scoid = $sco_id;
             $rulecondd->ruleconditions = $rulecondid;
             $rulecondd->refrencedobjective = backup_todb($ruld_info['#']['REFRENCEDOBJECTIVE']['0']['#']);
             $rulecondd->measurethreshold = backup_todb($ruld_info['#']['MEASURETHRESHOLD']['0']['#']);
             $rulecondd->operator = backup_todb($ruld_info['#']['OPERATOR']['0']['#']);
             $rulecondd->cond = backup_todb($ruld_info['#']['COND']['0']['#']);
-            
+
             //The structure is equal to the db, so insert the forum_discussions
             $newid = $DB->insert_record ("scorm_seq_rulecond",$rulecondd);
 
 
         //Get the discussions array
         $rollupruleconds = array();
-        
+
         if (!empty($info['MOD']['#']['SEQ_ROLLUPRULECONDS']['0']['#']['SEQ_ROLLUPRULECOND'])) {
             $rollupruleconds = $info['MOD']['#']['SEQ_ROLLUPRULECONDS']['0']['#']['SEQ_ROLLUPRULECOND'];
         }
 
-        
+
         for($i = 0; $i < sizeof($rollupruleconds); $i++) {
             $rulc_info = $rollupruleconds[$i];
                      //Debug
 
             //We'll need this later!!
             $oldid = backup_todb($rulc_info['#']['ID']['0']['#']);
-            
-            $rolluprulecond->scoid = $sco_id;      
+
+            $rolluprulecond->scoid = $sco_id;
             $rolluprulecond->ruleconditions = $rolluprule;
             $rolluprulecond->cond = backup_todb($rulc_info['#']['COND']['0']['#']);
             $rolluprulecond->operator = backup_todb($rulc_info['#']['OPERATOR']['0']['#']);
 
         //Get the discussions array
         $mapinfos = array();
-        
+
         if (!empty($info['MOD']['#']['SEQ_MAPINFO']['0']['#']['SEQ_MAPINF'])) {
             $mapinfos = $info['MOD']['#']['SEQ_MAPINFO']['0']['#']['SEQ_MAPINF'];
         }
 
-        
+
         for($i = 0; $i < sizeof($mapinfos); $i++) {
             $map_info = $mapinfos[$i];
                      //Debug
 
             //We'll need this later!!
             $oldid = backup_todb($map_info['#']['ID']['0']['#']);
-            
-            $mapinfo->scoid = $sco_id;      
+
+            $mapinfo->scoid = $sco_id;
             $mapinfo->objectiveid = $ojectiveid;
             $mapinfo->targetobjectiveid = backup_todb($map_info['#']['TARGETOBJECTIVEID']['0']['#']);
             $mapinfo->readsatisfiedstatus = backup_todb($map_info['#']['READSATISFIEDSTATUS']['0']['#']);
             $mapinfo->writesatisfiedstatus = backup_todb($map_info['#']['WRITESATISFIEDSTATUS']['0']['#']);
             $mapinfo->writenormalizedmeasure = backup_todb($map_info['#']['WRITENORMALIZEDMEASURE']['0']['#']);
 
-            
+
             //The structure is equal to the db, so insert the forum_discussions
             $newid = $DB->insert_record ("scorm_seq_mapinfo",$mapinfo);
 
                     }
                 }
             }
-        }    
-        
+        }
+
         return $status;
     }
 
 
         return $status;
     }
-    
+
     //This function restores the scorm_scoes_track from Moodle 1.4
     function scorm_scoes_tracks_restore_mods_pre15 ($scorm_id,$info,$restore) {
         global $CFG, $DB;
         if (!empty($info['MOD']['#']['SCO_USERS']['0']['#']['SCO_USER'])) {
             $scousers = $info['MOD']['#']['SCO_USERS']['0']['#']['SCO_USER'];
         }
-        
+
         $oldelements = array ('CMI_CORE_LESSON_LOCATION',
                               'CMI_CORE_LESSON_STATUS',
                               'CMI_CORE_EXIT',
     //scorm_decode_content_links_caller() function in each module
     //in the restore process
     function scorm_decode_content_links ($content,$restore) {
-            
+
         global $CFG;
-            
+
         $result = $content;
-                
+
         //Link to the list of scorms
-                
+
         $searchstring='/\$@(SCORMINDEX)\*([0-9]+)@\$/';
         //We look for it
         preg_match_all($searchstring,$content,$foundset);
                 if($rec->new_id) {
                     //Now replace it
                     $result= preg_replace($searchstring,$CFG->wwwroot.'/mod/scorm/index.php?id='.$rec->new_id,$result);
-                } else { 
+                } else {
                     //It's a foreign link so leave it as original
                     $result= preg_replace($searchstring,$restore->original_wwwroot.'/mod/scorm/index.php?id='.$old_id,$result);
                 }
 
         return $status;
     }
-?>
+
index b7078c9..fad41de 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 require_once($CFG->dirroot . '/mod/scorm/locallib.php');
 $yesno = array(0 => get_string('no'),
                1 => get_string('yes'));
@@ -58,4 +58,4 @@ $settings->add(new admin_setting_configcheckbox('scorm/allowapidebug', get_strin
 
 $settings->add(new admin_setting_configtext('scorm/apidebugmask', get_string('apidebugmask', 'scorm'), '', '/.*/'));
 
-?>
+
index 7bc83b9..0efa2aa 100644 (file)
@@ -47,8 +47,8 @@
    width: 100%;
 
    height: 100%;
-   
-   
+
+
 
 }
 
@@ -59,9 +59,9 @@
   position: relative;
 
   width: 100%;
-  
-  
-  
+
+
+
 
 }
 
 
   top: 3px;
 
-  height: 30px;  
-  
-  
+  height: 30px;
+
+
 
 }
 
 #mod-scorm-player .toc {
 
-  width: 80%; 
+  width: 80%;
+
+  margin-left: 20%;
+
+
 
-  margin-left: 20%; 
-  
-  
-  
 
 }
 
 #mod-scorm-player .no-toc {
 
   width: 100%;
-  
-  
+
+
 
 }
 
 #mod-scorm-player #scormobject {
 
-  height: 400px; 
-  
-  
-  
+  height: 400px;
+
+
+
 
 }
 
   width: 100%;
 
   height: 30px;
-  
-  
+
+
 
 }
 
   left: 5px;
 
   top: 0px;
-  
-  
-  
+
+
+
 
 }
 
   top: 3px;
 
   width: 100%;
-  
-  
-  
+
+
+
 
 }
 
 #mod-scorm-view .structurehead {
 
   text-align: center;
-  
-  
+
+
 
 }
 
   list-style-type: none;
 
   white-space: nowrap;
-  
-  
+
+
 
 }
 
   right: 0px;
 
   top: 0px;
-  
-  
+
+
 
 }
 
   width: 24%;
 
   font-size: 0.8em;
-  
-  
+
+
 
 }
 
 
   top: 3px;
 
-  height: 30px;  
-  
-  
+  height: 30px;
+
+
 
 }
 
   overflow-x: auto;
 
   overflow-y: auto;
-  
-  
+
+
 
 }
 
   width: 96%;
 
   margin-left:0;
-  
+
   padding-left: 0;
-  
+
   margin-right:0;
-  
+
   padding-right: 0;
-  
+
   padding-top: 0;
-  
+
   padding-bottom: 0;
-  
+
   margin-top:0;
-  
+
   margin-bottom:0;
-  
-  
-  
-  
+
+
+
+
 }
 
 
index b0eb5c3..3fa801e 100755 (executable)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 /////////////////////////////////////////////////////////////////////////////////
 ///  Code fragment to define the version of scorm
@@ -14,4 +14,3 @@ $module->version  = 2009042001;   // The (date) version of this module
 $module->requires = 2009041700;   // The version of Moodle that is required
 $module->cron     = 300;            // How often should cron check this module (seconds)?
 
-?>
\ No newline at end of file
index 84081aa..770acfe 100755 (executable)
@@ -2,7 +2,7 @@
 
     require_once("../../config.php");
     require_once('locallib.php');
-    
+
     $id = optional_param('id', '', PARAM_INT);       // Course Module ID, or
     $a = optional_param('a', '', PARAM_INT);         // scorm ID
     $organization = optional_param('organization', '', PARAM_INT); // organization ID
@@ -36,7 +36,7 @@
         $url->param('organization', $organization);
     }
     $PAGE->set_url($url);
-    
+
     require_login($course->id, false, $cm);
 
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
@@ -65,7 +65,7 @@
     echo $OUTPUT->header();
 
     if (has_capability('mod/scorm:viewreport', $context)) {
-        
+
         $trackedusers = scorm_get_count_users($scorm->id, $cm->groupingid);
         if ($trackedusers > 0) {
             echo "<div class=\"reportlink\"><a $CFG->frametarget href=\"report.php?id=$cm->id\"> ".get_string('viewalluserreports','scorm',$trackedusers).'</a></div>';
@@ -81,7 +81,7 @@
         $attemptstatus = scorm_get_attempt_status($USER,$scorm);
     }
     echo $OUTPUT->box(format_module_intro('scorm', $scorm, $cm->id).$attemptstatus, 'generalbox boxaligncenter boxwidthwide', 'intro');
-    
+
     $scormopen = true;
     $timenow = time();
     if ($scorm->timeclose !=0) {
@@ -97,4 +97,4 @@
         scorm_view_display($USER, $scorm, 'view.php?id='.$cm->id, $cm);
     }
     echo $OUTPUT->footer();
-?>
+
index 01cbb72..546aa89 100644 (file)
@@ -1,4 +1,4 @@
-<?php //$Id$
+<?php
     //This php script contains all the stuff to backup/restore
     //survey mods
 
@@ -8,7 +8,7 @@
     //                        (CL,pk->id)                 |(CL,pk->id,?????) |
     //                            |                       --------------------
     //                            |
-    //             -----------------------------------        
+    //             -----------------------------------
     //             |                                 |
     //        survey_analysis                   survey_answers
     //    (UL,pk->id, fk->survey)           (UL,pk->id, fk->survey)
 
     function survey_backup_one_mod($bf,$preferences,$survey) {
         global $DB;
-        
+
         $status = true;
-        
+
         if (is_numeric($survey)) {
             $survey = $DB->get_record('survey', array('id'=>$survey));
         }
-        
+
         //Start mod
         fwrite ($bf,start_tag("MOD",3,true));
         //Print choice data
@@ -60,7 +60,7 @@
         fwrite ($bf,full_tag("NAME",4,false,$survey->name));
         fwrite ($bf,full_tag("INTRO",4,false,$survey->intro));
         fwrite ($bf,full_tag("QUESTIONS",4,false,$survey->questions));
-        
+
         //if we've selected to backup users info, then execute backup_survey_answers and
         //backup_survey_analysis
         if (backup_userdata_selected($preferences,'survey',$survey->id)) {
                                        WHERE s.survey = ?", array($instanceid));
     }
 
-?>
+
index 3b533c4..201a0a2 100644 (file)
@@ -69,4 +69,4 @@ $mod_survey_capabilities = array(
 
 );
 
-?>
+
index a3d75a0..00add77 100644 (file)
@@ -1,4 +1,4 @@
-<?php  //$Id$
+<?php
 
 // This file replaces:
 //   * STATEMENTS section in db/install.xml
index b72ce55..837e801 100644 (file)
@@ -1,6 +1,6 @@
-<?php  //$Id$
+<?php
 
-// This file keeps track of upgrades to 
+// This file keeps track of upgrades to
 // the survey module
 //
 // Sometimes, changes between versions involve
@@ -44,4 +44,4 @@ function xmldb_survey_upgrade($oldversion) {
     return $result;
 }
 
-?>
+
index 4bcd5a9..7541955 100644 (file)
@@ -56,7 +56,7 @@
 /// Check to see if groups are being used in this survey
     if ($group) {
         $users = get_users_by_capability($context, 'mod/survey:participate', '', '', '', '', $group, null, false);
-    } else if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) { 
+    } else if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) {
         $groups = groups_get_all_groups($courseid, 0, $cm->groupingid);
         $groups = array_keys($groups);
         $users = get_users_by_capability($context, 'mod/survey:participate', '', '', '', '', $groups, null, false);
@@ -67,7 +67,7 @@
 
     $stractual = get_string("actual", "survey");
     $stractualclass = get_string("actualclass", "survey");
-    
+
     $strpreferred = get_string("preferred", "survey");
     $strpreferredclass = get_string("preferredclass", "survey");
 
    exit;
 
 
-?>
+
index f85f737..be74359 100644 (file)
@@ -82,4 +82,4 @@
     echo $OUTPUT->table($table);
     echo $OUTPUT->footer();
 
-?>
+
index 137ba09..dec4dbc 100644 (file)
@@ -74,7 +74,7 @@ function survey_add_instance($survey) {
         return 0;
     }
 
-    $survey->questions    = $template->questions; 
+    $survey->questions    = $template->questions;
     $survey->timecreated  = time();
     $survey->timemodified = $survey->timecreated;
 
@@ -98,8 +98,8 @@ function survey_update_instance($survey) {
         return 0;
     }
 
-    $survey->id           = $survey->instance; 
-    $survey->questions    = $template->questions; 
+    $survey->id           = $survey->instance;
+    $survey->questions    = $template->questions;
     $survey->timemodified = time();
 
     return $DB->update_record("survey", $survey);
@@ -108,7 +108,7 @@ function survey_update_instance($survey) {
 /**
  * Given an ID of an instance of this module,
  * this function will permanently delete the instance
- * and any data that depends on it.  
+ * and any data that depends on it.
  *
  * @global object
  * @param int $id
@@ -179,11 +179,11 @@ function survey_user_complete($course, $user, $mod, $survey) {
 
             $questions = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions));
             $questionorder = explode(",", $survey->questions);
-            
+
             foreach ($questionorder as $key=>$val) {
                 $question = $questions[$val];
                 $questiontext = get_string($question->shorttext, "survey");
-                
+
                 if ($answer = survey_get_user_answer($survey->id, $question->id, $user->id)) {
                     $answertext = "$answer->answer1";
                 } else {
@@ -192,12 +192,12 @@ function survey_user_complete($course, $user, $mod, $survey) {
                 $table->data[] = array("<b>$questiontext</b>", $answertext);
             }
             echo $OUTPUT->table($table);
-            
+
         } else {
-        
+
             survey_print_graph("id=$mod->id&amp;sid=$user->id&amp;type=student.png");
         }
-        
+
     } else {
         print_string("notdone", "survey");
     }
@@ -249,7 +249,7 @@ function survey_print_recent_activity($course, $viewfullnames, $timestart) {
         $survey->name = $cm->name;
         $survey->cmid = $cm->id;
         $surveys[] = $survey;
-    } 
+    }
     $rs->close();
 
     if (!$surveys) {
@@ -261,7 +261,7 @@ function survey_print_recent_activity($course, $viewfullnames, $timestart) {
         $url = $CFG->wwwroot.'/mod/survey/view.php?id='.$survey->cmid;
         print_recent_activity_note($survey->time, $survey, $survey->name, $url, false, $viewfullnames);
     }
+
     return true;
 }
 
@@ -321,7 +321,7 @@ function survey_log_info($log) {
 function survey_get_responses($surveyid, $groupid, $groupingid) {
     global $DB;
 
-    $params = array('surveyid'=>$surveyid, 'groupid'=>$groupid, 'groupingid'=>$groupingid); 
+    $params = array('surveyid'=>$surveyid, 'groupid'=>$groupid, 'groupingid'=>$groupingid);
 
     if ($groupid) {
         $groupsjoin = "JOIN {groups_members} gm ON u.id = gm.userid AND gm.groupid = :groupid ";
@@ -351,7 +351,7 @@ function survey_get_responses($surveyid, $groupid, $groupingid) {
 function survey_get_analysis($survey, $user) {
     global $DB;
 
-    return $DB->get_record_sql("SELECT notes 
+    return $DB->get_record_sql("SELECT notes
                                   FROM {survey_analysis}
                                  WHERE survey=? AND userid=?", array($survey, $user));
 }
@@ -366,8 +366,8 @@ function survey_update_analysis($survey, $user, $notes) {
     global $DB;
 
     return $DB->execute("UPDATE {survey_analysis}
-                            SET notes=? 
-                          WHERE survey=? 
+                            SET notes=?
+                          WHERE survey=?
                             AND userid=?", array($notes, $survey, $user));
 }
 
@@ -389,10 +389,10 @@ function survey_get_user_answers($surveyid, $questionid, $groupid, $sort="sa.ans
         $groupsql = "";
     }
 
-    return $DB->get_records_sql("SELECT sa.*,u.firstname,u.lastname,u.picture 
-                                   FROM {survey_answers} sa,  {user} u, {groups_members} gm 
-                                  WHERE sa.survey = :surveyid 
-                                        AND sa.question = :questionid 
+    return $DB->get_records_sql("SELECT sa.*,u.firstname,u.lastname,u.picture
+                                   FROM {survey_answers} sa,  {user} u, {groups_members} gm
+                                  WHERE sa.survey = :surveyid
+                                        AND sa.question = :questionid
                                         AND u.id = sa.userid $groupsql
                                ORDER BY $sort", $params);
 }
@@ -407,10 +407,10 @@ function survey_get_user_answers($surveyid, $questionid, $groupid, $sort="sa.ans
 function survey_get_user_answer($surveyid, $questionid, $userid) {
     global $DB;
 
-    return $DB->get_record_sql("SELECT sa.* 
+    return $DB->get_record_sql("SELECT sa.*
                                   FROM {survey_answers} sa
-                                 WHERE sa.survey = ? 
-                                       AND sa.question = ? 
+                                 WHERE sa.survey = ?
+                                       AND sa.question = ?
                                        AND sa.userid = ?", array($surveyid, $questionid, $userid));
 }
 
@@ -471,7 +471,7 @@ function survey_print_all_responses($cmid, $results, $courseid) {
 
     foreach ($results as $a) {
         $table->data[] = array($OUTPUT->user_picture(moodle_user_picture::make($a, $courseid)),
-               $OUTPUT->link("report.php?action=student&student=$a->id&id=$cmid", fullname($a)), 
+               $OUTPUT->link("report.php?action=student&student=$a->id&id=$cmid", fullname($a)),
                userdate($a->time));
     }
 
@@ -549,7 +549,7 @@ function survey_print_multi($question) {
     if ($oneanswer) {
         echo "<tr><th scope=\"col\" colspan=\"6\">$question->intro</th></tr>\n";
     } else {
-        echo "<tr><th scope=\"col\" colspan=\"7\">$question->intro</th></tr>\n"; 
+        echo "<tr><th scope=\"col\" colspan=\"7\">$question->intro</th></tr>\n";
     }
 
     $subquestions = $DB->get_records_list("survey_questions", "id", explode(',', $question->multi));
@@ -575,8 +575,8 @@ function survey_print_multi($question) {
             $default = get_accesshide($strdefault, 'label', '', "for=\"q$P$q->id\"");
             echo "<td class=\"whitecell\"><input type=\"radio\" name=\"q$P$q->id\" id=\"q$P" . $q->id . "_D\" value=\"0\" checked=\"checked\" />$default</td>";
             $checklist["q$P$q->id"] = $numoptions;
-        
-        } else { 
+
+        } else {
             // yu : fix for MDL-7501, possibly need to use user flag as this is quite ugly.
             echo "<th scope=\"row\" class=\"optioncell\">";
             echo "<b class=\"qnumtopcell\">$qnum</b> &nbsp; ";
@@ -605,7 +605,7 @@ function survey_print_multi($question) {
             $default = get_accesshide($strdefault, 'label', '', "for=\"q$q->id\"");
             echo "<td class=\"buttoncell\"><input type=\"radio\" name=\"q$q->id\" id=\"q$q->id\" value=\"0\" checked=\"checked\" />$default</td>";
             $checklist["qP$q->id"] = $numoptions;
-            $checklist["q$q->id"] = $numoptions;            
+            $checklist["q$q->id"] = $numoptions;
         }
         echo "</tr>\n";
     }
@@ -706,7 +706,7 @@ function survey_get_post_actions() {
 /**
  * Implementation of the function for printing the form elements that control
  * whether the course reset functionality affects the survey.
- * 
+ *
  * @param object $mform form passed by reference
  */
 function survey_reset_course_form_definition(&$mform) {
index 79925e9..ce225dc 100644 (file)
@@ -44,4 +44,4 @@ class mod_survey_mod_form extends moodleform_mod {
 
 
 }
-?>
+
index 7677607..7de4822 100644 (file)
@@ -62,7 +62,7 @@
     $PAGE->set_url($url);
 
     require_login($course->id, false, $cm);
-    
+
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
 
     require_capability('mod/survey:readresponses', $context);
 
     if ($currentgroup) {
         $users = get_users_by_capability($context, 'mod/survey:participate', '', '', '', '', $currentgroup, null, false);
-    } else if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) { 
+    } else if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) {
         $groups = groups_get_all_groups($courseid, 0, $cm->groupingid);
         $groups = array_keys($groups);
         $users = get_users_by_capability($context, 'mod/survey:participate', '', '', '', '', $groups, null, false);
     }
 
     $groupingid = $cm->groupingid;
-    
+
     echo $OUTPUT->box_start("generalbox boxaligncenter");
     if ($showscales) {
         echo "<a href=\"report.php?action=summary&amp;id=$id\">$strsummary</a>";
                     $table->data[] = array($contents);
 
                     echo $OUTPUT->table($table);
-                    
+
                     $spacer = new html_image();
                     $spacer->height = 30;
                     $spacer->width = 1;
 
     }
     echo $OUTPUT->footer();
-?>
+
index 9c2a253..b085e76 100644 (file)
@@ -1,4 +1,4 @@
-<?php //$Id$
+<?php
     //This php script contains all the stuff to backup/restore
     //survey mods
 
@@ -8,7 +8,7 @@
     //                        (CL,pk->id)                 |(CL,pk->id,?????) |
     //                            |                       --------------------
     //                            |
-    //             -----------------------------------        
+    //             -----------------------------------
     //             |                                 |
     //        survey_analysis                   survey_answers
     //    (UL,pk->id, fk->survey)           (UL,pk->id, fk->survey)
@@ -32,7 +32,7 @@
         $data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id);
 
         if ($data) {
-            //Now get completed xmlized object   
+            //Now get completed xmlized object
             $info = $data->info;
             //traverse_xmlize($info);                                                                     //Debug
             //print_object ($GLOBALS['traverse_array']);                                                  //Debug
             //Do some output
             if (($i+1) % 50 == 0) {
                 if (!defined('RESTORE_SILENTLY')) {
-                    echo ".";       
+                    echo ".";
                     if (($i+1) % 1000 == 0) {
                         echo "<br />";
                     }
     //servey_decode_content_links_caller() function in each module
     //in the restore process
     function servey_decode_content_links ($content,$restore) {
-            
+
         global $CFG;
-            
+
         $result = $content;
-                
+
         //Link to the list of serveys
-                
+
         $searchstring='/\$@(SURVEYINDEX)\*([0-9]+)@\$/';
         //We look for it
         preg_match_all($searchstring,$content,$foundset);
                 if($rec->new_id) {
                     //Now replace it
                     $result= preg_replace($searchstring,$CFG->wwwroot.'/mod/servey/index.php?id='.$rec->new_id,$result);
-                } else { 
+                } else {
                     //It's a foreign link so leave it as original
                     $result= preg_replace($searchstring,$restore->original_wwwroot.'/mod/servey/index.php?id='.$old_id,$result);
                 }
     function survey_decode_content_links_caller($restore) {
         global $CFG, $DB;
         $status = true;
-        
+
         if ($surveys = $DB->get_records('survey', array('course'=>$restore->course_id), '', "id,intro")) {
                                                //Iterate over each survey->intro
             $i = 0;   //Counter to send some output to the browser to avoid timeouts
         }
         return $status;
     }
-?>
+
index c122dbe..b6934bf 100644 (file)
 
     $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/survey/save.php', array('id'=>$id)));
     require_login($course->id, false, $cm);
-    
+
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
     require_capability('mod/survey:participate', $context);
-    
+
     if (! $survey = $DB->get_record("survey", array("id"=>$cm->instance))) {
         print_error('invalidsurveyid', 'survey');
     }
     exit;
 
 
-?>
+
index 662eadc..f623c4d 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
 ////////////////////////////////////////////////////////////////////////////////
 //  Code fragment to define the module version etc.
@@ -9,4 +9,4 @@ $module->version  = 2009042002;
 $module->requires = 2009041700;  // Requires this Moodle version
 $module->cron     = 0;
 
-?>
+
index 8f4f4bb..45a4841 100644 (file)
 
     echo $OUTPUT->footer();
 
-?>
+
index abab8c7..e0eff0d 100644 (file)
@@ -46,7 +46,7 @@ class mod_url_mod_form extends moodleform_mod {
 
         //-------------------------------------------------------
         $mform->addElement('header', 'content', get_string('contentheader', 'url'));
-        $mform->addElement('url', 'externalurl', get_string('externalurl', 'url'), array('size'=>'60'), array('usefilepicker'=>true)); 
+        $mform->addElement('url', 'externalurl', get_string('externalurl', 'url'), array('size'=>'60'), array('usefilepicker'=>true));
         //-------------------------------------------------------
         $mform->addElement('header', 'optionssection', get_string('optionsheader', 'url'));