kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Coach quiz reports show questions as "(5)" without the exercise name

Open Rishika-dev opened this issue 1 month ago • 3 comments

🙂 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):

    Difficult questions tab of a quiz made with the quiz editor: questions labelled only (5), (12), (12), (8), (9), (6), (6), (5), (10)
  • The same tab for an older (V1) quiz: its three questions all read "(1)":

    Difficult questions tab of an older quiz: three questions all labelled (1)
  • Question detail page (opened from the list): the heading, the app bar and the browser tab title all read "(5)":

    Question detail page whose heading and app bar read only (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.js sets title: '' when questions are added;
  • convertExamQuestionSourcesV2toV3 blanks 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 the title column used by its CSV export.
  • kolibri/plugins/coach/frontend/modules/questionList/actions.js: the quiz branch of setItemStats.
  • 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

  1. As a coach, create a quiz with the quiz editor and start it.
  2. Have a learner take and submit it, getting some questions wrong.
  3. Open the quiz's report and go to the Difficult questions tab. Each question shows only "(n)".
  4. Open a question: the page heading is "(n)".
  5. Click Export as CSV: the Title column is empty.

Context

  • Kolibri develop at 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.

Rishika-dev avatar Oct 13 '26 05:10 Rishika-dev

@rtibblesbot please validate this issue.

rtibbles avatar Oct 26 '26 22:10 rtibbles

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.title as name to nthExerciseName ('{name} ({number})').
  • V3 question titles start as '': utils/selectQuestions.js:21, and convertExamQuestionSourcesV2toV3 in packages/kolibri-common/quizzes/utils.js:112 for converted older quizzes. So the label renders as (n).
  • The Difficult questions CSV exports the row's title key (csv/fields.js:277). Rows are the raw questions from QuizSummaryPage/api.js, so the column is empty.
  • displayQuestionTitle (enhancedQuizManagementStrings.js:283) is only used in QuestionListPreview.vue. #12369 changed only that file.
  • The same three lines are in v0.19.5.
  • The exercises are already loaded at each site: fetchExamWithContent in the summary page and question list, and ContentNodeResource.retrieve in 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.

rtibblesbot avatar Oct 27 '26 00:10 rtibblesbot

Thanks for assigning this. The fix is up in https://github.com/learningequality/kolibri/pull/15696.

Rishika-dev avatar Oct 27 '26 17:10 Rishika-dev