MDL-35870 mod_scorm : fix for debug.js.php not found error
authorNobelium <me@vignesh.info>
Tue, 15 Jul 2014 16:05:40 +0000 (16:05 +0000)
committerNobelium <me@vignesh.info>
Tue, 15 Jul 2014 16:05:40 +0000 (16:05 +0000)
mod/scorm/datamodels/debug.js.php
mod/scorm/datamodels/scorm_12.php
mod/scorm/datamodels/scorm_13.php

index 9011ab9..771ef76 100644 (file)
@@ -14,6 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
+echo html_writer::start_tag('script');
 ?>
 
 <!--// hopefully fool ie IE proof way of getting DOM element
@@ -70,7 +71,7 @@ function toggleLog () {
     if (getLoggingActive() == "A") {
         AppendToLog("Moodle Logging Deactivated", 0);
         setLoggingActive('N');
-        logButton.innerHTML = '--><?php echo addslashes_js(get_string('scormloggingoff', 'scorm')); ?>';
+        logButton.innerHTML = '-><?php echo addslashes_js(get_string('scormloggingoff', 'scorm')); ?>';
     } else {
         setLoggingActive('A');
         AppendToLog("Moodle Logging Activated", 0);
@@ -762,3 +763,7 @@ if (!document.getElementById('mod-scorm-log-toggle')) {
     var content = safeGetElement(document, 'scormpage');
     content.insertBefore(logButton, content.firstChild);
 }
+-->
+
+<?php
+echo html_writer::end_tag('script');
index 189c95e..187fd62 100644 (file)
@@ -43,6 +43,6 @@ $PAGE->requires->js_init_call('M.scorm_api.init', array($def, $cmiobj, $cmiint,
 
 // pull in the debugging utilities
 if (scorm_debugging($scorm)) {
-    $PAGE->requires->js($CFG->dirroot.'/mod/scorm/datamodels/debug.js.php', true);
+    require_once($CFG->dirroot.'/mod/scorm/datamodels/debug.js.php');
     echo html_writer::script('AppendToLog("Moodle SCORM 1.2 API Loaded, Activity: '.$scorm->name.', SCO: '.$sco->identifier.'", 0);');
 }
\ No newline at end of file
index fbc76ed..e8a4f6d 100644 (file)
@@ -36,6 +36,6 @@ $PAGE->requires->js_init_call('M.scorm_api.init', array($def, $cmiobj, $cmiint,
 
 // pull in the debugging utilities
 if (scorm_debugging($scorm)) {
-    $PAGE->requires->js($CFG->dirroot.'/mod/scorm/datamodels/debug.js.php', true);
+    require_once($CFG->dirroot.'/mod/scorm/datamodels/debug.js.php');
     echo html_writer::script('AppendToLog("Moodle SCORM 1.3 API Loaded, Activity: '.$scorm->name.', SCO: '.$sco->identifier.'", 0);');
 }