task.html 5.85 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
 <!-- Select form type -->

 {{page_num}}

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

Ossi Laine's avatar
Ossi Laine committed
101
102
  <div class="canvas-container">
  <span class="canvas-info"></span>
103
  <canvas id="embody-canvas" width="200" height="100" style="border: 1px solid blue;"  ></canvas>
Ossi Laine's avatar
Ossi Laine committed
104
  </div>
105
106

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

110
111
112
113
114
    <input id="canvas-data" type="hidden" value="" name="coordinates">

    <div class="row justify-content-md-center">
    <button type="button" class="btn btn-primary clear-button">Clear</button>
    </div>
115
116

    <div class="form-row text-center">
117
        <div class="centered col-12">
118
            <a class="btn btn-primary" href={{ url_for('task.quit') }} role="button">{{ _('Quit task') }}</a>
119
            <button type="button" class="btn btn-primary next-page">{{ _('Next page') }}</button>
120
121
122
        </div>
        <div class="col-12">
            <br>
123
            <p>{{ _("Reload the page if painting canvas didn't appear.") }} </p>
124
125
126
127
128
129
130
131
            <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
132
133
    {% for category in form.categories1 %}
        {% for scale in form.categories1[category] %}
Timo Heikkilä's avatar
Timo Heikkilä committed
134
135
136
137
138
            <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
139
140
                    <label for="customRange">{{ category[1] }}</label>
                    <input type="range" class="custom-range" id="customRange" name={{ category[0] }}>
Timo Heikkilä's avatar
Timo Heikkilä committed
141
142
143
144
                </h6>
                <h6 class="col-3 text-left mt-0 mb-0">
                {{ scale[1] }}
                </h6>
Timo Heikkilä's avatar
Timo Heikkilä committed
145
146
147
            </div>
         {% endfor %}   
    {% endfor %}
148
149
150
151
152
153
154
155
156
157
    <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
158
  </form>  
159
160
161
162

{% endif %}

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