MOBILE-2600 scorm: Support always force new attempt
parent
3f8f67ee9a
commit
8127c500c9
|
@ -207,7 +207,9 @@ export class AddonModScormIndexComponent extends CoreCourseModuleMainActivityCom
|
||||||
this.scorm.numAttempts = this.attempts.total;
|
this.scorm.numAttempts = this.attempts.total;
|
||||||
this.scorm.gradeMethodReadable = this.scormProvider.getScormGradeMethod(this.scorm);
|
this.scorm.gradeMethodReadable = this.scormProvider.getScormGradeMethod(this.scorm);
|
||||||
this.scorm.attemptsLeft = this.scormProvider.countAttemptsLeft(this.scorm, this.attempts.lastAttempt.number);
|
this.scorm.attemptsLeft = this.scormProvider.countAttemptsLeft(this.scorm, this.attempts.lastAttempt.number);
|
||||||
if (this.scorm.forceattempt && this.scorm.incomplete) {
|
|
||||||
|
if (this.scorm.forcenewattempt == AddonModScormProvider.SCORM_FORCEATTEMPT_ALWAYS ||
|
||||||
|
(this.scorm.forcenewattempt && !this.scorm.incomplete)) {
|
||||||
this.scormOptions.newAttempt = true;
|
this.scormOptions.newAttempt = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,10 @@ export class AddonModScormProvider {
|
||||||
static MODENORMAL = 'normal';
|
static MODENORMAL = 'normal';
|
||||||
static MODEREVIEW = 'review';
|
static MODEREVIEW = 'review';
|
||||||
|
|
||||||
|
static SCORM_FORCEATTEMPT_NO = 0;
|
||||||
|
static SCORM_FORCEATTEMPT_ONCOMPLETE = 1;
|
||||||
|
static SCORM_FORCEATTEMPT_ALWAYS = 2;
|
||||||
|
|
||||||
// Events.
|
// Events.
|
||||||
static LAUNCH_NEXT_SCO_EVENT = 'addon_mod_scorm_launch_next_sco';
|
static LAUNCH_NEXT_SCO_EVENT = 'addon_mod_scorm_launch_next_sco';
|
||||||
static LAUNCH_PREV_SCO_EVENT = 'addon_mod_scorm_launch_prev_sco';
|
static LAUNCH_PREV_SCO_EVENT = 'addon_mod_scorm_launch_prev_sco';
|
||||||
|
@ -233,6 +237,15 @@ export class AddonModScormProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scorm.forcenewattempt == AddonModScormProvider.SCORM_FORCEATTEMPT_ALWAYS) {
|
||||||
|
// This SCORM is configured to force a new attempt on every re-entry.
|
||||||
|
return {
|
||||||
|
mode: AddonModScormProvider.MODENORMAL,
|
||||||
|
attempt: attempt + 1,
|
||||||
|
newAttempt: true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Validate user request to start a new attempt.
|
// Validate user request to start a new attempt.
|
||||||
if (attempt == 0) {
|
if (attempt == 0) {
|
||||||
newAttempt = true;
|
newAttempt = true;
|
||||||
|
|
Loading…
Reference in New Issue