maxscore
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Wed, 13 Feb 2013 14:00:18 +0000 (15:00 +0100)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Wed, 13 Feb 2013 14:00:18 +0000 (15:00 +0100)
lib/librarian
redakcja/static/edumed/js/edumed.coffee
redakcja/static/edumed/js/edumed.js

index b10cdf1..2919eb4 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b10cdf123648beb76120194d7f9bb69fc8433ede
+Subproject commit 2919eb4f57c7e1c9dead734c685a9b36f34e30ce
index 24955fd..4cf17aa 100644 (file)
@@ -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) ->
index a99377d..2c5e308 100644 (file)
     };
 
     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) {