Skip to content
Snippets Groups Projects
Commit 66d8cc3a authored by Ruben Young On's avatar Ruben Young On
Browse files

Changed exams api call to add mc_options in the right place

parent 92a1e913
No related branches found
No related tags found
1 merge request!11MultipleChoiceOption is a widget, /exams API call now returns checkbox data
Pipeline #17626 passed
......@@ -113,20 +113,7 @@ class Exams(Resource):
'feedback': [
fb.id for fb in sol.feedback
],
'remark': sol.remarks if sol.remarks else "",
'mc_options': [
{
'id': mc_option.id,
'label': mc_option.label,
'problem_id': mc_option.problem_id,
'feedback_id': mc_option.feedback_id,
'widget': {
'name': mc_option.name,
'x': mc_option.x,
'y': mc_option.y
}
} for mc_option in sol.problem.mc_options
]
'remark': sol.remarks if sol.remarks else ""
} for sol in sub.solutions # Sorted by sol.problem_id
],
} for sub in exam.submissions
......@@ -167,7 +154,20 @@ class Exams(Resource):
'width': prob.widget.width,
'height': prob.widget.height,
},
'graded': any([sol.graded_by is not None for sol in prob.solutions])
'graded': any([sol.graded_by is not None for sol in prob.solutions]),
'mc_options': [
{
'id': mc_option.id,
'label': mc_option.label,
'problem_id': mc_option.problem_id,
'feedback_id': mc_option.feedback_id,
'widget': {
'name': mc_option.name,
'x': mc_option.x,
'y': mc_option.y
}
} for mc_option in prob.mc_options
]
} for prob in exam.problems # Sorted by prob.id
],
'widgets': [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment