From ab27d709468f57e3255cd1d2719ffd7f7f78f4c1 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 7 Oct 2024 14:05:43 +0200 Subject: [PATCH 1/5] More fixes, those are the final texts !!! --- slaeforms/app.py | 2 +- slaeforms/templates/startpage.html | 2 +- slaeforms/templates/studytest.html | 5 +---- slaeforms/userstudy1.json | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/slaeforms/app.py b/slaeforms/app.py index 3c77930..e64d73a 100644 --- a/slaeforms/app.py +++ b/slaeforms/app.py @@ -624,7 +624,7 @@ def login(): if request.method == "POST": if request.form["password"] == PASSWORD: session["logged_in"] = True - return redirect("/") + return redirect(url_for("all_links")) return render_template("login.html") diff --git a/slaeforms/templates/startpage.html b/slaeforms/templates/startpage.html index 94dc217..222f18b 100644 --- a/slaeforms/templates/startpage.html +++ b/slaeforms/templates/startpage.html @@ -48,7 +48,7 @@ gezeigt.

- Das Laden der Seiten kann manchmal einige Sekunden dauern, bei schlechtem Internet auch länger. Haben sie bitte Geduld. Falls es zu einem Fehler kommt und ein Video nicht geladen wird, versuchen sie die Seite neu zu laden. + Das Laden der Seiten kann manchmal einige Sekunden dauern. Falls es zu einem Fehler kommen sollte und ein Video nicht geladen wird, versuchen Sie bitte die Seite neu zu laden.

Für jeden Teil der Studie gibt es ein Video, das die Fragestellung und die Antwortmöglichkeiten in diff --git a/slaeforms/templates/studytest.html b/slaeforms/templates/studytest.html index 70972d7..9fdb08a 100644 --- a/slaeforms/templates/studytest.html +++ b/slaeforms/templates/studytest.html @@ -21,10 +21,7 @@

- - +
diff --git a/slaeforms/userstudy1.json b/slaeforms/userstudy1.json index d29f325..5c7c02a 100644 --- a/slaeforms/userstudy1.json +++ b/slaeforms/userstudy1.json @@ -8,9 +8,8 @@ "template": "standard_template.html", "stimuli": { "type": "single_video", - "order": "random", "list": { - "video_1": "videos/platzhalter-video.mp4" + "video_1": "platzhalter-video.mp4" }, "configuration": { "embed": "no" -- 2.45.2 From 2702ce3c3c5f17f785f430df44675d84c4c1de3f Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 13 Oct 2024 15:18:14 +0200 Subject: [PATCH 2/5] password is checked via hash now --- slaeforms/app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/slaeforms/app.py b/slaeforms/app.py index e64d73a..79b5c1c 100644 --- a/slaeforms/app.py +++ b/slaeforms/app.py @@ -15,9 +15,9 @@ from sqlalchemy.orm import DeclarativeBase import os import csv from zipfile import ZipFile +import hashlib -random_order = True -# activate environment: cd C:\Users\Jan\Google Drive\Master Stuff\Code\SLAEForms Testing\.venv\Scripts\ +# activate environment: cd C:\...\...\....\...\Code\SLAEForms Testing\.venv\Scripts\ # then this: activate #SETUP-------------------------------------------------- @@ -41,7 +41,7 @@ app.secret_key = b"29fe9e8edd407c5491d4f1c05632d9fa33e26ed8734a3f5e080ebac3772a5 UPLOAD_FOLDER = 'uploads' EXPORT_FOLDER = 'exports' -PASSWORD = '#1ACGmsjd' +PASSWORD = 'd5aff9fc14d1f20f4ccddaa8b4f2c1765228b74ed0b1dfb868bf1064e0d655e2' CONFIGFILE = 'userstudy1.json' # CONFIGFILE = 'test.json' # CONFIGFILE = 'default.json' @@ -622,7 +622,8 @@ def show_tables(): def login(): if request.method == "POST": - if request.form["password"] == PASSWORD: + pwhash = hashlib.sha256(request.form["password"].encode('utf-8')).hexdigest() + if pwhash == PASSWORD: session["logged_in"] = True return redirect(url_for("all_links")) -- 2.45.2 From 52db4cc0fbe43164ed487d21220dcc24d89b768c Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 13 Oct 2024 15:22:18 +0200 Subject: [PATCH 3/5] fixed small bug --- slaeforms/app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/slaeforms/app.py b/slaeforms/app.py index 79b5c1c..b5288c0 100644 --- a/slaeforms/app.py +++ b/slaeforms/app.py @@ -191,9 +191,10 @@ def startpage(): case "single_video": order = list(config[name]["stimuli"]["list"]) # order = list of simuli keys print("order: ",order) - if config[name]["stimuli"]["order"] == "random": - random.shuffle(order) #in random order - session["block_order"][name] = order + if "order" in config[name]["stimuli"]: + if config[name]["stimuli"]["order"] == "random": + random.shuffle(order) #in random order + session["block_order"][name] = order case "double_video": order = [] # order = list of stimuli keys list_1 = list(config[name]["stimuli"]["list_1"]) -- 2.45.2 From 23e6ee55c620bafea5dac5c22e64058c7bf396ed Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 13 Oct 2024 15:29:30 +0200 Subject: [PATCH 4/5] multiple choice bug fixed --- slaeforms/templates/standard_template.html | 6 ++++-- slaeforms/userstudy1.json | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/slaeforms/templates/standard_template.html b/slaeforms/templates/standard_template.html index 56853b5..3a88bda 100644 --- a/slaeforms/templates/standard_template.html +++ b/slaeforms/templates/standard_template.html @@ -262,7 +262,8 @@ step={{question["step"]}} {% elif (questions[question]["type"] == "multiplechoice") %}
-
diff --git a/slaeforms/userstudy1.json b/slaeforms/userstudy1.json index 5c7c02a..2536c5c 100644 --- a/slaeforms/userstudy1.json +++ b/slaeforms/userstudy1.json @@ -8,6 +8,7 @@ "template": "standard_template.html", "stimuli": { "type": "single_video", + "order": "", "list": { "video_1": "platzhalter-video.mp4" }, -- 2.45.2 From 728c282a3dfd0fb958d37ab15efaafbad6f7be19 Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 13 Oct 2024 15:42:25 +0200 Subject: [PATCH 5/5] try to remove database via git --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5b91ab0..3691106 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ *.pyc __pycache__/ -instance/ + uploads/ zip_exports/ -- 2.45.2