Repository navigation
Add validation for the type of AssessmentItem objects - #4888
Merged
rtibbles merged 2 commits intoFeb 11, 2025
Merged
Conversation
MisRob
requested review from
AlexVelezLl,
LianaHarris360,
akolson,
nucleogenesis and
rtibbles
January 30, 2025 16:15
akolson
reviewed
Jan 30, 2025
akolson
requested changes
Jan 30, 2025
akolson
left a comment
Member
There was a problem hiding this comment.
Hi @drona-gyawali. Great work on this! Just a minor tweak and we should be good to go. Also more importantly, remember to re-run the migrations as the the model has changed -- please commit them too. Thanks
Contributor
Author
akolson
approved these changes
Feb 4, 2025
akolson
left a comment
Member
There was a problem hiding this comment.
LGTM! Thanks @drona-gyawali for the changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added choices to the type field of the AssessmentItem model to restrict it to valid
question_choicesdefined inle_utils.constants.exercises.question_choices.Updated the default value from
"mutiplechoices"to"Mutiple Selection"to align with expected behavior.Why these changes ?
Previously, there was no validation on
AssessmentItem.typeobject, which could lead to invalid or unsupported question types. By adding choices, we ensure that only acceptable types recognized by Studio and Kolibri are allowed.References