kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

A rejected quiz answer save is silent and stops every later save in the session

Open rtibblesbot opened this issue 1 week ago • 0 comments

❌ 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

  • useProgressTracking chains each save on savingPromise. 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 pastattempts and 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, goToQuestion discards the promise from saveAnswer(). Next, Previous and a question-list jump show nothing when the save is rejected.
  • finishExam has no rejection handler and submitting is never reset, so a rejected Submit leaves KCircularLoader in 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

  1. Call initContentSession from useProgressTracking for a quiz.
  2. Reject one updateContentSession({ interaction, immediate: true }) PUT with HTTP 400.
  3. Call updateContentSession with a second interaction, then with { progress: 1, force: true, immediate: true }.
  4. Both promises reject and no PUT is sent.

Context

  • develop at 758605b764.
  • #15980 changes the same three renderers and their specs; the time_spent fix changes saveAnswer beside goToQuestion in each.
  • Open PR #15915 (release-v0.20.x) changes useProgressTracking.js and adds a rejection handler to PrePostTestRenderer's save that emits saveRejected.
  • The update PUT is not idempotent: progress_delta and time_spent_delta add 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 updateContentSession call 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 finished is 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 ContentPage and CourseContentViewer.

AI usage

rtibbles moved this out of #15980 and asked for a follow-up issue. Claude Code drafted it from the code on develop.

rtibblesbot avatar Nov 25 '26 07:11 rtibblesbot