Commit fbce4251 by John Hess

drag and drop now correctly handles cases where no draggables should be dragged

parent ff35d3e6
......@@ -326,7 +326,11 @@ class DragAndDrop(object):
else:
self.excess_draggables[draggable_name] = \
self.excess_draggables.get(draggable_name, False)
if len(correct_answer)==0:
for draggable_dict in user_answer['draggables']:
# draggable_dict is 1-to-1 {draggable_name: position}
draggable_name = draggable_dict.keys()[0]
self.excess_draggables[draggable_name] = False
def grade(user_input, correct_answer):
""" Creates DragAndDrop instance from user_input and correct_answer and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment