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