task.html 5.41 KB
Newer Older
Timo Heikkilä's avatar
Timo Heikkilä committed
1
2
3
4
5
6
{% extends "base.html" %}
{% block content %}

<br>    

{% if session['randomization']=='Off' %}
7
8
9
10

<!-- TODO change session['type'] TO stimulus['type'] 
     because session should have multiple type of stimuli!!!
 -->
11

Timo Heikkilä's avatar
Timo Heikkilä committed
12
13
14
15
    
    {% if session['type']=='text' %}
        <div class="container text-center mt-5 pt-5">
            {% for page in pages.items %}
Timo Heikkilä's avatar
Timo Heikkilä committed
16
            <h{{ stimulus_size_text }} class="text-center mt-5"><br>{{ page.text }}</h{{ stimulus_size_text }}>
Timo Heikkilä's avatar
Timo Heikkilä committed
17
18
            {% endfor %}
        </div>
Timo Heikkilä's avatar
Timo Heikkilä committed
19
           <br><br>
Timo Heikkilä's avatar
Timo Heikkilä committed
20
21
22
    {% endif %}
    
    {% if session['type']=='picture' %}
Timo Heikkilä's avatar
Timo Heikkilä committed
23
        <div class="container stimulus col-{{stimulus_size}} mt-5 pt-5">
Timo Heikkilä's avatar
Timo Heikkilä committed
24
25
26
27
28
29
30
            {% for page in pages.items %}
                <img src="/{{ page.media }}" class="img-fluid">
            {% endfor %}
        </div>
    {% endif %}
    
    {% if session['type']=='video' %}
Timo Heikkilä's avatar
Timo Heikkilä committed
31
        <div class="col-{{stimulus_size}} container stimulus mt-5 pt-5">
Timo Heikkilä's avatar
Timo Heikkilä committed
32
33
34
35
36
37
38
39
40
            {% for page in pages.items %}
                <div class="embed-responsive embed-responsive-16by9">
                    <iframe class="embed-responsive-item" src="/{{ page.media }}" allowfullscreen></iframe>
                </div>
            {% endfor %}
        </div>
    {% endif %}

    {% if session['type']=='audio' %}
Timo Heikkilä's avatar
Timo Heikkilä committed
41
        <div class="col-{{stimulus_size}} container stimulus mt-5 pt-5">
Timo Heikkilä's avatar
Timo Heikkilä committed
42
43
44
45
46
47
48
49
50
51
52
53
54
            {% for page in pages.items %}
                <div class="embed-responsive embed-responsive-16by9">
                    <iframe class="embed-responsive-item" src="/{{ page.media }}" allowfullscreen></iframe>
                </div>
            {% endfor %}
        </div>
    {% endif %}

{% else %}

    {% if session['type']=='text' %}
        <div class="container text-center mt-5 pt-5">
            {% for page in pages.items %}
Timo Heikkilä's avatar
Timo Heikkilä committed
55
            <h{{ stimulus_size_text }} class="text-center mt-5"><br>{{ randomized_stimulus.text }}</h{{ stimulus_size_text }}>
Timo Heikkilä's avatar
Timo Heikkilä committed
56
57
            {% endfor %}
        </div>
Timo Heikkilä's avatar
Timo Heikkilä committed
58
           <br><br>
Timo Heikkilä's avatar
Timo Heikkilä committed
59
60
61
    {% endif %}
    
    {% if session['type']=='picture' %}
Timo Heikkilä's avatar
Timo Heikkilä committed
62
        <div class="container stimulus col-{{stimulus_size}} mt-5 pt-5">
Timo Heikkilä's avatar
Timo Heikkilä committed
63
64
65
66
67
68
69
            {% for page in pages.items %}
                <img src="/{{ randomized_stimulus.media }}" class="img-fluid">
            {% endfor %}
        </div>
    {% endif %}
    
    {% if session['type']=='video' %}
Timo Heikkilä's avatar
Timo Heikkilä committed
70
        <div class="col-{{stimulus_size}} container stimulus mt-5 pt-5">
