changed database structure

This commit is contained in:
Ville Rantanen
2018-12-05 10:47:58 +02:00
parent 2910cc2186
commit 59c371cd79
5 changed files with 108 additions and 112 deletions

View File

@@ -8,20 +8,19 @@ Thank you for the vote!
<h3>Current report</h3>
<div id="questions">
{% for question in questions %}
{% for qa_item in qa %}
<div class = "question autoformat">
<h2>{{ question|safe }}</h2>
<h2>{{ qa_item[0]|safe }}</h2>
<ul>
{% for choice in answers[question].answers %}
{% if answers[question].answer_type == "single" %}
<li class = "summary_single">{{ choice }}: {{ answers[question].answers[choice] }}
{% for answer in qa_item[1] %}
{% if answer.answer_type == "single" %}
<li class = "summary_single">{{ answer.answer }}: {{ answer.count }} ({{ answer.percent }}%)
{% endif %}
{% if answers[question].answer_type == "multiple" %}
<li class = "summary_multiple">{{ choice }}: {{ answers[question].answers[choice] }}
{% if answer.answer_type == "multiple" %}
<li class = "summary_multiple">{{ answer.answer }}: {{ answer.count }} ({{ answer.percent }}%)
{% endif %}
{% if answers[question].answer_type == "open" %}
<li class = "summary_open">"{{ choice }}"
{% if answer.answer_type == "open" %}
<li class = "summary_open">"{{ answer.answer }}"
{% endif %}
{% endfor %}
</ul>