Fix relation between MultipleChoiceOption and FeedbackOption
When a MultipleChoiceOption is created via the API call PUT /mult-choice
, a new FeedbackOption is now automatically inserted into the database that links to the same problem as the MultipleChoiceOption
.
The response of PUT /mult-choice
will now contain an mc_id
that shows the ID of the new MultipleChoiceQuestion
and a feedback_id
with the ID of the new FeedbackOption
.
The relation between MultipleChoiceOption
and Problem
is now removed. A new relation from FeedbackOption
to MultipleChoiceOption
is created. However, it is still possible to use problem.mc_options
with a hybrid attribute that essentially runs a query in the background.
TODO:
-
Ensure that if a FeedbackOption
is deleted, the relatedMultipleChoiceOption
is also deleted.
Closes #35 (closed) and #36 (closed).
Merge request reports
Activity
added 1 commit
- 73cba00b - Added relationship between mc_option and feedbackoption, problem_id is no longer used
added 1 commit
- 74899114 - Added hybrid property to problem, removed direct relation between mc_option...
added 1 commit
- 3ad2ab41 - Changed migrations, changed API since put now no longer requires a...
added 1 commit
- 3e15bec9 - MultipleChoiceOption is now deleted if the related FeedbackOption is deleted
assigned to @jtimotei