Slightly better survey layout

This commit is contained in:
ebolam
2022-12-14 18:43:14 -05:00
parent df33d8f5f5
commit 6bb6230e7d
2 changed files with 44 additions and 35 deletions

View File

@@ -30,8 +30,10 @@ def index():
results[question][random_num]['A'] = a
results[question][random_num]['B'] = b
a = data[data_type][a]
b = data[data_type][b]
a = random.choice(data[data_type][a])
b = random.choice(data[data_type][b])
results[question][random_num]['A value'] = a
results[question][random_num]['B value'] = b
return flask.render_template('survey.html', question=question, a=a, b=b, random_num=random_num)

View File

@@ -36,49 +36,56 @@
<h1><center>{{ question }}</center></h1>
</div>
<input type=hidden id="id" value="{{ random_num }}"/>
<table>
<tr>
<td>
<h2><center><input type=radio autocomplete="off" name="answer" id="A" onclick="send_results();">A</center></h2>
</td>
<td>
<h2><center><input type=radio autocomplete="off" name="answer" id="B" onclick="send_results();">B</center></h2>
</td>
<td>
<h2><center><input type=radio autocomplete="off" name="answer" id="C" onclick="send_results();">About the same</center></h2>
</td>
<td>
<h2><center><input type=radio autocomplete="off" name="answer" id="D" onclick="send_results();">A is incoherent</center></h2>
</td>
<td>
<h2><center><input type=radio autocomplete="off" name="answer" id="E" onclick="send_results();">B is incoherent</center></h2>
</td>
<td>
<h2><center><input type=radio autocomplete="off" name="answer" id="F" onclick="send_results();">Both are incoherent</center></h2>
</td>
</tr>
<tr>
<td>
<table border=1>
{% for item in a %}
<tr>
<td>
{{ item }}
</td>
</tr>
{% endfor %}
</table>
<input type=radio autocomplete="off" name="answer" id="A" onclick="send_results();">
</td>
<td>
<table border=1>
{% for item in b %}
{{ a }}
</td>
</tr>
<tr>
<td>
{{ item }}
<input type=radio autocomplete="off" name="answer" id="B" onclick="send_results();">
</td>
<td>
{{ b }}
</td>
</tr>
{% endfor %}
</table>
<tr>
<td colspan=2>&nbsp;</td>
</tr>
<tr>
<td>
<input type=radio autocomplete="off" name="answer" id="C" onclick="send_results();">
</td>
<td>
About the same
</td>
</tr>
<tr>
<td>
<input type=radio autocomplete="off" name="answer" id="D" onclick="send_results();">
</td>
<td>
The first is incoherent
</td>
</tr>
<tr>
<td>
<input type=radio autocomplete="off" name="answer" id="E" onclick="send_results();">
</td>
<td>
The second is incoherent
</td>
</tr>
<tr>
<td>
<input type=radio autocomplete="off" name="answer" id="F" onclick="send_results();">
</td>
<td>
Both the first and second are incoherent
</td>
</tr>
</table>