csrf added to startpage and first steps to double video

This commit is contained in:
2024-06-20 17:09:08 +02:00
parent bda8907a97
commit d3124f7caa
6 changed files with 135 additions and 13 deletions

View File

@@ -4,14 +4,49 @@
</p>") -%}
{% if (embed == "yt") %}
{% if (title != "") %}
<h3>{{title}}</h3>
{% endif %}
<div class="iframe-container">
<iframe class="center" src="{{ video_url }}" title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
{% if (title != "") %}
<h3>{{title}}</h3>
{% endif %}
<div class="iframe-container">
<iframe class="center" src="{{ video_url }}" title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</div>
{% else %}
{{code}}
{% endif %}
{%- endmacro %}
{% macro double_video(video_url1, video_url2, embed="yt", title="",width="560", height="315", class="center", code="<p>
No code given
</p>") -%}
{% if (embed == "yt") %}
{% if (title != "") %}
<h3>{{title}}</h3>
{% endif %}
<div class="double_video_container">
<div class="dv_half">
<div class="iframe-container">
<iframe class="center" src="{{ video_url1 }}" title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
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"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</div>
</div>
</div>
{% else %}
{{code}}
@@ -59,6 +94,8 @@ step={{question["step"]}}
<div class="container">
{% if (stimulus_type == "single_video") %}
{{ single_video(**stimulus_configuration) }}
{% elif (stimulus_type == "double_video") %}
{{ double_video(**stimulus_configuration) }}
{% elif (stimulus_type == "empty") %}
{% else %}
@@ -66,7 +103,7 @@ step={{question["step"]}}
{% endif %}
<form class="formlayout" id="question_form" action="http://localhost:5000/send_json" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
{% for question in questions %}
{% if (questions[question]["type"] == "likert") %}
<div class="likercontainer">