From: Radek Czajka Date: Thu, 14 Feb 2013 10:44:54 +0000 (+0100) Subject: fix Luki.check counter; fix check buttons X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/d8e53fe335668196d3f6ab72048f0cf01b2e2558?ds=inline fix Luki.check counter; fix check buttons --- diff --git a/lib/librarian b/lib/librarian index 63f2be7b..1ffcf32a 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit 63f2be7b043df0f94bfa1f96e87834b72be14987 +Subproject commit 1ffcf32a8d795681f54bd125ca45e908da5ed3fb diff --git a/redakcja/static/edumed/js/edumed.coffee b/redakcja/static/edumed/js/edumed.coffee index 6fce16bf..df8098b8 100644 --- a/redakcja/static/edumed/js/edumed.coffee +++ b/redakcja/static/edumed/js/edumed.coffee @@ -25,8 +25,8 @@ class Exercise extends Binding $(".check", @element).click (ev) => @check() - $(ev.target).next(".retry").show() - $(ev.target).hide() + $(".retry", @element).show() + $(".check", @element).hide() $(".retry", @element).click (ev) => @retry() $('.solutions', @element).click => @@ -287,7 +287,7 @@ class Luki extends Exercise @dragging false, false check: -> - all = 0 + all = $(".placeholder", @element).length correct = 0 $(".placeholder + .question-piece", @element).each (i, qpiece) => $placeholder = $(qpiece).prev(".placeholder") @@ -296,7 +296,6 @@ class Luki extends Exercise correct += 1 else @piece_incorrect qpiece - all += 1 @show_score [correct, all] diff --git a/redakcja/static/edumed/js/edumed.js b/redakcja/static/edumed/js/edumed.js index f720aca1..b05cc9c2 100644 --- a/redakcja/static/edumed/js/edumed.js +++ b/redakcja/static/edumed/js/edumed.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.3.3 (function() { var $, Binding, EduModule, Exercise, Luki, PrawdaFalsz, Przyporzadkuj, Uporzadkuj, Wybor, Zastap, exercise, __hasProp = {}.hasOwnProperty, @@ -40,8 +40,8 @@ $(this.element).data("exercise-html", $(this.element).html()); $(".check", this.element).click(function(ev) { _this.check(); - $(ev.target).next(".retry").show(); - return $(ev.target).hide(); + $(".retry", _this.element).show(); + return $(".check", _this.element).hide(); }); $(".retry", this.element).click(function(ev) { return _this.retry(); @@ -364,18 +364,17 @@ Luki.prototype.check = function() { var all, correct, _this = this; - all = 0; + all = $(".placeholder", this.element).length; correct = 0; $(".placeholder + .question-piece", this.element).each(function(i, qpiece) { var $placeholder; $placeholder = $(qpiece).prev(".placeholder"); if ($placeholder.data('solution') === $(qpiece).data('no')) { _this.piece_correct(qpiece); - correct += 1; + return correct += 1; } else { - _this.piece_incorrect(qpiece); + return _this.piece_incorrect(qpiece); } - return all += 1; }); return this.show_score([correct, all]); };