Merge branch 'MDL-35870' of git://github.com/nobelium/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2014-07-16 09:04:55 +02:00
commit 9a363a1cd2

View File

@ -66,22 +66,24 @@ $contextmodule = context_module::instance($cm->id);
$launch = false; // Does this automatically trigger a launch based on skipview. $launch = false; // Does this automatically trigger a launch based on skipview.
if (!empty($scorm->popup)) { if (!empty($scorm->popup)) {
$orgidentifier = ''; $orgidentifier = '';
$scoid = 0; $scoid = 0;
$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;
}
if (empty($preventskip) && $scorm->skipview >= SCORM_SKIPVIEW_FIRST && if (empty($preventskip) && $scorm->skipview >= SCORM_SKIPVIEW_FIRST &&
has_capability('mod/scorm:skipview', $contextmodule) && has_capability('mod/scorm:skipview', $contextmodule) &&
!has_capability('mod/scorm:viewreport', $contextmodule)) { // Don't skip users with the capability to view reports. !has_capability('mod/scorm:viewreport', $contextmodule)) { // Don't skip users with the capability to view reports.
// do we launch immediately and redirect the parent back ? // do we launch immediately and redirect the parent back ?
if ($scorm->skipview == SCORM_SKIPVIEW_ALWAYS || !scorm_has_tracks($scorm->id, $USER->id)) { if ($scorm->skipview == SCORM_SKIPVIEW_ALWAYS || !scorm_has_tracks($scorm->id, $USER->id)) {
$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 = true; $launch = true;
} }
} }
@ -97,7 +99,6 @@ if (!empty($scorm->popup)) {
} else { } else {
$courseurl = course_get_url($course, $sectionid)->out(false); $courseurl = course_get_url($course, $sectionid)->out(false);
} }
$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,