kolibri
kolibri copied to clipboard
A rejected quiz answer save is silent and stops every later save in the session
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Target branch: develop
Observed behavior
useProgressTrackingchains each save onsavingPromise. After one save is rejected, the chain stays rejected and no later save in that session sends a request: https://github.com/learningequality/kolibri/blob/758605b764b04d41d5270165cab714ddd441b78a/kolibri/plugins/learn/frontend/composables/useProgressTracking.js#L464- The rejected answer is already in
pastattemptsand was cleared from the unsaved state before the request (loggingSaving, https://github.com/learningequality/kolibri/blob/758605b764b04d41d5270165cab714ddd441b78a/kolibri/plugins/learn/frontend/composables/useProgressTracking.js#L412), so the question list shows it as answered. - In practice quizzes, surveys, course quizzes and course pre/post tests,
goToQuestiondiscards the promise fromsaveAnswer(). Next, Previous and a question-list jump show nothing when the save is rejected. finishExamhas no rejection handler andsubmittingis never reset, so a rejected Submit leavesKCircularLoaderin place of the quiz.- Sites:
- https://github.com/learningequality/kolibri/blob/758605b764b04d41d5270165cab714ddd441b78a/kolibri/plugins/learn/frontend/views/QuizRenderer/index.vue#L443-L460
- https://github.com/learningequality/kolibri/blob/758605b764b04d41d5270165cab714ddd441b78a/kolibri/plugins/learn/frontend/views/courses/QuizRenderer/index.vue#L388-L405
- https://github.com/learningequality/kolibri/blob/758605b764b04d41d5270165cab714ddd441b78a/kolibri/plugins/learn/frontend/views/courses/PrePostTestRenderer/index.vue#L424-L441
Expected behavior
- A learner is told when an answer or a submission is not saved, and saving carries on for the rest of the session.
User-facing consequences
- A learner who answers the rest of a quiz after one rejected save loses every later answer, and Submit shows a loader that never ends.
Steps to reproduce
- Call
initContentSessionfromuseProgressTrackingfor a quiz. - Reject one
updateContentSession({ interaction, immediate: true })PUT with HTTP 400. - Call
updateContentSessionwith a second interaction, then with{ progress: 1, force: true, immediate: true }. - Both promises reject and no PUT is sent.
Context
- develop at
758605b764. - #15980 changes the same three renderers and their specs; the
time_spentfix changessaveAnswerbesidegoToQuestionin each. - Open PR #15915 (release-v0.20.x) changes
useProgressTracking.jsand adds a rejection handler toPrePostTestRenderer's save that emitssaveRejected. - The update PUT is not idempotent:
progress_deltaandtime_spent_deltaadd on each request. rtibbles has not yet chosen whether a save whose response is lost is resent; the options are in https://github.com/learningequality/kolibri/issues/15980#issuecomment-7125415822.
Acceptance Criteria
- [ ] After a rejected save, a later
updateContentSessioncall in the same session sends its PUT. - [ ] In practice quizzes, surveys, course quizzes and course pre/post tests, a rejected save on Next, Previous or a question-list jump shows the learner a "Changes not saved" message.
- [ ] After a rejected Submit the loader ends, the learner can submit again, and
finishedis not emitted until a completion save succeeds. - [ ] A save rejected for one session is never sent to another session.
- [ ] Against a server that answers every save with 503, the number of PUTs per minute is no higher than on develop.
- [ ] Specs cover each criterion through
ContentPageandCourseContentViewer.
AI usage
rtibbles moved this out of #15980 and asked for a follow-up issue. Claude Code drafted it from the code on develop.