exercises styling, script from upstream
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 12 Feb 2013 08:56:48 +0000 (09:56 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 12 Feb 2013 09:10:29 +0000 (10:10 +0100)
catalogue/static/catalogue/css/exercise.css
catalogue/static/catalogue/css/exercise.scss
catalogue/static/catalogue/js/edumed.js

index 3325f90..2be22bc 100644 (file)
   cursor: pointer;
   z-index: 2;
   width: 38.625em; }
+.przyporzadkuj span.question-piece {
+  display: inline-block;
+  margin: .1em;
+  width: auto; }
 .przyporzadkuj .question-piece.disabled {
   background-color: #eee;
   color: #d4d6d8; }
index cf7bfc3..e16d7d7 100755 (executable)
@@ -162,6 +162,11 @@ $px: 0.0625em;
         @include bubble-drag;
         width: 618*$px;
     }
+    span.question-piece {
+        display: inline-block;
+        margin: .1em;
+        width: auto;
+    }
     .question-piece.disabled {
         @include bubble-drag-disabled;
     }
index f11ac36..33b7c58 100644 (file)
       if (!$placeholder.hasClass('multiple')) {
         $placeholder.hide();
       }
-      $added.append('<span class="remove">x</span><div class="clr">');
+      if ($added.is(".add-li")) {
+        $added.wrap("<li/>");
+      }
+      $added.append('<span class="remove">x</span><div class="clr"></div>');
       return $('.remove', $added).click(function(ev) {
-        $added.prev(".placeholder:not(.multiple)").show();
         if (!ismultiple) {
           $($added.data('original')).removeClass('disabled').draggable('enable');
         }
+        if ($added.is(".add-li")) {
+          $added = $added.closest('li');
+        }
+        $added.prev(".placeholder:not(.multiple)").show();
         return $added.remove();
       });
     };
           should_be_checked = solution.indexOf(piece_no) >= 0;
         }
         console.log("check " + $("input[type=checkbox]", qpiece).attr("id") + " -> " + should_be_checked);
-        return $("input[type=checkbox]", qpiece).prop('checked', should_be_checked);
+        return $("input[type=checkbox],input[type=radio]", qpiece).prop('checked', should_be_checked);
       });
     };
 
 
     PrawdaFalsz.prototype.show_solutions = function() {
       var qp, _i, _len, _ref, _results;
-      reset();
+      this.reset();
       _ref = $(".question-piece", this.element);
       _results = [];
       for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         qp = _ref[_i];
-        if ($(qp).data('solution') === 'true') {
+        if ($(qp).data('solution') === true) {
           _results.push($(".true", qp).click());
         } else {
           _results.push($(".false", qp).click());