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

Update Exam model with V3 question_sources, update relevant JS utils #11025

Conversation

nucleogenesis
Copy link
Member

@nucleogenesis nucleogenesis commented Jul 27, 2023

Summary

Cohacked on w/ @thanksameeelian - adds commentary defining a new question_sources architecture for the Exam model (V3) and updates the default value for the data_model_version property to 3 and includes the generated migration.

Updates the kolibri/core/assets/src/exams/utils.js file so that it remains backward compatible while also providing a function to be used in our new work using the V3 data structure.

References

Closes #11002

Reviewer guidance

Nothing to manually test beside anything you can think of in Kolibri that might rely on getting V2 data structures so that we're sure of the backward compatibility measures working. @thanksameeelian and I looked at it and saw no issues.

As for the code - anything we've missed?


Testing checklist

  • Contributor has fully tested the PR manually
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@nucleogenesis nucleogenesis added the TODO: needs review Waiting for review label Jul 27, 2023
@nucleogenesis nucleogenesis requested a review from rtibbles July 27, 2023 20:50
@github-actions github-actions bot added DEV: backend Python, databases, networking, filesystem... SIZE: medium labels Jul 27, 2023
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One possible oversight from the spec review.

kolibri/core/exams/models.py Show resolved Hide resolved
kolibri/core/assets/src/exams/utils.js Outdated Show resolved Hide resolved
kolibri/core/assets/src/exams/utils.js Show resolved Hide resolved
kolibri/core/assets/src/exams/utils.js Show resolved Hide resolved
@nucleogenesis nucleogenesis requested a review from rtibbles August 1, 2023 17:26
description: '',
resource_pool: [],
questions: expectedSources.sort(),
learners_see_fixed_order: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth adding another test that ensures that this gets set to false if the exam is set to false?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this additional test yet - if we add that, we should be good to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEV: backend Python, databases, networking, filesystem... SIZE: medium TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add and handle V3 schema for Exam#question_sources JSONField
2 participants