|
Revision 1, 1.8 KB
(checked in by alex, 4 years ago)
|
- initial djangoquest import
|
| Line | |
|---|
| 1 | {% extends "questionnaire/main.html" %} |
|---|
| 2 | |
|---|
| 3 | {% block main %} |
|---|
| 4 | |
|---|
| 5 | <script type="text/javascript"> |
|---|
| 6 | |
|---|
| 7 | var question_array = new Array({% for category in categories %}{% for question in category.questions %}"{{question.id}}" ,{% endfor %}{% endfor %}""); |
|---|
| 8 | var question_text_array = new Array({% for category in categories %}{% for question in category.questions %}"{{question.text}}" ,{% endfor %}{% endfor %}""); |
|---|
| 9 | |
|---|
| 10 | var open_question = ""; |
|---|
| 11 | |
|---|
| 12 | </script> |
|---|
| 13 | |
|---|
| 14 | <div class='window'> |
|---|
| 15 | |
|---|
| 16 | <div class='window_title'> |
|---|
| 17 | My Questionnaire |
|---|
| 18 | </div> |
|---|
| 19 | |
|---|
| 20 | <div class='window_body'> |
|---|
| 21 | |
|---|
| 22 | <form name='question' method='post' action='/questionnaire/questionnaire/'> |
|---|
| 23 | |
|---|
| 24 | {% for category in categories %} |
|---|
| 25 | <p>{{ category.text }} |
|---|
| 26 | |
|---|
| 27 | <ul style='list-style-type: none;'> |
|---|
| 28 | {% for question in category.questions %} |
|---|
| 29 | <li> |
|---|
| 30 | <strong>{{ question.text }}</strong> |
|---|
| 31 | <br /> |
|---|
| 32 | |
|---|
| 33 | {% ifequal question.type 4 %} |
|---|
| 34 | {% include "questionnaire/open_textarea.html" %} |
|---|
| 35 | {% endifequal %} |
|---|
| 36 | |
|---|
| 37 | {% ifequal question.type 3 %} |
|---|
| 38 | {% include "questionnaire/multiplechoice-multipleanswers.html" %} |
|---|
| 39 | {% endifequal %} |
|---|
| 40 | |
|---|
| 41 | {% ifequal question.type 2 %} |
|---|
| 42 | {% include "questionnaire/multiplechoice.html" %} |
|---|
| 43 | {% endifequal %} |
|---|
| 44 | |
|---|
| 45 | {% ifequal question.type 1 %} |
|---|
| 46 | {% include "questionnaire/open.html" %} |
|---|
| 47 | {% endifequal %} |
|---|
| 48 | <p /> |
|---|
| 49 | </li> |
|---|
| 50 | {% endfor %} |
|---|
| 51 | </ul> |
|---|
| 52 | <p /> |
|---|
| 53 | {% endfor %} |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | <div align='right' > |
|---|
| 57 | <input class='submit' type='button' value='{% if last %}Complete questionnaire{%else %}Next page{% endif %}' onclick='v = check_complete(question_array, "question"); if (v === true) { document.question.submit(); } else { t = get_text_from_id(question_text_array, v); alert("Not all questions have been answered. Please fill in all questions before submitting your answers.\n\nCheck the question:\n" + t); }' /> |
|---|
| 58 | </div> |
|---|
| 59 | |
|---|
| 60 | </form> |
|---|
| 61 | |
|---|
| 62 | </div> <!-- window body --> |
|---|
| 63 | |
|---|
| 64 | </div> <!-- window --> |
|---|
| 65 | |
|---|
| 66 | {% endblock %} |
|---|