Breaking: Upgrade to version 2 of scoring (fixes #21)#22
Breaking: Upgrade to version 2 of scoring (fixes #21)#22oliverfoster wants to merge 13 commits intomasterfrom
Conversation
Resolved an issue where a second assessment attempt failed to trigger completion. This occurred because `Attempt.isInSession` was reset when `LifecycleRenderer` called `onStart` after `onVisit` following an assessment reset. Moved `isInSession` logic into `AssessmentSet`, as it represents navigation state rather than attempt-specific state. Also removed an unnecessary condition in the Attempts `reset` method that incorrectly set `_history` to an `Attempt`, which was unreachable due to required config.
…Percent` and `resetType` (fixes #24).
…ter()` takes no arguments.
| async onRestore() { | ||
| const restored = this.state.restore(); | ||
| if (!restored) return false; | ||
| triggerCompatibleRestored(this); | ||
| await super.onRestore(); | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Previous assessment versions triggered the relevant events regardless of the restoration state. It doesn't look like this is needed based on the listeners in adaptlearning plugins. Should we at least make triggerCompatibleRestored fire regardless for backwards compatibility?
Should https://github.com/adaptlearning/adapt-contrib-scoring/blob/b93a07662792526ddf5095848a05b2b045c1d77a/js/ScoringSet.js#L371-L372 execute regardless of restored state? I don't think it matters as onUpdate will not trigger completion at this point.
There was a problem hiding this comment.
Yup. If that's how it was.
… may not be consistent based on conditional content such as branching or banking. This is also needed for the changes made in 20dcb0b. Fixed potential issues due to the incorrect logical operators.
| async onVisit() { | ||
| this._isInSession = true; | ||
| if (this.attempt.isInProgress) return; | ||
| if (this._isInReset) return; |
There was a problem hiding this comment.
Is it actually possible for the set to already be in a reset phase at this point with the way the LifeCycleRenderer works?
There was a problem hiding this comment.
I don't know.
Is it not code brought over from the assessment results "try again" button, where the assessment page refreshes to rerender the assessment from the start?
… with super class methods not always being called for `onInit` and `onRestore`. Updated to latest Lifecycle logic to distinguish between first attempt and reset attempts.
fixes #21
requires adaptlearning/adapt-contrib-scoring#30
Breaking
Stateto help save and restore to offline storageLifecycleSetintegrated lifecycle functionsrawModelsandmodelstomodelsandavailableModelswhere relevant