Coach quiz reports show questions as "(5)" without the exercise name
🙂 Looking for an issue? Welcome! This issue is open for contribution. If this is the first time you’re requesting an issue, please:
- Read Contributing guidelines carefully. Pay extra attention to Using generative AI. Pull requests and comments that don’t follow the guidelines won’t be answered.
- Confirm that you’ve read the guidelines in your comment.
Target branch: develop
Observed behavior
In a quiz's coach report, questions are labelled only with their number in brackets, for example "(5)", "(12)", "(12)", "(8)". The exercise name is missing, so a coach can't tell which question is which. Two questions from different exercises can even get the same label.
It affects every quiz: ones made with the current quiz editor, and older quizzes once they're converted on load.
-
Difficult questions tab (a quiz made with the current editor):
-
The same tab for an older (V1) quiz: its three questions all read "(1)":
-
Question detail page (opened from the list): the heading, the app bar and the browser tab title all read "(5)":
-
Export as CSV on the Difficult questions tab: the Title column is empty for every row:
"Title","Help needed","All learners" "","1","1" "","1","1" "","1","1"
Cause
In V3 quizzes, a question's title is blank unless a user has set one:
selectQuestions.jssetstitle: ''when questions are added;convertExamQuestionSourcesV2toV3blanks it when older quizzes are converted.
displayQuestionTitle(question, exerciseTitle) in enhancedQuizManagementStrings.js handles this by falling back to "{exercise title} ({counter})". However, the coach report code still passes question.title straight to nthExerciseName:
kolibri/plugins/coach/frontend/views/quizzes/QuizSummaryPage/tables/DifficultQuestionsTable.vue:getQuestionTitle, and thetitlecolumn used by its CSV export.kolibri/plugins/coach/frontend/modules/questionList/actions.js: the quiz branch ofsetItemStats.kolibri/plugins/coach/frontend/modules/questionDetail/handlers.js: the quiz branch.
#12294 asked for displayQuestionTitle to be used throughout. Its PR, #12369, updated only the quiz editor's QuestionListPreview.vue. The report code is the same in v0.19.5.
Expected behavior
Wherever a coach report names a quiz question, it uses displayQuestionTitle: the user-set title if there is one, otherwise "{exercise title} ({counter})". The same goes for the CSV export.
User-facing consequences
Coaches use Difficult questions to see what to reteach, but they can't tell which exercise a listed question belongs to without opening each one. Even the detail page gives no name. The exported CSV has no question names at all.
Steps to reproduce
- As a coach, create a quiz with the quiz editor and start it.
- Have a learner take and submit it, getting some questions wrong.
- Open the quiz's report and go to the Difficult questions tab. Each question shows only "(n)".
- Open a question: the page heading is "(n)".
- Click Export as CSV: the Title column is empty.
Context
- Kolibri
developat 5d47c94a8e (dev server); the same code is in v0.19.5 - macOS 26.6.2, Chromium
Possible fix, which I'd be glad to work on: call displayQuestionTitle(question, exercise.title) in those three places. The exercises are already loaded there: fetchExamWithContent returns them for the summary page and the question list, and the question detail handler fetches the exercise node. Then put the resulting title on the table rows so the CSV export uses it too.
AI usage
I used Claude Code to look through coach quiz reports on my local Kolibri. It noticed the bare "(n)" labels, traced them to the report code and the earlier #12294 / #12369, checked v0.19.5, captured the CSV contents, and drafted this issue. I checked the code references and reproduced it in the UI.
@rtibblesbot please validate this issue.
Verdict: claim holds
Evidence: kolibri/plugins/coach/frontend/views/quizzes/QuizSummaryPage/tables/DifficultQuestionsTable.vue:93, modules/questionList/actions.js:58, modules/questionDetail/handlers.js:66 on develop at f72936bd41
- All three pass
question.titleasnametonthExerciseName('{name} ({number})'). - V3 question titles start as
'':utils/selectQuestions.js:21, andconvertExamQuestionSourcesV2toV3inpackages/kolibri-common/quizzes/utils.js:112for converted older quizzes. So the label renders as(n). - The Difficult questions CSV exports the row's
titlekey (csv/fields.js:277). Rows are the raw questions fromQuizSummaryPage/api.js, so the column is empty. displayQuestionTitle(enhancedQuizManagementStrings.js:283) is only used inQuestionListPreview.vue. #12369 changed only that file.- The same three lines are in v0.19.5.
- The exercises are already loaded at each site:
fetchExamWithContentin the summary page and question list, andContentNodeResource.retrievein the question detail handler. - No open issue, or issue closed in the last 30 days, reports this. #12294 asked for the same fix and closed in 2024.
Written by rtibblesbot, an LLM-based coding agent.
Thanks for assigning this. The fix is up in https://github.com/learningequality/kolibri/pull/15696.