Skip to content

Commit 389a431

Browse files
author
David Monllao
committed
Merge branch 'm34_MDL-58015' of https://github.com/danmarsden/moodle into MOODLE_34_STABLE
2 parents 09fd0f4 + f3a4d3f commit 389a431

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

mod/scorm/view.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,22 @@
6666

6767
$launch = false; // Does this automatically trigger a launch based on skipview.
6868
if (!empty($scorm->popup)) {
69-
$orgidentifier = '';
70-
7169
$scoid = 0;
7270
$orgidentifier = '';
7371

7472
$result = scorm_get_toc($USER, $scorm, $cm->id, TOCFULLURL);
7573
// Set last incomplete sco to launch first.
7674
if (!empty($result->sco->id)) {
77-
$scoid = $result->sco->id;
75+
$sco = $result->sco;
7876
} else {
79-
if ($sco = scorm_get_sco($scorm->launch, SCO_ONLY)) {
80-
if (($sco->organization == '') && ($sco->launch == '')) {
81-
$orgidentifier = $sco->identifier;
82-
} else {
83-
$orgidentifier = $sco->organization;
84-
}
85-
$scoid = $sco->id;
77+
$sco = scorm_get_sco($scorm->launch, SCO_ONLY);
78+
}
79+
if (!empty($sco)) {
80+
$scoid = $sco->id;
81+
if (($sco->organization == '') && ($sco->launch == '')) {
82+
$orgidentifier = $sco->identifier;
83+
} else {
84+
$orgidentifier = $sco->organization;
8685
}
8786
}
8887

0 commit comments

Comments
 (0)