Timo Heikkilä's avatar
Timo Heikkilä committed
71
72
73
74
75
76
77
78
79
            {% for page in pages.items %}
                <div class="embed-responsive embed-responsive-16by9">
                    <iframe class="embed-responsive-item" src="/{{ randomized_stimulus.media }}" allowfullscreen></iframe>
                </div>
            {% endfor %}
        </div>
    {% endif %}

    {% if session['type']=='audio' %}
Timo Heikkilä's avatar
Timo Heikkilä committed
80
        <div class="col-{{stimulus_size}} container stimulus mt-5 pt-5">
Timo Heikkilä's avatar
Timo Heikkilä committed
81
82
83
84
85
86
87
88
89
90
            {% for page in pages.items %}
                <div class="embed-responsive embed-responsive-16by9">
                    <iframe class="embed-responsive-item" src="/{{ randomized_stimulus.media }}" allowfullscreen></iframe>
                </div>
            {% endfor %}
        </div>
    {% endif %}

{% endif %}
    
91
<br>
Timo Heikkilä's avatar
Timo Heikkilä committed
92
 
Timo Heikkilä's avatar
Timo Heikkilä committed
93
 <h4 class="text-center">{{ rating_instruction }}</h4>
Timo Heikkilä's avatar
Timo Heikkilä committed
94

95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
 <!-- Select form type -->

 {{page_num}}

 {% if form.__name__ == 'embody' %}

  <canvas id="embody-canvas" width="200" height="100" style="border: 1px solid blue;"  ></canvas>

  <img id="baseImage" class="" src={{ url_for('static', filename='img/dummy_600.png') }} />
  <form class="form-group mt-5" action="/task/embody/{{ page_num }}" method="post">

    <input id="canvas-data" type="hidden" value="" name="text">

    <div class="form-row text-center">
        <div class="col-12">
            <a class="btn btn-primary" href={{ url_for('task.quit') }} role="button">{{ _('Quit task') }}</a>
            <button type="submit" class="btn btn-primary">{{ _('Next page') }}</button>
        </div>
        <div class="col-12">
            <br>
            <p>{{ _('You can zoom in/out the page view by pressing ctrl+/ctrl- (Windows) or ⌘+/⌘- (Mac)') }} </p>
        </div>
    </div>    
  </form>  

{% elif form.__name__ == 'slider' %}

  <form class="form-group mt-5" action="/task/question/{{ page_num }}" method="post">
Timo Heikkilä's avatar
Timo Heikkilä committed
123
124
    {% for category in form.categories1 %}
        {% for scale in form.categories1[category] %}
Timo Heikkilä's avatar
Timo Heikkilä committed
125
126
127
128
129
            <div class="row form-group mt-0 mb-0">
                <h6 class="col-3 text-right mt-0 mb-0">
                    {{ scale[0] }} 
                </h6>
                <h6 class="col text-center mt-0 mb-0">
Timo Heikkilä's avatar
Timo Heikkilä committed
130
131
                    <label for="customRange">{{ category[1] }}</label>
                    <input type="range" class="custom-range" id="customRange" name={{ category[0] }}>
Timo Heikkilä's avatar
Timo Heikkilä committed
132
133
134
135
                </h6>
                <h6 class="col-3 text-left mt-0 mb-0">
                {{ scale[1] }}
                </h6>
Timo Heikkilä's avatar
Timo Heikkilä committed
136
137
138
            </div>
         {% endfor %}   
    {% endfor %}
139
140
141
142
143
144
145
146
147
148
    <div class="form-row text-center">
        <div class="col-12">
            <a class="btn btn-primary" href={{ url_for('task.quit') }} role="button">{{ _('Quit task') }}</a>
            <button type="submit" class="btn btn-primary">{{ _('Next page') }}</button>
        </div>
        <div class="col-12">
            <br>
            <p>{{ _('You can zoom in/out the page view by pressing ctrl+/ctrl- (Windows) or ⌘+/⌘- (Mac)') }} </p>
        </div>
    </div>    
Timo Heikkilä's avatar
Timo Heikkilä committed
149
  </form>  
150
151
152
153

{% endif %}

<script src="{{ url_for('static', filename='js/canvas.js') }}" ></script>
Timo Heikkilä's avatar
Timo Heikkilä committed
154
155
    
{% endblock %}