Browse files

MDL-38678 SCORM: Runtime Environment (RTE) checks not required in cas…

…e of SCO Assets
  • Loading branch information...
1 parent b3661ab commit 5ecd13bc669a2d32808f7a4ea522f4f221ab37b1 @scara scara committed Mar 24, 2013
Showing with 19 additions and 3 deletions.
  1. +8 −0 mod/scorm/datamodels/debug.js.php
  2. +11 −3 mod/scorm/loadSCO.php
View
8 mod/scorm/datamodels/debug.js.php
@@ -737,6 +737,14 @@ function LogAPICall(func, nam, val, rc) {
}
s += ' => ' + String(rc);
AppendToLog(s, rc);
+<?php
+if (scorm_debugging($scorm) && ($sco->scormtype == 'asset')) {
+?>
+ hint = 'Item <?php echo $sco->identifier; ?> has been defined as an Asset: it should never call the SCORM API';
+ AppendToLog(hint, 101);
+<?php
+}
+?>
}
View
14 mod/scorm/loadSCO.php
@@ -161,11 +161,19 @@
add_to_log($course->id, 'scorm', 'launch', 'view.php?id='.$cm->id, $result, $cm->id);
-// which API are we looking for
-$LMS_api = (scorm_version_check($scorm->version, SCORM_12) || empty($scorm->version)) ? 'API' : 'API_1484_11';
-
header('Content-Type: text/html; charset=UTF-8');
+if ($sco->scormtype == 'asset') {
+ // HTTP 302 Found => Moved Temporarily.
+ header('Location: ' . $result);
+ // Provide a short feedback in case of slow network connection.
+ echo '<html><body><p>' . get_string('activitypleasewait', 'scorm'). '</p></body></html>';
+ exit;
+}
+
+// We expect a SCO: select which API are we looking for.
+$LMS_api = (scorm_version_check($scorm->version, SCORM_12) || empty($scorm->version)) ? 'API' : 'API_1484_11';
+
?>
<html>
<head>

0 comments on commit 5ecd13b

Please sign in to comment.