Some CSS Imporvements

This commit is contained in:
Jan
2024-06-05 20:55:54 +02:00
parent 71590b425b
commit bd750eb9a2
2 changed files with 96 additions and 45 deletions

View File

@@ -1,19 +1,20 @@
<!DOCTYPE html>
<html>
{% macro single_video(video_url, embed="yt", title="",width="560", height="315", class="center", code="<p>No code given</p>") -%}
{% if (embed == "yt") %}
<div class={{center}}>
{% if (title != "") %}
<h3>{{title}}</h3>
{% endif %}
<iframe width={{width}} height={{height}} 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}}
{% macro single_video(video_url, embed="yt", title="",width="560", height="315", class="center", code="<p>No code given
</p>") -%}
{% if (embed == "yt") %}
<div class={{center}}>
{% if (title != "") %}
<h3>{{title}}</h3>
{% endif %}
<iframe width={{width}} height={{height}} 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 required(question) -%}
@@ -23,51 +24,61 @@ required
{%- endmacro %}
{% macro input(name, value='', type='text', size=20) -%}
<input type="{{ type }}" name="{{ name }}" value="{{
<input type="{{ type }}" name="{{ name }}" value="{{
value|e }}" size="{{ size }}">
{%- endmacro %}
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css')}}"" /> <!-- styles.css {{ url_for('static', filename='styles.css')}}-->
<title>Testform</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<link rel=" shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
</head>
<body>
<div class="container">
<h2>Stimulus part</h2>
{% if (stimulus_type == "single_video") %}
{{ single_video(**stimulus_configuration) }}
{% elif (False) %}
<h2>Stimulus part</h2>
{% if (stimulus_type == "single_video") %}
{{ single_video(**stimulus_configuration) }}
{% elif (False) %}
{% else %}
<p>Error: Block {{ stimulus["type"] }} could not be loaded!</p>
{% endif %}
{% else %}
<p>Error: Block {{ stimulus["type"] }} could not be loaded!</p>
{% endif %}
<h2>Questions</h2>
<form action="http://localhost:5000/send_json" method="post">
{% for question in questions %}
{% if (questions[question]["type"] == "likert") %}
<div class="likercontainer">
<div class="likert">
{% for point in questions[question]["points"] %}
<label><input name="likertscale" type="radio" value="{{ questions[question]['points'][point]['value'] }}" {{required(questions[question])}}/><span>{{ questions[question]['points'][point]['text'] }}</span></label>
{% endfor %}
<h2>Questions</h2>
<form action="http://localhost:5000/send_json" method="post">
{% for question in questions %}
{% if (questions[question]["type"] == "likert") %}
<div class="likercontainer">
<div class="likert">
{% for point in questions[question]["points"] %}
<label><input name="likertscale" type="radio"
value="{{ questions[question]['points'][point]['value'] }}"
{{required(questions[question])}} /><span>{{ questions[question]['points'][point]['text']
}}</span></label>
{% endfor %}
</div>
</div>
{% elif (questions[question]["type"] == "textinput") %}
<div class="textarea-container">
<label class="textarea-label" for="{{ questions[question]['name'] }}">Additional Feedback: </label>
<textarea id="{{ questions[question]['name'] }}" name="{{ questions[question]['name'] }}" rows="6"
cols="60" maxlength="{{ questions[question]['size'] }}"
{{required(questions[question])}}></textarea>
</div>
{% else %}
<p>Error: Block {{config["question 1"]["blocks"][block]["type"]}} could not be loaded!</p>
{% endif %}
{% endfor %}
<div class="button-container">
<p><input id="submitbutton" type="submit" value="submit" ; /></p>
</div>
</form>
</div>
</div>
{% elif (questions[question]["type"] == "textinput") %}
<label for="{{ questions[question]['name'] }}">Additional Feedback: </label>
<textarea id="{{ questions[question]['name'] }}" name="{{ questions[question]['name'] }}" rows="3" cols="30" maxlength="{{ questions[question]['size'] }}" {{required(questions[question])}}></textarea>
{% else %}
<p>Error: Block {{config["question 1"]["blocks"][block]["type"]}} could not be loaded!</p>
{% endif %}
{% endfor %}
<p><input id="submitbutton" type = "submit" value = "submit";/></p>
</form>
</body>
</html>
</html>