Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quiz Creation: Saving quiz, issues in Learn #12010

Closed
4 of 5 tasks
nucleogenesis opened this issue Mar 21, 2024 · 0 comments · Fixed by #12111
Closed
4 of 5 tasks

Quiz Creation: Saving quiz, issues in Learn #12010

nucleogenesis opened this issue Mar 21, 2024 · 0 comments · Fixed by #12111
Assignees
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) DEV: backend Python, databases, networking, filesystem... DEV: frontend P0 - critical Priority: Release blocker or regression

Comments

@nucleogenesis
Copy link
Member

nucleogenesis commented Mar 21, 2024

Overview

Previously we updated the Exam viewer to account for the new data structure we're using for quiz sections. However, there seems to be an issue that has come up despite this having worked previously.

Additionally, there is an issue when saving the quiz that results in the user not being properly redirected to the Plan -> Quizzes page.

In Learn, we see the following when we sign in as a learner who is assigned to the quiz:

[python-devserver]   File "/home/jacob/Code/LE/kolibri/11017--replace-questions/kolibri/core/api.py", line 235, in serialize
[python-devserver]     return self.consolidate(
[python-devserver]   File "/home/jacob/Code/LE/kolibri/11017--replace-questions/kolibri/plugins/learn/viewsets.py", line 191, in consolidate
[python-devserver]     exam_node_ids |= {
[python-devserver]   File "/home/jacob/Code/LE/kolibri/11017--replace-questions/kolibri/plugins/learn/viewsets.py", line 192, in <setcomp>
[python-devserver]     question["exercise_id"] for question in exam.get("question_sources")
[python-devserver] KeyError: 'exercise_id'

Seems that we have an issue w/ how the quiz data is being processed, perhaps we missed a place where we need to update handling of the quiz object -- or, perhaps, the issue is in how the data is being saved into the database in the first place.

A few other places in the code may run into similar problems, namely:

  • Coach reports
  • Coach quiz preview

Acceptance criteria

On the front-end, we can use conversion functions to convert older data_models to v3 so that then everywhere in Kolibri, when we reference a quiz, it is shaped like a >=v3 model and we don't have to conditionalize our code around the updated data structures.

  • Ensure that when you save a quiz successfully (ie, get HTTP 201 back) then you are redirected to the Coach -> Plan -> Quizzes page. Double check validateQuiz is properly validating the quiz.
  • Ensure that the Exam is assigned to "Entire Class" - should be doable by adding an assignments property to the Quiz (useQuizCreation -> _quiz) object which is a list including the classId (available by way of the $route)
  • Update kolibri.plugins.learn.viewsets to properly handle Exam question_sources v3
  • Create a quiz, save it, take it as a learner who is assigned to the quiz; it seems that Learn is not setup to work w/ the new data set properly w/ regards to how it renders the ID. Check ContentRenderer's props being passed, may need to use some kolibri.core.exams.src.assets.utils helpers for converting the data structure.
  • Search for places where an Exam model is being referenced, particularly within serializers, views, and viewsets. If it's a straightforward fix, do it, otherwise, note it in your PR so that we can follow-up on those places as well.
@nucleogenesis nucleogenesis added P0 - critical Priority: Release blocker or regression DEV: backend Python, databases, networking, filesystem... APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Mar 21, 2024
@nucleogenesis nucleogenesis linked a pull request May 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) DEV: backend Python, databases, networking, filesystem... DEV: frontend P0 - critical Priority: Release blocker or regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants