MDL-38489 SCORM: obtain correct section number when getting course_url

This commit is contained in:
Dan Marsden
2013-09-19 09:36:52 +12:00
parent b98dcd7dd6
commit d6d0c4e00b
+3 -3
View File
@@ -23,7 +23,7 @@ $organization = optional_param('organization', '', PARAM_INT); // organization I
$action = optional_param('action', '', PARAM_ALPHA);
if (!empty($id)) {
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
if (! $cm = get_coursemodule_from_id('scorm', $id, 0, true)) {
print_error('invalidcoursemodule');
}
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
@@ -39,7 +39,7 @@ if (!empty($id)) {
if (! $course = $DB->get_record("course", array("id"=>$scorm->course))) {
print_error('coursemisconf');
}
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id, true)) {
print_error('invalidcoursemodule');
}
} else {
@@ -88,7 +88,7 @@ if (!empty($scorm->popup)) {
$courseformat = course_get_format($course)->get_course();
$sectionid = '';
if (isset($courseformat->coursedisplay) && $courseformat->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
$sectionid = $cm->section;
$sectionid = $cm->sectionnum;
}
$PAGE->requires->data_for_js('scormplayerdata', Array('launch' => $launch,