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]['A'] = a
results[question][random_num]['B'] = b results[question][random_num]['B'] = b
a = data[data_type][a] a = random.choice(data[data_type][a])
b = data[data_type][b] 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) 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> <h1><center>{{ question }}</center></h1>
</div> </div>
<input type=hidden id="id" value="{{ random_num }}"/> <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> <table border=1>
{% for item in a %}
<tr> <tr>
<td> <td>
{{ item }} <input type=radio autocomplete="off" name="answer" id="A" onclick="send_results();">
</td>
</tr>
{% endfor %}
</table>
</td> </td>
<td> <td>
<table border=1> {{ a }}
{% for item in b %} </td>
</tr>
<tr> <tr>
<td> <td>
{{ item }} <input type=radio autocomplete="off" name="answer" id="B" onclick="send_results();">
</td>
<td>
{{ b }}
</td> </td>
</tr> </tr>
{% endfor %} <tr>
</table> <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> </td>
</tr> </tr>
</table> </table>