mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-38489 SCORM: use course_get_format to obtain info
This commit is contained in:
parent
011ae52a91
commit
b98dcd7dd6
2 changed files with 5 additions and 14 deletions
|
@ -4,14 +4,12 @@ M.mod_scormform.init = function(Y) {
|
|||
var cwidth = scormplayerdata.cwidth;
|
||||
var cheight = scormplayerdata.cheight;
|
||||
var poptions = scormplayerdata.popupoptions;
|
||||
var courseid = scormplayerdata.courseid;
|
||||
var sectionid = scormplayerdata.sectionid;
|
||||
var launch = scormplayerdata.launch;
|
||||
var currentorg = scormplayerdata.currentorg;
|
||||
var sco = scormplayerdata.sco;
|
||||
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 course_url = M.cfg.wwwroot+"/course/view.php?id="+courseid+"§ionid="+sectionid+"&sesskey="+M.cfg.sesskey;
|
||||
var course_url = scormplayerdata.courseurl;
|
||||
|
||||
if ((cwidth==100) && (cheight==100)) {
|
||||
poptions = poptions+',width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=0';
|
||||
|
|
|
@ -83,26 +83,19 @@ if (!empty($scorm->popup)) {
|
|||
$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.
|
||||
$courseformat = course_get_format($course)->get_course();
|
||||
$sectionid = '';
|
||||
if (isset($courseformat->coursedisplay) && $courseformat->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
|
||||
$sectionid = $cm->section;
|
||||
} else {
|
||||
$sectionid = '';
|
||||
}
|
||||
|
||||
$PAGE->requires->data_for_js('scormplayerdata', Array('launch' => $launch,
|
||||
'currentorg' => $orgidentifier,
|
||||
'sco' => $scoid,
|
||||
'scorm' => $scorm->id,
|
||||
'courseid' => $scorm->course,
|
||||
'sectionid' => $sectionid,
|
||||
'courseurl' => course_get_url($course, $sectionid)->out(false),
|
||||
'cwidth' => $scorm->width,
|
||||
'cheight' => $scorm->height,
|
||||
'popupoptions' => $scorm->options), true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue