From 6bb6230e7d6cd0c1e1fc0753a8fe4afa5d1e3cb0 Mon Sep 17 00:00:00 2001 From: ebolam Date: Wed, 14 Dec 2022 18:43:14 -0500 Subject: [PATCH] Slightly better survey layout --- survey_run.py | 6 ++-- templates/survey.html | 73 ++++++++++++++++++++++++------------------- 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/survey_run.py b/survey_run.py index d7dcc466..80b24bad 100644 --- a/survey_run.py +++ b/survey_run.py @@ -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) diff --git a/templates/survey.html b/templates/survey.html index 9bb39544..a72a6b42 100644 --- a/templates/survey.html +++ b/templates/survey.html @@ -36,49 +36,56 @@

{{ question }}

- +
- - - - + + + + + + + + + + + + + + + + + + +
-

A

+
-

B

-
-

About the same

-
-

A is incoherent

-
-

B is incoherent

-
-

Both are incoherent

+ {{ a }}
- - {% for item in a %} - - - - {% endfor %} -
- {{ item }} -
+
- - {% for item in b %} - - - - {% endfor %} -
- {{ item }} -
+ {{ b }} +
 
+ + + About the same +
+ + + The first is incoherent +
+ + + The second is incoherent +
+ + + Both the first and second are incoherent