kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Quiz question settings crash when the channel list fails to load

Open marcellamaki opened this issue 1 year ago • 4 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

The quiz question settings page throws a TypeError (see Errors and logs) when the channel list request has failed:

Errors and logs

Sentry: KOLIBRI-FRONTEND-13XK

Trace
TypeError: Cannot read properties of null (reading 'reduce')
    at addableQuestionCount (webpack://kolibri-root/kolibri/plugins/coach/assets/src/views/quizzes/CreateExamPage/sidePanels/QuizResourceSelection/subPages/QuestionsSettings.vue:94:1)
    at <object>.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:24951)
    at <object>.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:25830)
    at get c.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:21763)
    at <object>.get (./node_modules/vue/dist/vue.runtime.common.prod.js:11:8805)
    at render (./kolibri/plugins/coach/assets/src/views/quizzes/CreateExamPage/sidePanels/QuizResourceSelection/subPages/QuestionsSettings.vue:18:28)
    at t.prototype._render (./node_modules/vue/dist/vue.runtime.common.prod.js:11:44429)
    at o (./node_modules/vue/dist/vue.runtime.common.prod.js:11:74040)
    at <object>.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:24951)
    at wn (./node_modules/vue/dist/vue.runtime.common.prod.js:11:24890)
    at t (./node_modules/vue/dist/vue.runtime.common.prod.js:11:74054)
    at xo.prototype.$mount (./node_modules/vue/dist/vue.runtime.common.prod.js:11:73929)
    at Zn.init (./node_modules/vue/dist/vue.runtime.common.prod.js:11:29532)
    at n (./node_modules/vue/dist/vue.runtime.common.prod.js:11:33371)
    at <anonymous> (./node_modules/vue/dist/vue.runtime.common.prod.js:11:62186)
    at d (./node_modules/vue/dist/vue.runtime.common.prod.js:11:62073)
    at <anonymous> (./node_modules/vue/dist/vue.runtime.common.prod.js:11:65379)
    at O (./node_modules/vue/dist/vue.runtime.common.prod.js:11:64927)
    at <anonymous> (./node_modules/vue/dist/vue.runtime.common.prod.js:11:65086)
    at O (./node_modules/vue/dist/vue.runtime.common.prod.js:11:64927)
    at <anonymous> (./node_modules/vue/dist/vue.runtime.common.prod.js:11:65086)
    at O (./node_modules/vue/dist/vue.runtime.common.prod.js:11:64927)
    at __patch__ (./node_modules/vue/dist/vue.runtime.common.prod.js:11:66745)
    at t.prototype._update (./node_modules/vue/dist/vue.runtime.common.prod.js:11:43408)
    at o (./node_modules/vue/dist/vue.runtime.common.prod.js:11:74030)
    at <object>.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:24951)
    at <object>.value (./node_modules/vue/dist/vue.runtime.common.prod.js:11:25594)
    at Vn (./node_modules/vue/dist/vue.runtime.common.prod.js:11:27459)
    at e (./node_modules/vue/dist/vue.runtime.common.prod.js:11:20120)
    at Ye (./node_modules/vue/dist/vue.runtime.common.prod.js:11:19552)

User-facing consequences

The quiz resource selection panel breaks, and the coach cannot add questions to the section.

Steps to reproduce

  1. In browser DevTools Network tab, block requests matching /api/content/channel.
  2. As a coach, create a new quiz and click Add questions in a section.
  3. The console shows the TypeError.

Acceptance Criteria

  • [ ] When the channel request fails, the question settings page shows an error icon and the core defaultErrorMessage$() string in place of the settings form, as CoursePreviewSidePanel.vue#L66-L69 does.
  • [ ] Continue is disabled while the error shows.
  • [ ] A new QuestionsSettings spec covers a failed channel request.

AI usage

Claude Code traced the null source and drafted this revision; @marcellamaki filed the Sentry report.

marcellamaki avatar Oct 08 '25 15:10 marcellamaki

Sentry Issue: KOLIBRI-FRONTEND-13XK

sentry[bot] avatar Oct 10 '25 15:10 sentry[bot]

Hi! 👋

This issue is available for contribution and supports self-assignment. Here's how to get started:

  • Comment /assign to assign yourself to this issue
  • You can have up to 2 issues assigned at a time across all community repos
  • Dropping an issue has a 7-day cooldown before the slot opens up
  • Link your pull request to this issue when you submit it

📖 Read the Contributing guidelines before starting.

Are you preparing for Google Summer of Code? See our GSoC guidelines.

learning-equality-bot avatar Sep 30 '26 03:09 learning-equality-bot

/assign

I have read the contribution and generative AI guidelines. I would like to fix the failed-channel state, disable Continue while it is shown, and add the focused QuestionsSettings regression spec described in the acceptance criteria.

nightcityblade avatar Sep 30 '26 03:09 nightcityblade

Hi! 👋

You've been assigned to this issue. Here's what to do next:

  • Read the issue description carefully and make sure you understand the requirements
  • Link your pull request to this issue when you submit it
  • If you can no longer work on this, unassign yourself so others can pick it up

Good luck! 😊

Are you preparing for Google Summer of Code? See our GSoC guidelines.

learning-equality-bot avatar Sep 30 '26 03:09 learning-equality-bot