From 90654be51d9c0fe797340fe1c39ffcca3665d780 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 14 Feb 2013 11:46:03 +0100 Subject: [PATCH] maxscore style; fix exercise: Luki --- catalogue/static/catalogue/css/exercise.css | 7 +++++-- catalogue/static/catalogue/css/exercise.scss | 6 +++++- catalogue/static/catalogue/js/edumed.js | 13 ++++++------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/catalogue/static/catalogue/css/exercise.css b/catalogue/static/catalogue/css/exercise.css index dc5ab1b..05b005f 100644 --- a/catalogue/static/catalogue/css/exercise.css +++ b/catalogue/static/catalogue/css/exercise.css @@ -41,7 +41,9 @@ font-weight: bold; } .exercise .buttons .message { float: right; - margin-right: 1.25em; } + padding: 0 1.25em; } + .exercise .buttons .maxscore { + background: #16a487; } .exercise .buttons input.check { background: #ed7831; } @@ -52,7 +54,8 @@ z-index: 2; display: inline-block; margin: 0.313em; - z-index: 2; } + z-index: 2; + max-width: 38em; } .luki .question-piece.disabled { background-color: #eee; color: #d4d6d8; } diff --git a/catalogue/static/catalogue/css/exercise.scss b/catalogue/static/catalogue/css/exercise.scss index 039b088..cd87f12 100755 --- a/catalogue/static/catalogue/css/exercise.scss +++ b/catalogue/static/catalogue/css/exercise.scss @@ -96,7 +96,10 @@ $px: 0.0625em; } .message { float: right; - margin-right: 20*$px; + padding: 0 20*$px; + } + .maxscore { + background: #16a487; } input.check { @@ -112,6 +115,7 @@ $px: 0.0625em; .question-piece { @include bubble-drag; @include bubble-inline; + max-width: 608*$px; } .question-piece.disabled { @include bubble-drag-disabled; diff --git a/catalogue/static/catalogue/js/edumed.js b/catalogue/static/catalogue/js/edumed.js index f720aca..b05cc9c 100644 --- a/catalogue/static/catalogue/js/edumed.js +++ b/catalogue/static/catalogue/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]); }; -- 2.20.1