disable csrf and other stuff for demo tomorrow
This commit is contained in:
parent
d3124f7caa
commit
c600c43d79
@ -30,8 +30,9 @@ db = SQLAlchemy(model_class=Base)
|
||||
app = Flask(__name__)
|
||||
# configure the database, give it a path (it will be in the instances folder)
|
||||
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///database.db"
|
||||
app.config["PERMANENT_SESSION_LIFETIME"] = 10800 #3 Stunden, 10800 sekunden
|
||||
db.init_app(app)
|
||||
csrf = CSRFProtect(app) #enable CSRF protection globally
|
||||
#csrf = CSRFProtect(app) #enable CSRF protection globally
|
||||
|
||||
#set the secret key (TODO change this for final deployment)
|
||||
app.secret_key = b"29fe9e8edd407c5491d4f1c05632d9fa33e26ed8734a3f5e080ebac3772a555a"
|
||||
@ -157,6 +158,7 @@ except SQLAlchemyError as e:
|
||||
|
||||
@app.route("/teststart", methods=["GET", "POST"])
|
||||
def teststartpage():
|
||||
session.permanent = False
|
||||
if not "slaeform_device_id" in session:
|
||||
# If this device was not seen, remember it.
|
||||
new_device_id = uuid.uuid4()
|
||||
|
@ -1,20 +1,52 @@
|
||||
{
|
||||
"Block_1":{
|
||||
"type": "SinglePage",
|
||||
"template": "startpage.html",
|
||||
"database_table" :{
|
||||
"TableName": "Datenschutzerklaerung",
|
||||
"Fields": {
|
||||
}
|
||||
}
|
||||
},
|
||||
"Block 2":{
|
||||
"Block 0":{
|
||||
"type": "TaskTemplate",
|
||||
"tempalte": "tempaltetest1.html",
|
||||
"name" : "Block2Responses",
|
||||
"database_table": {
|
||||
"TableName": "Datenschutzerklaerung",
|
||||
"Fields": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,55 +1,4 @@
|
||||
{
|
||||
"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",
|
||||
|
@ -210,8 +210,9 @@ iframe { /* center the iframe, mostly unnecessary */
|
||||
.dv_button {
|
||||
display: inline-block;
|
||||
width: 10%;
|
||||
padding: 20px 20px;
|
||||
margin: auto;
|
||||
padding: 20px 5px;
|
||||
margin: auto 10px;
|
||||
text-align: center;
|
||||
}
|
||||
.dv_half {
|
||||
display: inline-block;
|
||||
@ -220,6 +221,7 @@ iframe { /* center the iframe, mostly unnecessary */
|
||||
}
|
||||
.double_video_container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Likert stuff */
|
||||
|
@ -35,9 +35,9 @@
|
||||
allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: inline-block;">
|
||||
|
||||
<button class="dv_button">Play Videos</button>
|
||||
</div>
|
||||
|
||||
<div class="dv_half">
|
||||
<div class="iframe-container">
|
||||
<iframe class="center" src="{{ video_url2 }}" title="YouTube video player" frameborder="0"
|
||||
|
Loading…
Reference in New Issue
Block a user