Commit 53179a65 by Filippo Valsorda

Improve the feedback popup

parent 8ce76f2e
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
<header class="hidden"> <header class="hidden">
<h1>Title <span class="small">(1 point possible)</span></h1> <h1>Title <span class="small">(1 point possible)</span></h1>
<h2>Question</h2>
<p>Lorem ipsum?</p> <p>Lorem ipsum?</p>
</header> </header>
......
...@@ -463,7 +463,7 @@ var dragAndDrop = (function() { ...@@ -463,7 +463,7 @@ var dragAndDrop = (function() {
.draggable('disable'); .draggable('disable');
_fn.test.completed++; _fn.test.completed++;
_fn.feedback.popup( _fn.feedback.get(val, true) ); _fn.feedback.popup( _fn.feedback.get(val, true), true );
if ( _fn.items.allSubmitted() ) { if ( _fn.items.allSubmitted() ) {
_fn.finish(); _fn.finish();
...@@ -471,7 +471,7 @@ var dragAndDrop = (function() { ...@@ -471,7 +471,7 @@ var dragAndDrop = (function() {
} else { } else {
// Return to original position // Return to original position
_fn.clickHandlers.drag.reset( $el ); _fn.clickHandlers.drag.reset( $el );
_fn.feedback.popup( _fn.feedback.get(val, false) ); _fn.feedback.popup( _fn.feedback.get(val, false), false );
} }
}, },
...@@ -588,8 +588,9 @@ var dragAndDrop = (function() { ...@@ -588,8 +588,9 @@ var dragAndDrop = (function() {
}, },
// Show a feedback popup // Show a feedback popup
popup: function(str) { popup: function(str, boo) {
return $("<div>").attr('title', 'Feedback').text(str).dialog(); if (str === undefined || str === '') return;
return $("<div>").attr('title', boo ? 'Correct' : 'Error').text(str).dialog();
} }
}, },
......
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