a3110f68fbf1891e2657ddce3bd203a30df0d5e3
[edumed.git] / wtem / templates / wtem / exercises / open.html
1 <div class="exercise-wtem" data-type="open" data-id="{{exercise.id}}">
2
3     {% include "wtem/exercises/exercise_no.html" %}
4
5     <div class="description">
6         {% autoescape off %}
7         {% for para in exercise.description %}
8             <p class="paragraph">
9                 {{para}}
10             </p>
11         {% endfor %}
12         {% endautoescape %}
13     </div>
14
15     {% if exercise.fields %}
16         {% for field in exercise.fields %}
17             <div class="wtem-open-field">
18                 <label class="wtem-caption">{{field.caption|safe}} <span class="label_suffix"></span></label>
19                 {% if field.type == 'file' %}
20                     <div style="margin: 15px auto; width:300px;">
21                         <input style="float: left;" type="file" name="attachment_for_{{exercise.id}}__{{field.id}}"/>
22                         <div style="clear:both;"></div>
23                     </div>
24                 {% else %}
25                     <textarea style="width: 100%;" rows="{{field.rows|default:10}}" data-field-id="{{field.id}}"
26                               {% if field.max_length %}maxlength="{{field.max_length}}"{% endif %}
27                               {% if field.input_id %}id="{{field.input_id}}"{% endif %}></textarea>
28                 {% endif %}
29             </div>
30         {% endfor %}
31     {% else %}
32         <textarea style="width: 100%; margin-top:10px;" rows="{{field.rows|default:10}}"
33                   {% if field.max_length %}maxlength="{{field.max_length}}"{% endif %}
34                   {% if field.input_id %}id="#{{field.input_id}}"{% endif %}></textarea>
35     {% endif %}
36
37     {% if exercise.description_after %}
38         <div class="description">
39             {% autoescape off %}
40             {% for para in exercise.description_after %}
41                 <p class="paragraph">
42                     {{para}}
43                 </p>
44             {% endfor %}
45             {% endautoescape %}
46         </div>
47     {% endif%}
48
49 </div>