diff --git a/mod/scorm/api1_2.php b/mod/scorm/api1_2.php index 25231d1f8ce..34dae806db7 100644 --- a/mod/scorm/api1_2.php +++ b/mod/scorm/api1_2.php @@ -119,6 +119,12 @@ function SCORMapi() { if ((parseFloat(value,10)).toString() != value) { errorCode = 405; return "false"; + } else { + rawvalue = parseFloat(value,10); + if ((rawvalue<0) || (rawvalue>100)) { + errorCode = 405; + return "false"; + } } eval(param+'="'+value+'";'); errorCode = 0; @@ -278,27 +284,3 @@ function SCORMapi() { } var API = new SCORMapi(); - -function SCOInitialize() { -previous || $first) { - print "\ttop.nav.document.navform.prev.disabled = true;\n"; - print "\ttop.nav.document.navform.prev.style.display = 'none';\n"; - } - if ( $sco->next || $last) { - print "\ttop.nav.document.navform.next.disabled = true;\n"; - print "\ttop.nav.document.navform.next.style.display = 'none';\n"; - } -?> - top.main.location=""; -} - -function changeSco(direction) { - if (direction == "prev") - top.nav.document.navform.scoid.value=""; - else - top.nav.document.navform.scoid.value=""; - - //alert ("Prev: \nNext: \nNew SCO: "+top.nav.document.navform.scoid.value); - top.nav.document.navform.submit(); -} diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index 7adc519abc3..111d2a8a248 100755 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -4,9 +4,7 @@ /// (replace scorm with the name of your module and delete this line) -$scorm_CONSTANT = 7; /// for example -$SCORM_TOP_FRAME_SIZE = 120; -$SCORM_LEFT_FRAME_SIZE = 210; +$SCORM_FRAME_SIZE = 140; function scorm_add_instance($scorm) { /// Given an object containing all the necessary data, @@ -175,12 +173,13 @@ function scorm_randstring($len = "8") function scorm_mkdirs($strPath) { + global $CFG; if (is_dir($strPath)) return true; $pStrPath = dirname($strPath); if (!scorm_mkdirs($pStrPath)) return false; - return mkdir($strPath); + return mkdir($strPath, $CFG->directorypermissions); } function scorm_datadir($strPath, $existingdir="", $prefix = "SCORM") @@ -192,7 +191,7 @@ function scorm_datadir($strPath, $existingdir="", $prefix = "SCORM") do { $datadir="/".$prefix.scorm_randstring(); } while (file_exists($strPath.$datadir)); - mkdir($strPath.$datadir); + mkdir($strPath.$datadir, $CFG->directorypermissions); return $strPath.$datadir; } else { return false; diff --git a/mod/scorm/playscorm.php b/mod/scorm/playscorm.php index 4d5edecb0c7..83294be35ab 100755 --- a/mod/scorm/playscorm.php +++ b/mod/scorm/playscorm.php @@ -54,150 +54,65 @@ update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm)); notice(get_string("activityiscurrentlyhidden")); } - switch ($frameset) { - case "top": - add_to_log($course->id, "scorm", "view", "playscorm.php?id=$cm->id", "$scorm->id"); - // - // Print the page header - // - print_header($pagetitle, "$course->fullname", + if ($frameset) { + add_to_log($course->id, "scorm", "view", "playscorm.php?id=$cm->id", "$scorm->id"); + // + // Print the page header + // + print_header($pagetitle, "$course->fullname", "$navigation framename}\" href=\"view.php?id=$cm->id\" title=\"$scorm->summary\">$scorm->name", - "", "", true, update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm)); + "", "", true, update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm, '_top')); - echo "
| ".text_to_html($scorm->summary, true, false)." |