CSRF removed, double video now working with everything

This commit is contained in:
Jan Dickmann 2024-06-24 13:30:51 +02:00
parent 69220b836a
commit c9c3bfce12
7 changed files with 56 additions and 6 deletions

View File

@ -38,6 +38,7 @@ app.secret_key = b"29fe9e8edd407c5491d4f1c05632d9fa33e26ed8734a3f5e080ebac3772a5
UPLOAD_FOLDER = 'uploads'
#csrf = CSRFProtect(app) #enable CSRF protection globally
@ -338,7 +339,7 @@ def sendpage_json():
session_user_id = session["slaeform_user_id"]
new_id = uuid.uuid4()
date = datetime.today()
stimulus_name = session["current_stimulus_name"]
stimulus_name = str(session["current_stimulus_name"])
new_entry = db_tables[table_name](id=new_id,user_id = session_user_id,date_created = date,stimulus_name=stimulus_name)

View File

@ -1,4 +1,55 @@
{
"Block 0":{
"type": "TaskTemplate",
"tempalte": "standard_template.html",
"stimuli":{
"type":"double_video",
"list_1":{
"video_1":"https://www.youtube-nocookie.com/embed/VtnwHmabyzo?si=H3rrG-GHtlSymR70",
"video_2":"https://www.youtube-nocookie.com/embed/EL76Ok4r0aQ?si=hqUm8eUUfX39NN4L",
"video_3":"https://www.youtube-nocookie.com/embed/XTMIomsXxKM?si=r2zB6OKERH6Jdpi6"
},
"list_2":{
"video_1":"https://www.youtube-nocookie.com/embed/VtnwHmabyzo?si=H3rrG-GHtlSymR70",
"video_2":"https://www.youtube-nocookie.com/embed/EL76Ok4r0aQ?si=hqUm8eUUfX39NN4L",
"video_3":"https://www.youtube-nocookie.com/embed/XTMIomsXxKM?si=r2zB6OKERH6Jdpi6"
},
"configuration":{
"embed":"yt"
}
},
"questions":{
"question1":{
"type": "likert",
"name": "likertscale",
"text": "How would you rate this video?",
"required": "true",
"points":{
"p1":{
"value":"1",
"text":"I dont like it at all"
},
"p2":{
"value":"2",
"text":"I am indifferent"
},
"p3":{
"value":"3",
"text":"I like it a lot"
}
}
}
},
"database_table" :{
"table_name": "double_video_test",
"fields": {
"likertscale":{
"type": "integer",
"nullable": "false"
}
}
}
},
"Block 1":{
"type": "TaskTemplate",
"tempalte": "standard_template.html",

View File

View File

@ -226,7 +226,7 @@ iframe { /* center the iframe, mostly unnecessary */
/* Likert stuff */
.likert {
--likert-rows: 5;
/* --likert-rows: 5;*/
margin: auto;
text-align: center;
display: inline-grid;

View File

@ -108,7 +108,7 @@ step={{question["step"]}}
{% if (questions[question]["type"] == "likert") %}
<div class="likercontainer">
<h3>{{ questions[question]['text']}}</h3>
<div class="likert">
<div class="likert" style="--likert-rows: {{ questions[question]['points']|length() }}">
{% for point in questions[question]["points"] %}
<label>
<input name="{{ questions[question]['name']}}" type="radio"

View File

@ -11,7 +11,6 @@
<div class="container">
<h2>Hello! Thank you for participating in our study!</h2>
<form action="http://localhost:5000/start" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<label for="terms-and-conditions">
<input class="inline" id="terms-and-conditions" type="checkbox" required name="terms-and-conditions" /> I accept the +terms and conditions</a>
</label>

View File

@ -20,9 +20,8 @@
</p>
</div>
<form class="dsgvoform" action="http://localhost:5000/teststart" method="post">
<label for="terms-and-conditions">
<input class="inline" id="terms-and-conditions" type="checkbox" required name="terms-and-conditions" /> I accept the +terms and conditions</a>
<input class="inline" id="terms-and-conditions" type="checkbox" required name="terms-and-conditions" /> I accept the +terms and conditions
</label>
<div class="button-container">
<input id="submitbutton" type = "submit" value = "submit" />