Course unit sidebar shows "Pre-test: Completed" to learners who never took the pre-test
❌ 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
In a course unit, the learner's sidebar always shows the pre-test row as "Completed" with a mastered star. This includes learners who never took the pre-test, for example because the coach ended it before they started.
Here the learner (Himing1953) never opened Unit 1's pre-test and has no pre-test mastery log. The post-test row correctly shows 0/4:
I saw the same for a second learner who skipped the pre-test and then took the post-test.
Cause
In kolibri/plugins/learn/frontend/views/CourseUnitView/UnitTreeAccordion/index.vue (L8–30), the pre-test TreeItem hard-codes :description="completedLabel$()" and the mastered icon. The post-test row at least varies its label and icon (isPostTestCompleted, postTestItemDescription), but it derives them from isUnitComplete and activeTest, not from the learner's own result either. UnitTreeAccordion receives only activeTest and isUnitComplete, so it currently has no data on whether this learner took the pre-test.
Expected behavior
The pre-test row reflects the learner's own result: "Completed" only if they submitted the pre-test, and a not-taken state otherwise, as the post-test row does with its 0/N count.
User-facing consequences
A learner who missed the pre-test is told they completed it. It's a small but misleading status in a new 0.20 feature. Coach reports aren't affected; they correctly show the learner with no pre-test score.
Steps to reproduce
- As a coach, assign a course with pre/post tests (e.g. "Bread Baking Basics" from the Kolibri QA Channel) to a class and make it visible. This starts Unit 1's pre-test.
- Have one learner take and submit the pre-test. Then, as the coach, end the pre-test.
- Sign in as a different learner in the class who didn't take it, and open the course (Resume course).
- In the unit sidebar, the pre-test shows "Completed" with a star.
Context
- Kolibri
developat 5b5c7dc4d7 (dev server) - macOS 26.6.2, Chromium
- Kolibri QA Channel, "Bread Baking Basics" course
Possible fixes, which I'd be glad to work on once the approach is agreed:
- Return the learner's own pre-test result for the unit from the backend. For example, extend
CourseSession.get_resume_data(which already checks per learner whether the active test was opened, via_test_opened) with whether this learner completed the unit's pre-test, and pass it toUnitTreeAccordion. - Fetch it on the frontend: look up the learner's pre-test mastery log for the unit (
mastery_criterion.test_type == "pre") when the unit view loads.
Either way, the not-taken state probably needs a label and icon. Reusing the post-test row's "0/N" pattern would avoid a new string, or there could be a new one such as "Not taken".
AI usage
I used Claude Code to test course pre/post tests and coach reports on my local Kolibri with several learners. It noticed the sidebar status, checked each learner's mastery logs, traced the label to UnitTreeAccordion, and drafted this issue. I checked the code reference and reproduced it in the UI.
@rtibblesbot please validate this issue.
Verdict: claim holds
Evidence: kolibri/plugins/learn/frontend/views/CourseUnitView/UnitTreeAccordion/index.vue:8-31 on develop at f72936bd41
- The pre-test
TreeItemsets:description="completedLabel$()"and a fixedmasteredicon, so every learner sees "Completed" with a star, whatever their result. CourseUnitView/index.vue:75-85passesUnitTreeAccordionno data on the learner's pre-test result.- Neither commit to
CourseUnitView/since 5b5c7dc4d7 (0aac4cc7ac, 5f6c87248b) changes the pre-test row. - One correction to the Cause section: the post-test row doesn't read the learner's result either.
isPostTestCompleted(index.vue:255-260) is true whenisUnitComplete(the unit is behind the learner's resume position) or when the post-test is the active test. A fix can't copy that logic to get a per-learner result. - No open issue, or issue closed in the last 30 days, reports this. #15195 and #15593 cover what coaches see for pre/post tests, not the learner's sidebar.
Changes
- Cause: replaced "Unlike the post-test row (…), it doesn't depend on the learner's own result" with a line saying the post-test row derives its state from
isUnitCompleteandactiveTest.isPostTestCompleted(UnitTreeAccordion/index.vue:255-260) never reads the learner's result, so the old line implied a per-learner pattern that doesn't exist.
Written by rtibblesbot, an LLM-based coding agent.
Hi, I'd like to take this issue. Could you assign it to me?
Hi! 👋
Thanks so much for your interest! This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. If there are no unassigned 'help wanted' issues available, please wait until new ones are added.
We really appreciate your willingness to help. 😊
Are you preparing for Google Summer of Code? See our GSoC guidelines.