view_experiment.html 15.9 KB
Newer Older
Timo Heikkilä's avatar
Timo Heikkilä committed
1
2
3
4
5
6
7
8
9
10
11
12
13
{% extends "base.html" %}
{% block content %}

<h1 class="container mt-5 display-4 text-left"><br>Experiment info:</h1>
<br>


<div class="container col-12">
<table class="table">
  <tbody>


{% for exp in experiment_info %}
Timo Heikkilä's avatar
Timo Heikkilä committed
14
15


Timo Heikkilä's avatar
Timo Heikkilä committed
16
    <tr>
Timo Heikkilä's avatar
Timo Heikkilä committed
17
      <td nowrap>Name:</td>
Timo Heikkilä's avatar
Timo Heikkilä committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
      <td>{{ exp.name }}</td>
      <td>
      <button type="button" class="btn btn-primary btn-block btn-sm btn-dark" data-toggle="modal" data-target="#myModal-remove">Remove experiment</button>
      <!-- Modal -->
      <div class="modal fade" id="myModal-remove" role="dialog">
        <div class="modal-dialog modal-dialog-centered" id="modal-remove">
          <!-- Modal content-->
          <div class="modal-content modal-dialog-centered">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal">&times;</button>
              <h4 class="modal-title">Notice!</h4>
            </div>
            <div class="modal-body">
              <p>Are you sure you want to remove this experiment? All gathered ratings will be lost!</p>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
35
              <a class="btn btn-primary" href="{{ url_for('experiment.remove', exp_id=exp.idexperiment) }}" role="button">Yes, remove</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
36
37
38
39
40
41
42
43
            </div>
          </div>
        </div>
      </div>
      
      </td>
    </tr>
    <tr>
Timo Heikkilä's avatar
Timo Heikkilä committed
44
      <td nowrap>Status:</td>
Timo Heikkilä's avatar
Timo Heikkilä committed
45
46
47
      <td>{{ exp.status }}</td>
      <td>
    {% if exp.status == 'Hidden' %}      
48
49
      <a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.publish', exp_id=exp.idexperiment) }}" role="button">Publish (visible)</a>
      <a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.private', exp_id=exp.idexperiment) }}" role="button">Publish (private)</a>
50
      </td>
Timo Heikkilä's avatar
Timo Heikkilä committed
51
    {% endif %}
52
    {% if exp.status != 'Hidden' %}      
53
      <a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.hide', exp_id=exp.idexperiment) }}" role="button">Unpublish</a></td>
Timo Heikkilä's avatar
Timo Heikkilä committed
54
55
    {% endif %}
    </tr>
Timo Heikkilä's avatar
Timo Heikkilä committed
56

Timo Heikkilä's avatar
Timo Heikkilä committed
57
    <tr>
Timo Heikkilä's avatar
Timo Heikkilä committed
58
59
60
      <td nowrap>Creator:</td>
      <td>{{ exp.creator_name }} - {{ exp.creation_time }}</td>
      <td nowrap></td>
Timo Heikkilä's avatar
Timo Heikkilä committed
61
62
    </tr>
    <tr>
Timo Heikkilä's avatar
Timo Heikkilä committed
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
      <td nowrap>Language:</td>
      <td>{{ exp.language }}</td>
      <td nowrap></td>
    </tr>
     <tr>
      <td nowrap>Stimulus type:</td>
      <td>{{ mtype.type }}</td>
      <td nowrap></td>
    </tr>
     <tr>
      <td nowrap>Stimulus size:</td>
      <td>{{ exp.stimulus_size }}</td>
      <td nowrap>
      </td>
    </tr>

    <tr>
      <td nowrap>Trial randomization:</td>
Timo Heikkilä's avatar
Timo Heikkilä committed
81
      <td>{{ exp.randomization }}</td>
Timo Heikkilä's avatar
Timo Heikkilä committed
82
      <td nowrap>
Timo Heikkilä's avatar
Timo Heikkilä committed
83
    {% if exp.randomization == 'Off' %}      
84
      <a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.randomization', exp_id=exp.idexperiment, set='On') }}" role="button">Enable</a></td>
Timo Heikkilä's avatar
Timo Heikkilä committed
85
86
    {% endif %}
    {% if exp.randomization == 'On' %}      
87
      <a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.randomization', exp_id=exp.idexperiment, set='Off') }}" role="button">Disable</a></td>
Timo Heikkilä's avatar
Timo Heikkilä committed
88
89
    {% endif %}

