abuse old contest form for exercise view
[edumed.git] / wtem / templates / wtem / exercises / edumed_wybor.html
index 031c718..1d23f33 100644 (file)
@@ -1,24 +1,43 @@
 <div class="exercise exercise-wtem wybor" data-type="wybor" data-id="{{exercise.id}}">
 
-    <h3>Zadanie {{no}}</h3>
+    {% if no %}
+        {% include "wtem/exercises/exercise_no.html" %}
+    {% endif %}
 
+    {% autoescape off %}
     <div class="description">
         {% for para in exercise.description %}
             <p class="paragraph">
                 {{para}}
             </p>
         {% endfor %}
+        <span class="instruction">
+            Zaznacz każdą prawidłową odpowiedź (jedną lub więcej).
+        </span>
     </div>
-
+    {% endautoescape %}
     <div class="question" data-no="1">
         <ol class="lista num">
             {% for option in exercise.options %}
                 <li class="question-piece" data-name="{{option.id}}">
-                    <input type="{% if exercise.answer|length == 1 %}radio{% else %}checkbox{% endif %}" name="{% if exercise.answer|length == 1 %}e{{no}}{% else %}q1_{{option.id}}{% endif %}" id="q1_{{option.id}}">
-                    <label for="{% if exercise.answer|length == 1 %}e{{no}}{% else %}q1_{{option.id}}{% endif %}">{{option.text}}</label>
+                    <input type="checkbox" name="e{{no}}_{{option.id}}" id="e{{no}}_{{option.id}}"{% if option.id|stringformat:"s" in exercise.saved_answer.closed_part %} checked="checked"{% endif %}>
+                    <label for="e{{no}}_{{option.id}}">{% if show_answers and option.id in exercise.answer %}<strong>{% endif %}{{option.text|safe}}{% if show_answers and option.id in exercise.answer %}</strong>{% endif %}</label>
                 </li>
             {% endfor %}
         </ol>
     </div>
 
-</div>
\ No newline at end of file
+    {% if exercise.open_part %}
+    <div class="open_part">
+        <div class="description">
+            {% for para in exercise.open_part %}
+                <p class="paragraph">
+                    {{para}}
+                </p>
+            {% endfor %}
+        </div>
+        <textarea style="width: 100%; margin-top:10px;" rows="{{exercise.open_part_rows|default:10}}">{{ exercise.saved_answer.open_part }}</textarea>
+    </div>
+    {% endif %}
+
+</div>