Skip to content

Commit

Permalink
fix: bff handle feedback only criteria (#2154)
Browse files Browse the repository at this point in the history
* fix: allow feedback only criteria in assessment

* chore: bump ORA to 6.0.22
  • Loading branch information
nsprenkle authored Jan 4, 2024
1 parent f3bd8f1 commit dae4b35
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion openassessment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Initialization Information for Open Assessment Module
"""

__version__ = '6.0.21'
__version__ = '6.0.22'
13 changes: 9 additions & 4 deletions openassessment/xblock/ui_mixins/mfe/assessment_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class AssessmentCriterionSerializer(Serializer):
feedback: (String) Feedback for the selected option
}
"""
selectedOption = IntegerField(source="option.order_num")
selectedOption = IntegerField(source="option.order_num", allow_null=True)
feedback = CharField()


Expand Down Expand Up @@ -190,7 +190,7 @@ class MfeAssessmentCriterionSerializer(Serializer):
feedback: (String / Empty) Feedback for the selected option
}
"""
selectedOption = IntegerField()
selectedOption = IntegerField(allow_null=True)
feedback = CharField(allow_blank=True, allow_null=True)


Expand Down Expand Up @@ -241,8 +241,13 @@ def to_legacy_format(self, xblock):

# Look up the name and value for each given rubric selection
criterion_name = xblock.rubric_criteria[i]['name']
selected_value = xblock.rubric_criteria[i]['options'][criterion_data['selectedOption']]['name']
options_selected[criterion_name] = selected_value

# For feedback-only criteria, there are no options
if len(xblock.rubric_criteria[i]['options']) > 0:

# Otherwise, get the value of the selected option
selected_value = xblock.rubric_criteria[i]['options'][criterion_data['selectedOption']]['name']
options_selected[criterion_name] = selected_value

# Attach feedback for the criterion
criterion_feedback[criterion_name] = criterion_data['feedback']
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edx-ora2",
"version": "6.0.21",
"version": "6.0.22",
"repository": "https://github.com/openedx/edx-ora2.git",
"dependencies": {
"@edx/frontend-build": "8.0.6",
Expand Down

0 comments on commit dae4b35

Please sign in to comment.