From 723f0aeedb81b9aabb213d5e8b74653e73a9eb38 Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Wed, 13 Feb 2013 15:00:18 +0100 Subject: [PATCH 1/1] maxscore --- lib/librarian | 2 +- redakcja/static/edumed/js/edumed.coffee | 7 ++++++- redakcja/static/edumed/js/edumed.js | 9 ++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/librarian b/lib/librarian index b10cdf12..2919eb4f 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit b10cdf123648beb76120194d7f9bb69fc8433ede +Subproject commit 2919eb4f57c7e1c9dead734c685a9b36f34e30ce diff --git a/redakcja/static/edumed/js/edumed.coffee b/redakcja/static/edumed/js/edumed.coffee index 24955fd2..4cf17aac 100644 --- a/redakcja/static/edumed/js/edumed.coffee +++ b/redakcja/static/edumed/js/edumed.coffee @@ -97,7 +97,12 @@ class Exercise extends Binding return [mandat, opt] show_score: (score) -> - $(".message", @element).text("Wynik: #{score[0]} / #{score[1]}") + $msg = $(".message", @element) + $msg.text("Wynik: #{score[0]} / #{score[1]}") + if score[0] == score[1] + $msg.addClass("maxscore") + else + $msg.removeClass("maxscore") draggable_equal: ($draggable1, $draggable2) -> diff --git a/redakcja/static/edumed/js/edumed.js b/redakcja/static/edumed/js/edumed.js index a99377de..2c5e3083 100644 --- a/redakcja/static/edumed/js/edumed.js +++ b/redakcja/static/edumed/js/edumed.js @@ -125,7 +125,14 @@ }; Exercise.prototype.show_score = function(score) { - return $(".message", this.element).text("Wynik: " + score[0] + " / " + score[1]); + var $msg; + $msg = $(".message", this.element); + $msg.text("Wynik: " + score[0] + " / " + score[1]); + if (score[0] === score[1]) { + return $msg.addClass("maxscore"); + } else { + return $msg.removeClass("maxscore"); + } }; Exercise.prototype.draggable_equal = function($draggable1, $draggable2) { -- 2.20.1