kolibri
kolibri copied to clipboard
Learner quiz stays on the loader when the link's question index is negative, fractional or not a number
❌ 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
showExamreads the index withNumber(params.questionNumber)and rejects it only when it is>=the question count: https://github.com/learningequality/kolibri/blob/758605b764b04d41d5270165cab714ddd441b78a/kolibri/plugins/learn/frontend/modules/examViewer/handlers.js#L13 and https://github.com/learningequality/kolibri/blob/758605b764b04d41d5270165cab714ddd441b78a/kolibri/plugins/learn/frontend/modules/examViewer/handlers.js#L65-1,0.5andabcpass that check and are committed to the store.ExamPagefinds no question at that index and rendersKCircularLoaderwith no error: https://github.com/learningequality/kolibri/blob/758605b764b04d41d5270165cab714ddd441b78a/kolibri/plugins/learn/frontend/views/ExamPage/index.vue#L8
Expected behavior
- An index that names no question shows the same error as one past the end of the quiz:
Question number … is not valid for this quiz.
Steps to reproduce
- As a learner, open a quiz from Learn > Home.
- Replace the last URL segment with
-1,0.5orabcand reload. - The loader never ends.
Context
- develop at
758605b764. - Route:
/classes/:classId/exam/:examId/:questionNumber. - #15987 changes the same
showExampromise chain; #15980 createsExamPage.spec.js.
Acceptance Criteria
- [ ] Opening a quiz with index
-1,0.5orabcends loading and shows the invalid-question error. - [ ] Opening a quiz with an in-range integer index, including
0, opens that question as on develop. - [ ]
ExamPage.spec.jscovers each index above through the route handler.
AI usage
Claude Code found this while working on #15980 and drafted the issue; rtibbles kept #15980 to focus handling.