From: Marcin Koziej Date: Fri, 8 Feb 2013 13:28:29 +0000 (+0100) Subject: Some minor fixes: showin results in Przyporzadkuj and resetting in PrawdaFalsz X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/a980dc9ed36f367a04dfdc56e277375d9cca1bd1?hp=f7c25489e2c521e0cbcf86d8b75a88bd880c9602 Some minor fixes: showin results in Przyporzadkuj and resetting in PrawdaFalsz --- diff --git a/lib/librarian b/lib/librarian index 1ffcf32a..b10cdf12 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit 1ffcf32a8d795681f54bd125ca45e908da5ed3fb +Subproject commit b10cdf123648beb76120194d7f9bb69fc8433ede diff --git a/redakcja/static/edumed/js/edumed.coffee b/redakcja/static/edumed/js/edumed.coffee index 2cb9bdb3..24955fd2 100644 --- a/redakcja/static/edumed/js/edumed.coffee +++ b/redakcja/static/edumed/js/edumed.coffee @@ -426,7 +426,7 @@ class Przyporzadkuj extends Exercise for m in draggables $pr = $(".predicate [data-predicate=" + m + "]", question) $ph = $pr.find ".placeholder:visible" - @draggable_move $(qp), $ph, @multiple + @draggable_move $(qp), $ph.eq(0), @multiple @@ -435,16 +435,16 @@ class PrawdaFalsz extends Exercise super element for qp in $(".question-piece", @element) - $(".true", qp).click (ev) -> + $(".true", qp).click (ev) => ev.preventDefault() @retry() - $(this).closest(".question-piece").data("value", "true") - $(this).addClass('chosen').siblings('a').removeClass('chosen') - $(".false", qp).click (ev) -> + $(ev.target).closest(".question-piece").data("value", "true") + $(ev.target).addClass('chosen').siblings('a').removeClass('chosen') + $(".false", qp).click (ev) => ev.preventDefault() @retry() - $(this).closest(".question-piece").data("value", "false") - $(this).addClass('chosen').siblings('a').removeClass('chosen') + $(ev.target).closest(".question-piece").data("value", "false") + $(ev.target).addClass('chosen').siblings('a').removeClass('chosen') check_question: -> diff --git a/redakcja/static/edumed/js/edumed.js b/redakcja/static/edumed/js/edumed.js index 1886b38b..a99377de 100644 --- a/redakcja/static/edumed/js/edumed.js +++ b/redakcja/static/edumed/js/edumed.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.3.3 +// Generated by CoffeeScript 1.4.0 (function() { var $, Binding, EduModule, Exercise, Luki, PrawdaFalsz, Przyporzadkuj, Uporzadkuj, Wybor, Zastap, exercise, __hasProp = {}.hasOwnProperty, @@ -557,7 +557,7 @@ m = draggables[_j]; $pr = $(".predicate [data-predicate=" + m + "]", question); $ph = $pr.find(".placeholder:visible"); - _results1.push(this.draggable_move($(qp), $ph, this.multiple)); + _results1.push(this.draggable_move($(qp), $ph.eq(0), this.multiple)); } return _results1; }).call(this)); @@ -574,22 +574,23 @@ __extends(PrawdaFalsz, _super); function PrawdaFalsz(element) { - var qp, _i, _len, _ref; + var qp, _i, _len, _ref, + _this = this; PrawdaFalsz.__super__.constructor.call(this, element); _ref = $(".question-piece", this.element); for (_i = 0, _len = _ref.length; _i < _len; _i++) { qp = _ref[_i]; $(".true", qp).click(function(ev) { ev.preventDefault(); - this.retry(); - $(this).closest(".question-piece").data("value", "true"); - return $(this).addClass('chosen').siblings('a').removeClass('chosen'); + _this.retry(); + $(ev.target).closest(".question-piece").data("value", "true"); + return $(ev.target).addClass('chosen').siblings('a').removeClass('chosen'); }); $(".false", qp).click(function(ev) { ev.preventDefault(); - this.retry(); - $(this).closest(".question-piece").data("value", "false"); - return $(this).addClass('chosen').siblings('a').removeClass('chosen'); + _this.retry(); + $(ev.target).closest(".question-piece").data("value", "false"); + return $(ev.target).addClass('chosen').siblings('a').removeClass('chosen'); }); } }