Skip to content

Commit 1a088f7

Browse files
feat: ✨ adds min and max choices for AssessmentQuestions (#498)
- Adds new fields to the `AssessmentQuestion` model to specify max and min number of choices for choice based assessment questions.
1 parent d98b1f3 commit 1a088f7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/assessments/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ class AbstractAssessmentQuestion(models.Model):
4646
default=QuestionType.UNSPECIFIED.value,
4747
choices=build_question_type_choices(),
4848
)
49+
# If `min_choices` is 0, then none of the answer options are required
50+
# If `min_choices` > 0, then at least that many answer options must be selected
51+
min_choices = models.PositiveSmallIntegerField(default=0)
52+
# If `max_choices` is 0, then all answer options can be selected
53+
# If `max_choices` > 0, then at most that many answer options can be selected
54+
max_choices = models.PositiveSmallIntegerField(default=0)
4955
# Specifies the order of questions within an assessment
5056
order = models.IntegerField(default=0)
5157
# Must be `True` to allow empty text responses or "No Entry" for multiple choice

0 commit comments

Comments
 (0)