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

Changed mult_choice API

parent 73cba00b
No related branches found
No related tags found
1 merge request!12Fix relation between MultipleChoiceOption and FeedbackOption
Pipeline #17704 failed
This commit is part of merge request !12. Comments created here will be created in the context of that merge request.
...@@ -3,7 +3,7 @@ from flask_restful import Resource, reqparse ...@@ -3,7 +3,7 @@ from flask_restful import Resource, reqparse
from ..database import db, MultipleChoiceOption, FeedbackOption from ..database import db, MultipleChoiceOption, FeedbackOption
def set_mc_data(mc_entry, name, x, y, mc_type, problem_id, feedback_id, label): def set_mc_data(mc_entry, name, x, y, mc_type, feedback_id, label):
"""Sets the data of a MultipleChoiceOption ORM object. """Sets the data of a MultipleChoiceOption ORM object.
Parameters: Parameters:
...@@ -11,7 +11,6 @@ def set_mc_data(mc_entry, name, x, y, mc_type, problem_id, feedback_id, label): ...@@ -11,7 +11,6 @@ def set_mc_data(mc_entry, name, x, y, mc_type, problem_id, feedback_id, label):
mc_entry: The MultipleChoiceOption object mc_entry: The MultipleChoiceOption object
x: the x-position of the MultipleChoiceOption object. x: the x-position of the MultipleChoiceOption object.
y: the y-position of the MultipleChoiceOption object. y: the y-position of the MultipleChoiceOption object.
problem_id: the problem the MultipleChoiceOption refers to
feedback_id: the feedback the MultipleChoiceOption refers to feedback_id: the feedback the MultipleChoiceOption refers to
label: label for the checkbox that this MultipleChoiceOption represents label: label for the checkbox that this MultipleChoiceOption represents
""" """
...@@ -19,7 +18,6 @@ def set_mc_data(mc_entry, name, x, y, mc_type, problem_id, feedback_id, label): ...@@ -19,7 +18,6 @@ def set_mc_data(mc_entry, name, x, y, mc_type, problem_id, feedback_id, label):
mc_entry.x = x mc_entry.x = x
mc_entry.y = y mc_entry.y = y
mc_entry.type = mc_type mc_entry.type = mc_type
mc_entry.problem_id = problem_id
mc_entry.feedback_id = feedback_id mc_entry.feedback_id = feedback_id
mc_entry.label = label mc_entry.label = label
...@@ -72,7 +70,7 @@ class MultipleChoice(Resource): ...@@ -72,7 +70,7 @@ class MultipleChoice(Resource):
# Insert new entry into the database # Insert new entry into the database
mc_entry = MultipleChoiceOption() mc_entry = MultipleChoiceOption()
set_mc_data(mc_entry, name, x, y, mc_type, problem_id, feedback_id, label) set_mc_data(mc_entry, name, x, y, mc_type, feedback_id, label)
db.session.add(mc_entry) db.session.add(mc_entry)
db.session.commit() db.session.commit()
...@@ -114,7 +112,6 @@ class MultipleChoice(Resource): ...@@ -114,7 +112,6 @@ class MultipleChoice(Resource):
'x': mult_choice.x, 'x': mult_choice.x,
'y': mult_choice.y, 'y': mult_choice.y,
'type': mult_choice.type, 'type': mult_choice.type,
'problem_id': mult_choice.problem_id,
'feedback_id': mult_choice.feedback_id 'feedback_id': mult_choice.feedback_id
} }
......
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