mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-38489 SCORM: added check for course display format
This commit is contained in:
parent
83f26f6407
commit
011ae52a91
@ -5,12 +5,13 @@ M.mod_scormform.init = function(Y) {
|
|||||||
var cheight = scormplayerdata.cheight;
|
var cheight = scormplayerdata.cheight;
|
||||||
var poptions = scormplayerdata.popupoptions;
|
var poptions = scormplayerdata.popupoptions;
|
||||||
var courseid = scormplayerdata.courseid;
|
var courseid = scormplayerdata.courseid;
|
||||||
|
var sectionid = scormplayerdata.sectionid;
|
||||||
var launch = scormplayerdata.launch;
|
var launch = scormplayerdata.launch;
|
||||||
var currentorg = scormplayerdata.currentorg;
|
var currentorg = scormplayerdata.currentorg;
|
||||||
var sco = scormplayerdata.sco;
|
var sco = scormplayerdata.sco;
|
||||||
var scorm = scormplayerdata.scorm;
|
var scorm = scormplayerdata.scorm;
|
||||||
var launch_url = M.cfg.wwwroot+"/mod/scorm/player.php?a="+scorm+"¤torg="+currentorg+"&scoid="+sco+"&sesskey="+M.cfg.sesskey;
|
var launch_url = M.cfg.wwwroot+"/mod/scorm/player.php?a="+scorm+"¤torg="+currentorg+"&scoid="+sco+"&sesskey="+M.cfg.sesskey;
|
||||||
var course_url = M.cfg.wwwroot+"/course/view.php?id="+courseid+"&sesskey="+M.cfg.sesskey;
|
var course_url = M.cfg.wwwroot+"/course/view.php?id="+courseid+"§ionid="+sectionid+"&sesskey="+M.cfg.sesskey;
|
||||||
|
|
||||||
if ((cwidth==100) && (cheight==100)) {
|
if ((cwidth==100) && (cheight==100)) {
|
||||||
poptions = poptions+',width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=0';
|
poptions = poptions+',width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=0';
|
||||||
|
@ -83,11 +83,26 @@ if (!empty($scorm->popup)) {
|
|||||||
$launch = true;
|
$launch = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Redirect back to the section with one section per page ?
|
||||||
|
if (! $coursedisplay = $DB->get_record('course_format_options', array('courseid'=>$scorm->course, 'name'=>'coursedisplay'))) {
|
||||||
|
print_error('courseformatnotfound', 'error', null, 'coursedisplay');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($coursedisplay->value == COURSE_DISPLAY_MULTIPAGE) {
|
||||||
|
// $cm->section references course_sections(id) NOT course_sections(section).
|
||||||
|
// Better to use this since this takes priority in course view.php.
|
||||||
|
$sectionid = $cm->section;
|
||||||
|
} else {
|
||||||
|
$sectionid = '';
|
||||||
|
}
|
||||||
|
|
||||||
$PAGE->requires->data_for_js('scormplayerdata', Array('launch' => $launch,
|
$PAGE->requires->data_for_js('scormplayerdata', Array('launch' => $launch,
|
||||||
'currentorg' => $orgidentifier,
|
'currentorg' => $orgidentifier,
|
||||||
'sco' => $scoid,
|
'sco' => $scoid,
|
||||||
'scorm' => $scorm->id,
|
'scorm' => $scorm->id,
|
||||||
'courseid' => $scorm->course,
|
'courseid' => $scorm->course,
|
||||||
|
'sectionid' => $sectionid,
|
||||||
'cwidth' => $scorm->width,
|
'cwidth' => $scorm->width,
|
||||||
'cheight' => $scorm->height,
|
'cheight' => $scorm->height,
|
||||||
'popupoptions' => $scorm->options), true);
|
'popupoptions' => $scorm->options), true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user