kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Next stays enabled in a learner quiz with no questions

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

  • Next is disabled by questionNumber === questionsTotal - 1. With an empty assessment_item_ids, questionsTotal - 1 is -1, so Next stays enabled at question 0.
  • Pressing it moves to question index 1, which has no item.
  • Sites:
    • https://github.com/learningequality/kolibri/blob/886a0c9f24da6f6d5163d2879826170fcd2bbf00/kolibri/plugins/learn/frontend/views/QuizRenderer/index.vue#L77
    • https://github.com/learningequality/kolibri/blob/886a0c9f24da6f6d5163d2879826170fcd2bbf00/kolibri/plugins/learn/frontend/views/courses/QuizRenderer/index.vue#L78
    • https://github.com/learningequality/kolibri/blob/886a0c9f24da6f6d5163d2879826170fcd2bbf00/kolibri/plugins/learn/frontend/views/courses/PrePostTestRenderer/index.vue#L84

Expected behavior

  • Next is disabled when there is no later question, including when there are no questions.

Steps to reproduce

  1. Render QuizRenderer with assessmentmetadata: { assessment_item_ids: [] }.
  2. Next is enabled.

Context

  • develop at 886a0c9f24.

Acceptance Criteria

  • [ ] In practice quizzes, surveys, course quizzes and course pre/post tests, Next is disabled when the item list is empty.
  • [ ] Specs cover the empty case in each renderer.

AI usage

Claude Code found this while working on #15980 and drafted the issue; rtibbles assigned that task.

rtibblesbot avatar Nov 22 '26 05:11 rtibblesbot