Timo Heikkilä's avatar
Timo Heikkilä committed
90
91
92
93
94
95
    </td>
    </tr>
      <td nowrap>Use forced ID for participants:</td>
      <td>{{ exp.use_forced_id }}</td>
      <td nowrap>
    {% if exp.use_forced_id == 'Off' %}      
96
      <a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.set_forced_id', exp_id=exp.idexperiment, set='On') }}" role="button">Enable</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
97
98
99
100
      
      
    {% endif %}
    {% if exp.use_forced_id == 'On' %}      
101
102
      <a class="btn btn-primary w-50 btn-sm btn-info" href="{{ url_for('experiment.set_forced_id', exp_id=exp.idexperiment, set='Off') }}" role="button">Disable</a>
      <a class="btn btn-primary w-50 btn-sm btn-info" href="{{ url_for('experiment.view_forced_id_list', exp_id=exp.idexperiment) }}" role="button">Check ID</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
103
104
105
    {% endif %}
      
    </td>
Timo Heikkilä's avatar
Timo Heikkilä committed
106
107
    </tr>
    <tr>
Timo Heikkilä's avatar
Timo Heikkilä committed
108
109
110
    <td> Research bulletin:</td>   
    <td> {{ exp.research_notification_filename }}</td>   
    {% if exp.research_notification_filename  %}
111
    <td> <a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.remove_research_notification', exp_id=exp.idexperiment) }}" role="button">Remove</a></td>   
Timo Heikkilä's avatar
Timo Heikkilä committed
112
    {% else %}
113
    <td> <a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.upload_research_notification', exp_id=exp.idexperiment) }}" role="button">Upload</a></td>   
Timo Heikkilä's avatar
Timo Heikkilä committed
114
    {% endif %}
Timo Heikkilä's avatar
Timo Heikkilä committed
115
    </tr>
Timo Heikkilä's avatar
Timo Heikkilä committed
116
117
118
    
    <tr>
      <td nowrap>Detailed instructions:</td>
119
120
121
122
      
      
      <td class="text-justify">{{ exp.instruction }}</td>
      
Timo Heikkilä's avatar
Timo Heikkilä committed
123
      <td nowrap>
124
     <a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.edit', exp_id=exp.idexperiment) }}" role="button">Edit properties</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
125
    </td>
Timo Heikkilä's avatar
Timo Heikkilä committed
126
127
    </tr>
    <tr>
Timo Heikkilä's avatar
Timo Heikkilä committed
128
      <td nowrap>Short description:</td>
129
      <td class="text-justify">{{ exp.short_instruction }}</td>
Timo Heikkilä's avatar
Timo Heikkilä committed
130
131
132
133
134
135
136
137
138
139
140
      <td nowrap></td>
    </tr>

    <tr>
      <td nowrap>Single sentence instruction:</td>
      <td>{{ exp.single_sentence_instruction }}</td>
      <td nowrap></td>
    </tr>

    <tr>
      <td nowrap>Consent form text:</td>
141
      <td class="text-justify">{{ exp.consent_text }}</td>
Timo Heikkilä's avatar
Timo Heikkilä committed
142
143
144
145
      <td nowrap></td>
    </tr>
    <tr>
      <td nowrap>Experiment database ID:</td>
Timo Heikkilä's avatar
Timo Heikkilä committed
146
      <td>{{ exp.idexperiment }}</td>
Timo Heikkilä's avatar
Timo Heikkilä committed
147
      <td nowrap></td>
Timo Heikkilä's avatar
Timo Heikkilä committed
148
149
    </tr>

Timo Heikkilä's avatar
Timo Heikkilä committed
150
151


Timo Heikkilä's avatar
Timo Heikkilä committed
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
{% endfor %}
  </tbody>
</table>
</div>



<h1 class="container mt-5 display-4 text-left"><br>Background questions:</h1>
<br>

    {% for options in questions1 %}
    
    <table class="table">
      <tbody>  
      <tr>
Timo Heikkilä's avatar
Timo Heikkilä committed
167
      <td class="col-11">
Timo Heikkilä's avatar
Timo Heikkilä committed
168
169
        <label for="{{ options[0] }}">{{ options[1] }}</label>
            <select required class="form-control" name="{{ options[0] }}">  
Timo Heikkilä's avatar
Timo Heikkilä committed
170
                <option disabled selected value>Please select</option>
