Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

SCORM MDL-22340 use full path for includes. thanks to Valerian for re…

…port/patch merged from HEAD
  • Loading branch information...
commit 1f992ca3fdcf0791fab342df49e9accaf99067d6 1 parent da98ba3
Dan Marsden danmarsden authored
4 mod/scorm/datamodel.php
... ... @@ -1,6 +1,6 @@
1 1 <?php
2 2 require_once('../../config.php');
3   - require_once('locallib.php');
  3 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
4 4
5 5 $id = optional_param('id', '', PARAM_INT); // Course Module ID, or
6 6 $a = optional_param('a', '', PARAM_INT); // scorm ID
@@ -45,7 +45,7 @@
45 45 }
46 46 if (substr($element,0,15) == 'adl.nav.request') {
47 47 // SCORM 2004 Sequencing Request
48   - require_once('datamodels/sequencinglib.php');
  48 + require_once($CFG->dirroot.'/mod/scorm/datamodels/sequencinglib.php');
49 49
50 50 $search = array('@continue@', '@previous@', '@\{target=(\S+)\}choice@', '@exit@', '@exitAll@', '@abandon@', '@abandonAll@');
51 51 $replace = array('continue_', 'previous_', '\1', 'exit_', 'exitall_', 'abandon_', 'abandonall');
2  mod/scorm/datamodels/scorm_13lib.php
@@ -169,7 +169,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
169 169 $previd = $sco->id;
170 170 }
171 171 }
172   - require_once('sequencinglib.php');
  172 + require_once($CFG->dirroot.'/mod/scorm/datamodels/sequencinglib.php');
