I've noticed that the assessment:complete* event only gets fired if the assessment extension's _postTotalScoreToLms flag is set to true. This creates quite a tight coupling between the Assessment and Spoor extensions. (If anything, Spoor should have this config and only listen for this event if it's true.)
The Assessment should raise this event regardless of any flag.
(* The event name is bit of a misnomer, but is used to indicate when _all_ assessments have been completed.)
just thinking about your comment in #1700 I wonder if this event would be better named something like assessment:attemptcomplete thereby allowing for the possibility that the user has done the assessment but not actually passed or used up all their attempts.
I think we should definitely rename it. The assessment:complete/assessments:complete thing has bugged me for some time.
I'm ok with assessment:attemptcomplete (or assessment:finish).
The issue of _postTotalScoreToLms controlling whether the assessment completion event is fired definitely needs to be resolved. You may configure a course not to post the score (maybe because you're using the score field for something else such as a progress percentage) and for completion to be contingent on passing the assessment. At the moment you can't do this.
You may configure a course not to post the score (maybe because you're using the score field for something else such as a progress percentage) and for completion to be contingent on passing the assessment. At the moment you can't do this.
Unless I'm missing something, you could do this by setting _spoor._tracking._shouldSubmitScore to false - but having said that I definitely agree that _postTotalScoreToLms needs sorting out... I think it can probably just be removed altogether?
@brian-learningpool I'm liking your event segregation
assessment:initialize
assessment:attempt:* // assessment instance
assessment:attempt:start
assessment:attempt:reset
assessment:attempt:complete
assessment:attempt:failed
assessment:attempt:passed
assessment:complete // all assessments
@oliverfoster, I think that is a sensible approach for sure. For a version we could still trigger the historic assessments:complete event but log deprecated warning.
In v3 now we do actually have the tracking:complete event also: https://github.com/adaptlearning/adapt_framework/blob/master/src/core/js/tracking.js#L52
could someone set up a separate issue for changing the events?