From a40e38cd047b18aa34893647322781f07cb8386f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 31 Oct 2013 12:56:24 +0100 Subject: [PATCH] true/false exercise --- wtem/static/wtem/edumed.coffee | 5 ++++ wtem/static/wtem/edumed.js | 10 +++++++ .../wtem/exercises/edumed_prawdafalsz.html | 26 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 wtem/templates/wtem/exercises/edumed_prawdafalsz.html diff --git a/wtem/static/wtem/edumed.coffee b/wtem/static/wtem/edumed.coffee index d70ce8a..cb1920b 100644 --- a/wtem/static/wtem/edumed.coffee +++ b/wtem/static/wtem/edumed.coffee @@ -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 ########## diff --git a/wtem/static/wtem/edumed.js b/wtem/static/wtem/edumed.js index 2a6ddb0..18ed499 100644 --- a/wtem/static/wtem/edumed.js +++ b/wtem/static/wtem/edumed.js @@ -682,6 +682,16 @@ 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 index 0000000..a55724a --- /dev/null +++ b/wtem/templates/wtem/exercises/edumed_prawdafalsz.html @@ -0,0 +1,26 @@ +
+ +

Zadanie {{no}}

+ +
+
+ {% for para in exercise.description %} +

+ {{para}} +

+ {% endfor %} +
+ +
    + {% for statement in exercise.statements %} +
  • + + Prawda + Fałsz + + {{statement.0}} +
  • + {% endfor %} +
+
+
\ No newline at end of file -- 2.20.1