SCORM MDL-22340 use full path for includes.
authorDan Marsden <Dan@digitalclay.co.nz>
Thu, 6 May 2010 00:13:54 +0000 (00:13 +0000)
committerDan Marsden <Dan@digitalclay.co.nz>
Thu, 6 May 2010 00:13:54 +0000 (00:13 +0000)
mod/scorm/datamodel.php
mod/scorm/datamodels/scorm_13lib.php
mod/scorm/datamodels/sequencinglib.php
mod/scorm/index.php
mod/scorm/lib.php
mod/scorm/loadSCO.php
mod/scorm/locallib.php
mod/scorm/player.php
mod/scorm/view.php

index f68707e..c48b81e 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
     require_once('../../config.php');
-    require_once('locallib.php');
+    require_once($CFG->dirroot.'/mod/scorm/locallib.php');
 
     $id = optional_param('id', '', PARAM_INT);       // Course Module ID, or
     $a = optional_param('a', '', PARAM_INT);         // scorm ID
@@ -49,7 +49,7 @@
                 }
                 if (substr($element,0,15) == 'adl.nav.request') {
                     // SCORM 2004 Sequencing Request
-                    require_once('datamodels/sequencinglib.php');
+                    require_once($CFG->dirroot.'/mod/scorm/datamodels/sequencinglib.php');
 
                     $search = array('@continue@', '@previous@', '@\{target=(\S+)\}choice@', '@exit@', '@exitAll@', '@abandon@', '@abandonAll@');
                     $replace = array('continue_', 'previous_', '\1', 'exit_', 'exitall_', 'abandon_', 'abandonall');
index 6615445..8759fce 100644 (file)
@@ -168,7 +168,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
                             $previd = $sco->id;
                         }
                     }
-                    require_once('sequencinglib.php');
+                    require_once($CFG->dirroot.'/mod/scorm/datamodels/sequencinglib.php');
                     if (scorm_seq_evaluate($sco->id,$usertracks)) {
                         if ($sco->id == $scoid) {
                             $result->prerequisites = true;
index 6c87d06..2b839f7 100755 (executable)
@@ -1,5 +1,5 @@
 <?php
-require ('scormlib.php');
+require ($CFG->dirroot.'/mod/scorm/datamodels/scormlib.php');
 
 function scorm_seq_evaluate($scoid,$usertracks) {
     return true;
index 6731c66..3a78248 100755 (executable)
@@ -1,7 +1,7 @@
 <?php
 
     require_once("../../config.php");
-    require_once("locallib.php");
+    require_once($CFG->dirroot.'/mod/scorm/locallib.php');
 
     $id = required_param('id', PARAM_INT);   // course id
 
index 8659e2c..26a7c7b 100755 (executable)
@@ -51,7 +51,7 @@ define('SCORM_TYPE_IMSREPOSITORY', 'imsrepository');
 function scorm_add_instance($scorm, $mform=null) {
     global $CFG, $DB;
 
-    require_once('locallib.php');
+    require_once($CFG->dirroot.'/mod/scorm/locallib.php');
 
     if (empty($scorm->timerestrict)) {
         $scorm->timeopen = 0;
@@ -141,7 +141,7 @@ function scorm_add_instance($scorm, $mform=null) {
 function scorm_update_instance($scorm, $mform=null) {
     global $CFG, $DB;
 
-    require_once('locallib.php');
+    require_once($CFG->dirroot.'/mod/scorm/locallib.php');
 
     if (empty($scorm->timerestrict)) {
         $scorm->timeopen = 0;
@@ -284,7 +284,7 @@ function scorm_delete_instance($id) {
  */
 function scorm_user_outline($course, $user, $mod, $scorm) {
     global $CFG;
-    require_once('locallib.php');
+    require_once($CFG->dirroot.'/mod/scorm/locallib.php');
 
     require_once("$CFG->libdir/gradelib.php");
     $grades = grade_get_grades($course->id, 'mod', 'scorm', $scorm->id, $user->id);
@@ -322,7 +322,7 @@ function scorm_user_complete($course, $user, $mod, $scorm) {
     $report = '';
     
     // First Access and Last Access dates for SCOs
-    require_once("locallib.php");
+    require_once($CFG->dirroot.'/mod/scorm/locallib.php');
     $timetracks = scorm_get_sco_runtime($scorm->id, false, $user->id);
     $firstmodify = $timetracks->start;
     $lastmodify = $timetracks->finish;
@@ -461,7 +461,7 @@ function scorm_user_complete($course, $user, $mod, $scorm) {
 function scorm_cron () {
     global $CFG, $DB;
 
-    require_once('locallib.php');
+    require_once($CFG->dirroot.'/mod/scorm/locallib.php');
 
     $sitetimezone = $CFG->timezone;
     /// Now see if there are any scorm updates to be done
@@ -499,7 +499,7 @@ function scorm_cron () {
  */
 function scorm_get_user_grades($scorm, $userid=0) {
     global $CFG, $DB;
-    require_once('locallib.php');
+    require_once($CFG->dirroot.'/mod/scorm/locallib.php');
 
     $grades = array();
     if (empty($userid)) {
index 9e3c9ab..f03aed3 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
     require_once('../../config.php');
-    require_once('locallib.php');
+    require_once($CFG->dirroot.'/mod/scorm/locallib.php');
 
     $id    = optional_param('id', '', PARAM_INT);    // Course Module ID, or
     $a     = optional_param('a', '', PARAM_INT);     // scorm ID
index 20581f5..62b1786 100755 (executable)
@@ -340,7 +340,7 @@ function scorm_get_scoes($id,$organisation=false) {
 }
 
 function scorm_insert_track($userid,$scormid,$scoid,$attempt,$element,$value,$forcecompleted=false) {
-    global $DB;
+    global $DB, $CFG;
 
     $id = null;
 
@@ -382,7 +382,7 @@ function scorm_insert_track($userid,$scormid,$scoid,$attempt,$element,$value,$fo
         (($element == 'cmi.core.lesson_status' || $element == 'cmi.completion_status') && ($track->value == 'completed' || $track->value == 'passed'))) {
         $scorm = $DB->get_record('scorm', array('id' => $scormid));
         $grademethod = $scorm->grademethod % 10;
-        include_once('lib.php');
+        include_once($CFG->dirroot.'/mod/scorm/lib.php');
         scorm_update_grades($scorm, $userid);
     }
 
index 2176396..50a737b 100755 (executable)
@@ -3,7 +3,7 @@
 /// This page prints a particular instance of aicc/scorm package
 
     require_once('../../config.php');
-    require_once('locallib.php');
+    require_once($CFG->dirroot.'/mod/scorm/locallib.php');
     //
     // Checkin' script parameters
     //
index c956afc..da1c78d 100755 (executable)
@@ -1,7 +1,7 @@
 <?php
 
     require_once("../../config.php");
-    require_once('locallib.php');
+    require_once($CFG->dirroot.'/mod/scorm/locallib.php');
 
     $id = optional_param('id', '', PARAM_INT);       // Course Module ID, or
     $a = optional_param('a', '', PARAM_INT);         // scorm ID