change exercises
[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.instruction %}
16         <span class="instruction">{{ exercise.instruction }}</span>
17     {% endif %}
18
19     {% if exercise.fields %}
20         {% for field in exercise.fields %}
21             <div class="wtem-open-field">
22                 <label class="wtem-caption">{{field.caption|safe}} <span class="label_suffix"></span></label>
23                 {% if field.type == 'file' %}
24                     <div style="margin: 15px auto; width:300px;">
25                         <input style="float: left;" type="file" name="attachment_for_{{exercise.id}}__{{field.id}}"/>
26                         <div style="clear:both;"></div>
27                     </div>
28                 {% else %}
29                     <textarea style="width: 100%;" rows="{{field.rows|default:10}}" data-field-id="{{field.id}}"
30                               {% if field.max_length %}maxlength="{{field.max_length}}"{% endif %}
31                               {% if field.input_id %}id="{{field.input_id}}"{% endif %}></textarea>
32                 {% endif %}
33             </div>
34         {% endfor %}
35     {% else %}
36         <textarea style="width: 100%; margin-top:10px;" rows="{{field.rows|default:10}}"
37                   {% if field.max_length %}maxlength="{{field.max_length}}"{% endif %}
38                   {% if field.input_id %}id="#{{field.input_id}}"{% endif %}></textarea>
39     {% endif %}
40
41     {% if exercise.description_after %}
42         <div class="description">
43             {% autoescape off %}
44             {% for para in exercise.description_after %}
45                 <p class="paragraph">
46                     {{para}}
47                 </p>
48             {% endfor %}
49             {% endautoescape %}
50         </div>
51     {% endif%}
52
53 </div>