Timo Heikkilä's avatar
Timo Heikkilä committed
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
                {% for op in questions1[options] %}
                     <option value="{{ op[0] }}" name="{{ op[0] }}">{{ op[0] }}</option>
                {% endfor %}   
            </select>
    </td>
    <td class="text-nowrap align-bottom">
    
             <button type="button" class="btn btn-primary btn-sm btn-dark" data-toggle="modal" data-target="#myModal{{options[0]}}">Remove</button>
                      <!-- Modal -->
                      <div class="modal fade" id="myModal{{options[0]}}" role="dialog">
                        <div class="modal-dialog modal-dialog-centered" id="{{options[0]}}">
                          <!-- Modal content-->
                          <div class="modal-content modal-dialog-centered">
                            <div class="modal-header">
                              <button type="button" class="close" data-dismiss="modal">&times;</button>
                              <h4 class="modal-title">Notice!</h4>
                            </div>
                            <div class="modal-body">
                              <p>Are you sure you want to remove this?</p>
                            </div>
                            <div class="modal-footer">
                              <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
193
                              <a class="btn btn-primary" href="{{ url_for('experiment.remove_bg_question', idbackground_question=options[0], exp_id=exp_id) }}" role="button">Yes, remove</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
194
195
196
197
                            </div>
                          </div>
                        </div>
                      </div>
198
    <a class="btn btn-primary btn-sm btn-info" href="{{ url_for('experiment.edit_bg_question', idbackground_question=options[0]) }}" role="button">Edit</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
199
200
201
202
203
204
205
206
207
208

    </td>
    </tr>
        
       {% endfor %}
    </tbody>
    </table>
    <table class="table">
    <tbody>
    <td class="text-nowrap align-bottom text-right col-8">
209
    <a class="btn btn-primary btn-sm btn-info" href="{{ url_for('experiment.add_bg_question', exp_id=exp_id) }}" role="button">Add more</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
210
211
212
213
214
215
216
    </td>
    </tbody>
    </table>



<h1 class="container mt-5 display-4 text-left"><br>Rating set:</h1>
217
218
219

<hr>
TODO: add embody tool
Timo Heikkilä's avatar
Timo Heikkilä committed
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<hr>
<br>    
    {% for category in categories1 %}
        {% for scale in categories1[category] %}
            <div class="row form-group">
                <div class="col-2 text-center">
                    <p>{{ scale[0] }}</p> 
                </div>
                <div class="col text-center">
                    <label for="customRange">{{ category[1] }}</label>
                    <input type="range" class="custom-range" id="customRange" name={{ category[0] }}>
                 </div>
                <div class="col-2 text-center">
                <p>{{ scale[1] }}</p> 
                </div>
                <div class="col-2 text-center">
                
                
                   <button type="button" class="btn btn-primary btn-sm btn-dark" data-toggle="modal" data-target="#mymodal{{category[0]}}">Remove</button>
                      <!-- Modal -->
                      <div class="modal fade" id="mymodal{{category[0]}}" role="dialog">
                        <div class="modal-dialog modal-dialog-centered" id="{{category[0]}}">
                          <!-- Modal content-->
                          <div class="modal-content modal-dialog-centered">
                            <div class="modal-header">
                              <button type="button" class="close" data-dismiss="modal">&times;</button>
                              <h4 class="modal-title">Notice!</h4>
                            </div>
                            <div class="modal-body">
                              <p>Are you sure you want to remove this?</p>
                            </div>
                            <div class="modal-footer">
                              <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
253
                              <a class="btn btn-primary" href="{{ url_for('experiment.remove_question', idquestion=category[0], exp_id=exp_id) }}" role="button">Yes, remove</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
254
255
256
257
                            </div>
                          </div>
                        </div>
                      </div>
258
                <a class="btn btn-primary btn-sm btn-info" href="{{ url_for('experiment.edit_question', idquestion=category[0]) }}" role="button">Edit</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
259
260
261
262
263
264
265
266
267
268
269
                 
                </div>

            </div>
         {% endfor %}   
    {% endfor %}

    </table>
    <table class="table">
    <tbody>
    <td class="text-nowrap align-bottom text-right col-8">
270
    <a class="btn btn-primary btn-sm btn-info" href="{{ url_for('experiment.add_questions', exp_id=exp_id) }}" role="button">Add more</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
    </td>
    </tbody>
    </table>


 <h1 class="container mt-5 display-4 text-left"><br>Stimuli:</h1>
 <hr>

  <p class="lead">Please notice that the Page ID is just the reference ID of the stimulus in the database. When stimulus randomization is set to "OFF"
                  the stimulus will be presented in the order below even if there would be numbers missing from the page ID sequence.
                  If randomization is set to "ON" the order will be randomized for each participant.
  </p>
 <br>   
