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

fix: bff handle feedback only criteria #2154

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading