Moodle 3.5.9+ (Build: 20191122) の /mod/scorm/locallib.php の関数「scorm_simple_play()」内の1067行目あたりを読みます限り、SCORMモジュールの設定画面で「新しい受験を強制する」が「常に」(SCORM_FORCEATTEMPT_ALWAYS) に設定されていない場合、最終のSCOのレッスンステータスが「incomplete」とされるようです。
function scorm_simple_play($scorm, $user, $context, $cmid) {
global $DB;
$result = false;
if (has_capability('mod/scorm:viewreport', $context)) {
// If this user can view reports, don't skipview so they can see links to reports.
return $result;
}
if ($scorm->updatefreq == SCORM_UPDATE_EVERYTIME) {
scorm_parse($scorm, false);
}
$scoes = $DB->get_records_select('scorm_scoes', 'scorm = ? AND '.
$DB->sql_isnotempty('scorm_scoes', 'launch', false, true), array($scorm->id), 'sortorder, id', 'id');
if ($scoes) {
$orgidentifier = '';
if ($sco = scorm_get_sco($scorm->launch, SCO_ONLY)) {
if (($sco->organization == '') && ($sco->launch == '')) {
$orgidentifier = $sco->identifier;
} else {
$orgidentifier = $sco->organization;
}
}
if ($scorm->skipview >= SCORM_SKIPVIEW_FIRST) {
$sco = current($scoes);
$result = scorm_get_toc($user, $scorm, $cmid, TOCFULLURL, $orgidentifier);
$url = new moodle_url('/mod/scorm/player.php', array('a' => $scorm->id, 'currentorg' => $orgidentifier));
// Set last incomplete sco to launch first if forcenewattempt not set to always.
if (!empty($result->sco->id) && $scorm->forcenewattempt != SCORM_FORCEATTEMPT_ALWAYS) {
$url->param('scoid', $result->sco->id);
} else {
$url->param('scoid', $sco->id);
}
if ($scorm->skipview == SCORM_SKIPVIEW_ALWAYS || !scorm_has_tracks($scorm->id, $user->id)) {
if ($scorm->forcenewattempt == SCORM_FORCEATTEMPT_ALWAYS ||
($result->incomplete === false && $scorm->forcenewattempt == SCORM_FORCEATTEMPT_ONCOMPLETE)) {
$url->param('newattempt', 'on');
}
redirect($url);
}
}
}
return $result;
}