true/false exercise
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 31 Oct 2013 11:56:24 +0000 (12:56 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 15 Jan 2014 10:18:53 +0000 (11:18 +0100)
wtem/static/wtem/edumed.coffee
wtem/static/wtem/edumed.js
wtem/templates/wtem/exercises/edumed_prawdafalsz.html [new file with mode: 0644]

index d70ce8a..cb1920b 100644 (file)
@@ -511,6 +511,11 @@ class PrawdaFalsz extends Exercise
       else
         $(".false", qp).click()
 
+  get_answer: (question) ->
+    answer = []
+    $(".question-piece", @element).each (i, qpiece) =>
+      answer.push($(qpiece).data('value') || '-')
+    return answer
 
 ##########
 
index 2a6ddb0..18ed499 100644 (file)
       return _results;
     };
 
+    PrawdaFalsz.prototype.get_answer = function(question) {
+      var answer,
+        _this = this;
+      answer = [];
+      $(".question-piece", this.element).each(function(i, qpiece) {
+        return answer.push($(qpiece).data('value') || '-');
+      });
+      return answer;
+    };
+
     return PrawdaFalsz;
 
   })(Exercise);
diff --git a/wtem/templates/wtem/exercises/edumed_prawdafalsz.html b/wtem/templates/wtem/exercises/edumed_prawdafalsz.html
new file mode 100644 (file)
index 0000000..a55724a
--- /dev/null
@@ -0,0 +1,26 @@
+<div class="exercise prawdafalsz" data-type="prawdafalsz">
+
+    <h3>Zadanie {{no}}</h3>
+
+    <div class="question" data-no="1">
+        <div class="description">
+        {% for para in exercise.description %}
+            <p class="paragraph">
+                {{para}}
+            </p>
+        {% endfor %}
+        </div>
+
+        <ul class="lista punkt ">
+            {% for statement in exercise.statements %}
+                <li class="question-piece">
+                    <span class="buttons">
+                        <a href="#" data-value="true" class="true">Prawda</a>
+                        <a href="#" data-value="false" class="false">Fałsz</a>  
+                    </span>
+                    {{statement.0}}
+                </li>
+            {% endfor %}
+        </ul>
+    </div>
+</div>
\ No newline at end of file