diff --git a/slaeforms/app.py b/slaeforms/app.py index 2ace088..72f4fd2 100644 --- a/slaeforms/app.py +++ b/slaeforms/app.py @@ -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) diff --git a/slaeforms/default.json b/slaeforms/default.json index f1046ad..729e499 100644 --- a/slaeforms/default.json +++ b/slaeforms/default.json @@ -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", diff --git a/slaeforms/static/likertscript.js b/slaeforms/static/likertscript.js new file mode 100644 index 0000000..e69de29 diff --git a/slaeforms/static/styles.css b/slaeforms/static/styles.css index b4c74bf..3b10bb7 100644 --- a/slaeforms/static/styles.css +++ b/slaeforms/static/styles.css @@ -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; diff --git a/slaeforms/templates/standard_template.html b/slaeforms/templates/standard_template.html index 8f876fe..6df34d5 100644 --- a/slaeforms/templates/standard_template.html +++ b/slaeforms/templates/standard_template.html @@ -108,7 +108,7 @@ step={{question["step"]}} {% if (questions[question]["type"] == "likert") %}

{{ questions[question]['text']}}

-
+
{% for point in questions[question]["points"] %}
-