Skip to content

Commit

Permalink
Fix: on reset check if navigating from a different contentObject (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-allen-89 committed Oct 3, 2024
1 parent 5179537 commit 5de3adf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/adapt-assessmentArticleModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,11 +607,13 @@ const AssessmentModel = {
this._forceResetOnRevisit = false;

const isPageReload = this._checkReloadPage();
const isNavigating = this.get('_parentId') !== location._currentId;

// stop resetting if not complete or not allowed
if (this.get('_assessmentCompleteInSession') &&
!assessmentConfig._isResetOnRevisit &&
!isPageReload &&
!isNavigating &&
!force) {
// eslint-disable-next-line n/no-callback-literal
if (typeof callback === 'function') callback(false);
Expand All @@ -638,6 +640,8 @@ const AssessmentModel = {
return false;
}

if (isNavigating) this._forceResetOnRevisit = true;

if (!isPageReload) {
this._setupAssessmentData(force);
// eslint-disable-next-line n/no-callback-literal
Expand Down

0 comments on commit 5de3adf

Please sign in to comment.