diff --git a/slaeforms/app.py b/slaeforms/app.py index 30a7a9c..af431d1 100644 --- a/slaeforms/app.py +++ b/slaeforms/app.py @@ -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() diff --git a/slaeforms/defaul_wip.json b/slaeforms/defaul_wip.json index 5d4b74f..0f7123e 100644 --- a/slaeforms/defaul_wip.json +++ b/slaeforms/defaul_wip.json @@ -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" + } } } } diff --git a/slaeforms/default.json b/slaeforms/default.json index 729e499..f1046ad 100644 --- a/slaeforms/default.json +++ b/slaeforms/default.json @@ -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", diff --git a/slaeforms/static/styles.css b/slaeforms/static/styles.css index e3a0de1..b4c74bf 100644 --- a/slaeforms/static/styles.css +++ b/slaeforms/static/styles.css @@ -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 */ diff --git a/slaeforms/templates/standard_template.html b/slaeforms/templates/standard_template.html index 6aea3f2..b4927ac 100644 --- a/slaeforms/templates/standard_template.html +++ b/slaeforms/templates/standard_template.html @@ -35,9 +35,9 @@ allowfullscreen> -