<div class="container col-12">
 <table class="table col-12">
  <tbody>
    {% if mtype.type=='text' %}
Timo Heikkilä's avatar
Timo Heikkilä committed
288
            {% for page in media %}
Timo Heikkilä's avatar
Timo Heikkilä committed
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
                <tr class="col-12">
                    <td class="text-nowrap">Page ID: {{ page.idpage }}
                    </td>
                    <td class="col-8">{{ page.text }}
                    </td>
                    <td class="col-2 text-nowrap">
                    <button type="button" class="btn btn-primary btn-sm btn-dark" data-toggle="modal" data-target="#mymodal{{page.idpage}}">Remove</button>
                      <!-- Modal -->
                      <div class="modal fade" id="mymodal{{page.idpage}}" role="dialog">
                        <div class="modal-dialog modal-dialog-centered" id="{{page.idpage}}">
                          <!-- Modal content-->
                          <div class="modal-content modal-dialog-centered">
                            <div class="modal-header">
                              <button type="button" class="close" data-dismiss="modal">&times;</button>
                              <h4 class="modal-title">Notice!</h4>
                            </div>
                            <div class="modal-body">
                              <p>Are you sure you want to remove this?</p>
                            </div>
                            <div class="modal-footer">
                              <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
310
                              <a class="btn btn-primary" href="{{ url_for('experiment.remove_stimuli', idpage=page.idpage, exp_id=exp_id) }}" role="button">Yes, remove</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
311
312
313
314
                            </div>
                          </div>
                        </div>
                      </div>
315
                     <a class="btn btn-primary btn-sm btn-info" href="{{ url_for('experiment.edit_stimuli', idpage=page.idpage, exp_id=exp_id) }}" role="button">Edit</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
316
317
318
319
320
321
322
                    </td>
                </tr>
            {% endfor %}
            
                  <table class="table">
                  <tbody>
                  <td class="text-nowrap align-bottom text-right col-8">
323
                  <a class="btn btn-primary btn-sm btn-info" href="{{ url_for('experiment.add_stimuli', exp_id=exp_id, stimulus_type=mtype.type) }}" role="button">Add more</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
324
325
326
327
328
329
                  </td>
                  </tbody>
                  </table>
   
    {% else %}
        <div class="container col-12">
Timo Heikkilä's avatar
Timo Heikkilä committed
330
            {% for page in media %}
Timo Heikkilä's avatar
Timo Heikkilä committed
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
                <tr class="col-12 text-left">
                    <td class="col-2 text-nowrap">Page ID: {{ page.idpage }}
                    </td>
                    <td class="col-8" >{{ page.media }}
                    </td>
                    <td class="col-2 text-nowrap">
                    <button type="button" class="btn btn-primary btn-sm btn-dark" data-toggle="modal" data-target="#mymodal{{page.idpage}}">Remove</button>
                      <!-- Modal -->
                      <div class="modal fade" id="mymodal{{page.idpage}}" role="dialog">
                        <div class="modal-dialog modal-dialog-centered" id="{{page.idpage}}">
                          <!-- Modal content-->
                          <div class="modal-content modal-dialog-centered">
                            <div class="modal-header">
                              <button type="button" class="close" data-dismiss="modal">&times;</button>
                              <h4 class="modal-title">Notice!</h4>
                            </div>
                            <div class="modal-body">
                              <p>Are you sure you want to remove this?</p>
                            </div>
                            <div class="modal-footer">
                              <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
352
                              <a class="btn btn-primary" href="{{ url_for('experiment.remove_stimuli', idpage=page.idpage, exp_id=exp_id) }}" role="button">Yes, remove</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
353
354
355
356
                            </div>
                          </div>
                        </div>
                      </div>
357
                     <a class="btn btn-primary btn-sm btn-info" href="{{ url_for('experiment.edit_stimuli', idpage=page.idpage, exp_id=exp_id) }}" role="button">Replace</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
358
359
360
361
362
363
364
365
                 
                    </td>
                </tr>
            {% endfor %}
            
                          <table class="table">
                  <tbody>
                  <td class="text-nowrap align-bottom text-right col-8">
366
367
                  {{ mtype }}
                  <a class="btn btn-primary btn-sm btn-info" href="{{ url_for('experiment.add_stimuli', exp_id=exp_id, stimulus_type=mtype.type) }}" role="button">Add more</a>
Timo Heikkilä's avatar
Timo Heikkilä committed
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
                  </td>
                  </tbody>
                  </table>    
        
    {% endif %}

    </tbody>
    </table>
    
    </div>
    <br>
 

    
{% endblock %}