Commit 95664d4a by Xavier Antoviaque

Merge pull request #17 from dragonfi/hide-reset-button

Fix some issues
parents 23564e28 83971e2f
...@@ -179,8 +179,9 @@ class DragAndDropBlock(XBlock): ...@@ -179,8 +179,9 @@ class DragAndDropBlock(XBlock):
if self._is_finished(): if self._is_finished():
final_feedback = self.data['feedback']['finish'] final_feedback = self.data['feedback']['finish']
# only publish the grade once # don't publish the grade if the student has already completed the exercise
if not self.completed: if not self.completed:
if self._is_finished():
self.completed = True self.completed = True
try: try:
self.runtime.publish(self, 'grade', { self.runtime.publish(self, 'grade', {
......
...@@ -185,4 +185,5 @@ ...@@ -185,4 +185,5 @@
float: right; float: right;
color: #3384CA; color: #3384CA;
margin-top: 3px; margin-top: 3px;
display: none;
} }
...@@ -78,6 +78,7 @@ function DragAndDropBlock(runtime, element) { ...@@ -78,6 +78,7 @@ function DragAndDropBlock(runtime, element) {
finish: function(final_feedback) { finish: function(final_feedback) {
// Disable any decoy items // Disable any decoy items
_fn.$items.draggable('disable'); _fn.$items.draggable('disable');
_fn.$reset_button.show();
// Show final feedback // Show final feedback
if (final_feedback) _fn.feedback.set(final_feedback); if (final_feedback) _fn.feedback.set(final_feedback);
...@@ -89,6 +90,7 @@ function DragAndDropBlock(runtime, element) { ...@@ -89,6 +90,7 @@ function DragAndDropBlock(runtime, element) {
_fn.clickHandlers.drag.reset($(element)); _fn.clickHandlers.drag.reset($(element));
}); });
_fn.$popup.hide(); _fn.$popup.hide();
_fn.$reset_button.hide();
_fn.feedback.set(_fn.data.feedback.start); _fn.feedback.set(_fn.data.feedback.start);
}, },
......
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