From: Marcin Koziej Date: Mon, 28 Jan 2013 15:04:13 +0000 (+0100) Subject: try again button X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/a528895b70b51139a214ace3ef87e585a7496ca5?ds=inline try again button rozw_kom --- diff --git a/lib/librarian b/lib/librarian index c0761a86..ae0c7dcc 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit c0761a86fb4687fda8221e56bf911f051fda3499 +Subproject commit ae0c7dcc02fae67423974e65fe8bfdf6e7a7636a diff --git a/redakcja/static/edumed/js/edumed.coffee b/redakcja/static/edumed/js/edumed.coffee index e65faaaf..227bce63 100644 --- a/redakcja/static/edumed/js/edumed.coffee +++ b/redakcja/static/edumed/js/edumed.coffee @@ -23,10 +23,17 @@ class Excercise extends Binding # just save the html to reset the excercise $(@element).data("excercise-html", $(@element).html()) - $(".check", @element).click => + $(".check", @element).click (ev) => @check() + $(ev.target).next(".retry").show() + $(ev.target).hide() + $(".retry", @element).click (ev) => + $(".correct, .incorrect", @element).removeClass("correct incorrect") + $(ev.target).prev(".check").show() + $(ev.target).hide() $('.solutions', @element).click => @show_solutions() + $(".comment", @element).show() $('.reset', @element).click => @reset() diff --git a/redakcja/static/edumed/js/edumed.js b/redakcja/static/edumed/js/edumed.js index 42f0c379..75ecc9e5 100644 --- a/redakcja/static/edumed/js/edumed.js +++ b/redakcja/static/edumed/js/edumed.js @@ -38,11 +38,19 @@ var _this = this; Excercise.__super__.constructor.call(this, 'excercise', element); $(this.element).data("excercise-html", $(this.element).html()); - $(".check", this.element).click(function() { - return _this.check(); + $(".check", this.element).click(function(ev) { + _this.check(); + $(ev.target).next(".retry").show(); + return $(ev.target).hide(); + }); + $(".retry", this.element).click(function(ev) { + $(".correct, .incorrect", _this.element).removeClass("correct incorrect"); + $(ev.target).prev(".check").show(); + return $(ev.target).hide(); }); $('.solutions', this.element).click(function() { - return _this.show_solutions(); + _this.show_solutions(); + return $(".comment", _this.element).show(); }); $('.reset', this.element).click(function() { return _this.reset();