173 173 if (scorm_seq_evaluate($sco->id,$usertracks)) {
174 174 if ($sco->id == $scoid) {
175 175 $result->prerequisites = true;
2  mod/scorm/datamodels/sequencinglib.php
... ... @@ -1,5 +1,5 @@
1 1 <?php // $Id$
2   -require ('scormlib.php');
  2 +require ($CFG->dirroot.'/mod/scorm/datamodels/scormlib.php');
3 3
4 4 function scorm_seq_evaluate($scoid,$usertracks) {
5 5 return true;
2  mod/scorm/index.php
... ... @@ -1,7 +1,7 @@
1 1 <?php // $Id$
2 2
3 3 require_once("../../config.php");
4   - require_once("locallib.php");
  4 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
5 5
6 6 $id = required_param('id', PARAM_INT); // course id
7 7
16 mod/scorm/lib.php
@@ -13,7 +13,7 @@
13 13 function scorm_add_instance($scorm) {
14 14 global $CFG;
15 15
16   - require_once('locallib.php');
  16 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
17 17
18 18 if (($packagedata = scorm_check_package($scorm)) != null) {
19 19 $scorm->pkgtype = $packagedata->pkgtype;
@@ -80,7 +80,7 @@ function scorm_add_instance($scorm) {
80 80 function scorm_update_instance($scorm) {
81 81 global $CFG;
82 82
83   - require_once('locallib.php');
  83 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
84 84
85 85 $scorm->parse = 0;
86 86 if (($packagedata = scorm_check_package($scorm)) != null) {
@@ -156,7 +156,7 @@ function scorm_delete_instance($id) {
156 156 $scorm->dir = $CFG->dataroot.'/'.$scorm->course.'/moddata/scorm';
157 157 if (is_dir($scorm->dir.'/'.$scorm->id)) {
158 158 // Delete any dependent files
159   - require_once('locallib.php');
  159 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
160 160 scorm_delete_files($scorm->dir.'/'.$scorm->id);
161 161 }
162 162
@@ -218,7 +218,7 @@ function scorm_delete_instance($id) {
218 218 */
219 219 function scorm_user_outline($course, $user, $mod, $scorm) {
220 220 global $CFG;
221   - require_once('locallib.php');
  221 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
222 222 require_once("$CFG->libdir/gradelib.php");
223 223 $grades = grade_get_grades($course->id, 'mod', 'scorm', $scorm->id, $user->id);
224 224 if (!empty($grades->items[0]->grades)) {
@@ -244,7 +244,7 @@ function scorm_user_outline($course, $user, $mod, $scorm) {
244 244 function scorm_user_complete($course, $user, $mod, $scorm) {
245 245 global $CFG;
246 246 require_once("$CFG->libdir/gradelib.php");
247   - require_once("locallib.php");
  247 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
248 248
249 249 $liststyle = 'structlist';
250 250 $scormpixdir = $CFG->modpixpath.'/scorm/pix';
@@ -391,7 +391,7 @@ function scorm_cron () {
391 391
392 392 global $CFG;
393 393
394   - require_once('locallib.php');
  394 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
395 395
396 396 $sitetimezone = $CFG->timezone;
397 397 /// Now see if there are any digest mails waiting to be sent, and if we should send them
@@ -429,7 +429,7 @@ function scorm_cron () {
429 429 */
430 430 function scorm_get_user_grades($scorm, $userid=0) {
431 431 global $CFG;
432   - require_once('locallib.php');
  432 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
433 433
434 434 $grades = array();
435 435 if (empty($userid)) {
@@ -664,4 +664,4 @@ function scorm_is_moddata_trusted() {
664 664 return true;
665 665 }
666 666
667   -?>
  667 +?>
2  mod/scorm/loadSCO.php
... ... @@ -1,6 +1,6 @@
1 1 <?php // $Id$
2 2 require_once('../../config.php');
3   - require_once('locallib.php');
  3 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
4 4
5 5 $id = optional_param('id', '', PARAM_INT); // Course Module ID, or
6 6 $a = optional_param('a', '', PARAM_INT); // scorm ID
3  mod/scorm/locallib.php
@@ -297,6 +297,7 @@ function scorm_get_scoes($id,$organisation=false) {
297 297 }
298 298
299 299 function scorm_insert_track($userid,$scormid,$scoid,$attempt,$element,$value) {
  300 + global $CFG;
300 301 $id = null;
301 302 if ($track = get_record_select('scorm_scoes_track',"userid='$userid' AND scormid='$scormid' AND scoid='$scoid' AND attempt='$attempt' AND element='$element'")) {
302 303 if ($element != 'x.start.time' ) { //don't update x.start.time - keep the original value.
@@ -319,7 +320,7 @@ function scorm_insert_track($userid,$scormid,$scoid,$attempt,$element,$value) {
319 320 (($element == 'cmi.core.lesson_status' || $element == 'cmi.completion_status') && ($track->value == 'completed' || $track->value == 'passed'))) {
320 321 $scorm = get_record('scorm', 'id', $scormid);
321 322 $grademethod = $scorm->grademethod % 10;
322   - include_once('lib.php');
  323 + include_once($CFG->dirroot.'/mod/scorm/lib.php');
323 324 scorm_update_grades($scorm, $userid);
324 325 }
325 326
2  mod/scorm/player.php
@@ -3,7 +3,7 @@
3 3 /// This page prints a particular instance of aicc/scorm package
4 4
5 5 require_once('../../config.php');
6   - require_once('locallib.php');
  6 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
7 7
8 8 //
9 9 // Checkin' script parameters
2  mod/scorm/view.php
... ... @@ -1,7 +1,7 @@
1 1 <?php // $Id$
2 2
3 3 require_once("../../config.php");
4   - require_once('locallib.php');
  4 + require_once($CFG->dirroot.'/mod/scorm/locallib.php');
5 5
6 6 $id = optional_param('id', '', PARAM_INT); // Course Module ID, or
7 7 $a = optional_param('a', '', PARAM_INT); // scorm ID

0 comments on commit 1f992ca

Please sign in to comment.
Something went wrong with that request. Please try again.