MDL-33755 mod/scorm: directview scorm activity

Enable direct view of scorm activity from the course
overview page

Conflicts:

	mod/scorm/view.js
This commit is contained in:
Piers Harding 2012-06-15 11:34:34 +12:00 committed by Dan Marsden
parent 02ed0df5ae
commit 35cfa9e62c
4 changed files with 52 additions and 7 deletions

View file

@ -59,9 +59,32 @@ if (!empty($forcejs)) {
require_login($course, false, $cm);
if (!empty($scorm->popup)) {
$PAGE->requires->data_for_js('scormplayerdata', Array('cwidth'=>$scorm->width,
'cheight'=>$scorm->height,
'popupoptions' => $scorm->options), true);
$launch = 0;
$orgidentifier = '';
$scoid = 0;
if ($scorm->skipview >= 1) {
// do we launch immediately and redirect the parent back ?
if ($scorm->skipview == 2 || (scorm_get_tracks($scoes[0]->id, $USER->id) === false)) {
$orgidentifier = '';
if ($sco = scorm_get_sco($scorm->launch, SCO_ONLY)) {
if (($sco->organization == '') && ($sco->launch == '')) {
$orgidentifier = $sco->identifier;
} else {
$orgidentifier = $sco->organization;
}
$scoid = $sco->id;
}
$launch = $scorm->skipview;
}
}
$PAGE->requires->data_for_js('scormplayerdata', Array('launch' => $launch,
'currentorg' => $orgidentifier,
'sco' => $scoid,
'scorm' => $scorm->id,
'courseid' => $scorm->course,
'cwidth' => $scorm->width,
'cheight' => $scorm->height,
'popupoptions' => $scorm->options), true);
$PAGE->requires->js('/mod/scorm/view.js', true);
}