/
index.html
736 lines (676 loc) · 26.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>My Experiment</title>
<script src="jspsych-6.0.4/jspsych.js"></script>
<script src="jspsych-6.0.4/plugins/jspsych-html-keyboard-response.js"></script>
<script src="jspsych-6.0.4/plugins/jspsych-call-function.js"></script>
<script src="jspsych-boxes.js"></script>
<script src="jspsych-6.0.4/plugins/jspsych-image-keyboard-response.js"></script>
<script src="jspsych-6.0.4/plugins/jspsych-html-button-response.js"></script>
<script src="jspsych-6.0.4/plugins/jspsych-survey-multi-choice.js"></script>
<script src="jspsych-6.0.4/plugins/jspsych-survey-text.js"></script>
<script src="jspsych-6.0.4/plugins/jspsych-survey-multi-select.js"></script>
<script src="js/serverComm.js"></script>
<link href="jspsych-6.0.4/css/jspsych.css" rel="stylesheet" type="text/css"></link>
<link href="https://fonts.googleapis.com/css?family=Overpass:400,700,900" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Overpass+Mono" rel="stylesheet">
<style>
html, body, #experiment {
margin: 0;
width: 100%;
height: 100%;
}
body{
background-color: white;
}
#jspsych-content {
max-width: 960px;
}
#progress{
height: 120px;
width: 600px;
border: 1px solid black;
position: fixed;
background-color: darkcyan;
bottom: 0;
left: calc(50% - 300px);
visibility: hidden;
}
.text{
font-size: 18px;
text-align: center;
font-weight: bold;
}
.circle{
height: 50px;
width: 50px;
background-color: #cccccc;
border: 1px solid black;
border-radius: 50%;
display: inline-block;
margin: 10px;
}
#overlay {
width: 150px;
/*height: 80px;*/
padding: 10px;
background-color: #012BFF;
position: absolute;
z-index: 2;
top: calc(50% - 280px);
left: calc(50% - 460px);
font-size: 18px;
font-family: 'Overpass';
color: white;
line-height: 30px;
}
#timer_box {
border-bottom: 1px solid white;
padding: 0px 0px 10px 0px;
width: 100%;
}
#timer-label {
display: inline-block;
width: 40%;
font-weight: 700;
color: #F49661;
}
#timer {
text-align: right;
display: inline-block;
width:60%;
color: #BEFBE6;
font-size: 26px;
font-family: 'Overpass Mono';
}
#score_box {
padding: 10px 0px 0px 0px;
}
#score-label {
display: inline-block;
width: 60%;
font-weight: 700;
color: #F49661;
}
#score {
color: #BEFBE6;
font-size: 26px;
display: inline-block;
text-align: right;
width: 40%;
font-family: 'Overpass Mono';
}
.title-btn {
background-color: white;
color: black;
width:600px;
height:100px;
font-size:60px;
border: none;
font-family: 'Overpass';
font-weight:900;
letter-spacing: 0.25em;
cursor: pointer;
}
.title-btn:before {
content: '';
position: absolute;
height: 100px;
width: 20px;
background-color: #F49661;
transform-origin: 0 0;
transform: skewY(45deg);
left:100%;
top: 0px;
}
.title-btn:after {
content: '';
position: absolute;
height: 20px;
width: 600px;
background-color: #012BFF;
transform-origin: 0 0;
transform: skewX(45deg);
top:100%;
left: 0px;
}
.title-btn:active {
position: relative;
top: 10px;
left: 10px;
outline: none;
}
.title-btn:active:before {
width: 10px;
}
.title-btn:active:after {
height: 10px;
}
#help-text {
color: white;
font-family: 'Overpass';
width: 550px;
text-align: left;
position: absolute;
top: 50px;
left: 330px;
}
#help-text p {
font-size: 22px;
}
.help-btn {
background-color: white;
color: black;
width:150px;
height:50px;
font-size:30px;
border: none;
font-family: 'Overpass';
font-weight:900;
letter-spacing: 0.1em;
cursor: pointer;
}
.help-btn:before {
content: '';
position: absolute;
height: 50px;
width: 10px;
background-color: #F49661;
transform-origin: 0 0;
transform: skewY(45deg);
left:100%;
top: 0px;
}
.help-btn:after {
content: '';
position: absolute;
height: 10px;
width: 150px;
background-color: #012BFF;
transform-origin: 0 0;
transform: skewX(45deg);
top:100%;
left: 0px;
}
.help-btn:active {
position: relative;
top: 5px;
left: 5px;
outline: none;
}
.help-btn:active:before {
width: 5px;
}
.help-btn:active:after {
height: 5px;
}
#score-text {
color:white;
font-family: 'Overpass';
width: 400px;
position: absolute;
left: calc(50% - 200px);
top: 130px;
font-size: 24px;
}
.left-score {
display: inline-block;
width: 70%;
text-align: left;
}
.right-score {
display: inline-block;
width: 30%;
text-align: right;
}
.big-score {
font-size: 32px;
}
.scoreboard-btn {
background-color: white;
color: black;
width:280px;
height:50px;
font-size:30px;
border: none;
font-family: 'Overpass';
font-weight:900;
letter-spacing: 0.1em;
cursor: pointer;
}
.scoreboard-btn:before {
content: '';
position: absolute;
height: 50px;
width: 10px;
background-color: #F49661;
transform-origin: 0 0;
transform: skewY(45deg);
left:100%;
top: 0px;
}
.scoreboard-btn:after {
content: '';
position: absolute;
height: 10px;
width: 280px;
background-color: #012BFF;
transform-origin: 0 0;
transform: skewX(45deg);
top:100%;
left: 0px;
}
.scoreboard-btn:active {
position: relative;
top: 5px;
left: 5px;
outline: none;
}
.scoreboard-btn:active:before {
width: 5px;
}
.scoreboard-btn:active:after {
height: 5px;
}
</style>
</head>
<body>
<div id="experiment"></div>
<div id="overlay" style="visibility:hidden;">
<div id="timer_box"><span id="timer-label">TIME</span><span id="timer">60.0</span></div>
<div id="score_box"><span id="score-label">SCORE</span><span id="score">0</span></div>
<div id="progress"></div>
</div>
</div>
</body>
<script>
// get subject ID
var pid = jsPsych.data.getURLVariable('prolific_pid');
if(pid == "" || pid == null || pid == undefined){
pid = jsPsych.randomization.randomID(45);
}
jsPsych.data.addProperties({
prolific_pid: pid
});
// game parameters
var seconds_per_round = 60;
var num_rounds = 4;
var correct_responses_per_shape = 5;
var points_per_correct = 10;
var points_per_perfect_shape = 100;
var trials = [
{reflected:true, orientation: 30, correct_key: 'n'},
{reflected:true, orientation: 60, correct_key: 'n'},
{reflected:true, orientation: 90, correct_key: 'n'},
{reflected:true, orientation: 120, correct_key: 'n'},
{reflected:true, orientation: 150, correct_key: 'n'},
{reflected:true, orientation: 180, correct_key: 'n'},
{reflected:false, orientation: 30, correct_key: 'y'},
{reflected:false, orientation: 60, correct_key: 'y'},
{reflected:false, orientation: 90, correct_key: 'y'},
{reflected:false, orientation: 120, correct_key: 'y'},
{reflected:false, orientation: 150, correct_key: 'y'},
{reflected:false, orientation: 180, correct_key: 'y'},
]
var timeline = [];
var welcome ={
type: 'html-button-response',
stimulus: "<p>This is a research project conducted at Vassar College. " +
"In this experiment you will play a computer game that is "+
"designed to measure aspects of your cognition; such as attention, "+
"memory, and learning. We will record data about how you play, "+
"such as what keys you pressed or where you clicked. The "+
"experiment will take approximately 8 minutes to complete. You will "+
"recieve a payment of $1.50 upon completion of the experiment. "+
"The data we collect will be used for research purposes. We do "+
"not collect any personally identifying information, so your data is"+
" anonymous. You are free to stop the experiment by closing "+
"your browser window at any time. If you have any questions, you "+
"can contact the researchers through Prolific's messaging system.</p>"+
"<p>By clicking 'I agree', you affirm that you are at least "+
"18 years of age, which is the minimum age to participate in "+
"this study, and that you understand the nature of your participation "+
"in this research. If you do not wish to participate, please "+
"close this window.</p>",
choices: ["I agree"],
button_html: '<button class="jspsych-btn">%choice%</button>',
};
timeline.push(welcome);
var explainer = {
type: 'html-button-response',
stimulus: '<p>In this experiment we are testing a game that is designed '+
'to measure aspects of your cognitive ability. We are interested in whether '+
'this game produces data that are similar to what we would expect from more traditional laboratory assessments.</p>'+
'<p>The next screen will load the game. There will be a short set of instructions '+
'and then you will play the game for about 5 minutes. After the game is complete '+
'we will ask you to fill out a short survey about the game.</p>',
choices: ["I'm ready to start"]
}
timeline.push(explainer);
var switch_to_game_style = {
type: 'call-function',
func: function(){
var new_css = '<style id="game_css">'
new_css += 'html, body { background: url("img/dark-triangles.png"); }'
new_css += "#jspsych-content { height: 600px; width: 960px; position: relative; overflow: hidden; background-color: black; border-top: #012BFF 6px solid; border-left: #012BFF 6px solid; border-right: 6px solid #F49661; border-bottom: 6px solid #F49661; }"
new_css += "#jspsych-content:before { content: ''; position: absolute; pointer-events: none; z-index: 1; top: 0; left: 0; right: 0; bottom: 0; border-top: #F49661 6px solid; border-left: #F49661 6px solid; border-right: 6px solid #012BFF; border-bottom: 6px solid #012BFF; }"
new_css += '</style>'
document.querySelector('head').insertAdjacentHTML('beforeend', new_css);
}
}
timeline.push(switch_to_game_style);
var title_screen = {
type: 'html-button-response',
stimulus: '<div id="title_screen" style="width:960px; height: 600px; position: relative;">'+
'<div id="title" style="text-align: left; position: absolute; top: 50px; left: 50px;"><img src="img/blockmatch_title.jpg" style="width:650px;"></div>'+
'<div id="title_right" style="position: absolute; top: 50px; right: 50px;"><img src="img/titlescreen_right.jpg" style="height: 500px"></img></div></div>',
choices: ['PLAY'],
margin_horizontal: "0px",
button_html: '<button class="title-btn">%choice%</button>',
on_start: function(){
var css = "<style id='btn_css'>#jspsych-html-button-response-btngroup { position: absolute; left: 50px; bottom: 70px; }</style>";
document.querySelector('head').insertAdjacentHTML('beforeend', css);
}
}
timeline.push(title_screen);
var instructions_1 = {
type: 'html-button-response',
stimulus: '<div id="help_screen" style="width:960px; height: 600px; position: relative;">'+
'<div id="title" style="text-align: left; position: absolute; top: 50px; left: 50px; padding-right: 50px; border-right: 2px solid white"><img src="img/help-title.jpg" style="height:500px;"></div>'+
'<div id="help-text"><h1>How to play</h1><p>In this game, you will be comparing two shapes to determine whether they are the same shape or mirror images of each other.</p><img src="img/help-1.jpg" style="width:550px;"></div>'+
'</div>',
choices: ['NEXT'],
margin_horizontal: "0px",
button_html: '<button class="help-btn">%choice%</button>',
on_start: function(){
document.querySelector('#btn_css').innerHTML = "#jspsych-html-button-response-btngroup { position: absolute; right: 50px; bottom: 50px; }"
}
}
timeline.push(instructions_1);
var instructions_2 = {
type: 'html-button-response',
stimulus: '<div id="help_screen" style="width:960px; height: 600px; position: relative;">'+
'<div id="title" style="height: 500px; width: 190px; text-align: left; position: absolute; top: 50px; left: 50px; padding-right: 50px; border-right: 2px solid white"><img src="img/help-title.jpg" style="height:500px;"></div>'+
'<div id="help-text"><h1>Same shape</h1><p>The two images below are the same shape. If you rotate the image on the right 180 degrees, you get the image on the left.</p><p>If the images are the same shape press Y.</p><img src="img/help-2.jpg" style="width:400px;"></div>'+
'</div>',
choices: ['NEXT'],
margin_horizontal: "0px",
button_html: '<button class="help-btn">%choice%</button>'
}
timeline.push(instructions_2);
var instructions_3 = {
type: 'html-button-response',
stimulus: '<div id="help_screen" style="width:960px; height: 600px; position: relative;">'+
'<div id="title" style="text-align: left; position: absolute; top: 50px; left: 50px; padding-right: 50px; border-right: 2px solid white"><img src="img/help-title.jpg" style="height:500px;"></div>'+
'<div id="help-text"><h1>Mirror image</h1><p>The two images below are not the same shape. The shape on the right is the mirror image of the shape on the left.</p><p>If the images are not the same shape press N.</p><img src="img/help-3.jpg" style="width:400px;"></div>'+
'</div>',
choices: ['NEXT'],
margin_horizontal: "0px",
button_html: '<button class="help-btn">%choice%</button>'
}
timeline.push(instructions_3);
var instructions_3 = {
type: 'html-button-response',
stimulus: '<div id="help_screen" style="width:960px; height: 600px; position: relative;">'+
'<div id="title" style="text-align: left; position: absolute; top: 50px; left: 50px; padding-right: 50px; border-right: 2px solid white"><img src="img/help-title.jpg" style="height:500px;"></div>'+
'<div id="help-text"><h1>Scoring</h1><p>Each correct response is worth 10 points. After 5 correct responses, the shape will change. If you get all 5 responses for a shape correct, you get a bonus 100 points.</p><p>You\'ll play '+num_rounds+' rounds of the game. Each round lasts '+seconds_per_round+' seconds. You can see your scores after every round.</p></div>'+
'</div>',
choices: ['BEGIN'],
margin_horizontal: "0px",
button_html: '<button class="help-btn">%choice%</button>'
}
timeline.push(instructions_3);
var best_score = 0;
var both_new = true;
var correct_responses_for_shape = 0;
var shapes_completed = 0;
var score = 0;
var remaining_time = null;
var shape = null;
var n_in_this_shape = 0;
var start_time = null;
var round = 1;
var three = {
type: 'html-keyboard-response',
stimulus: '<div style="height: 600px; width: 960px; position: relative;"><img style="position: absolute; width: 223px; height: 305px; left: calc(50% - 111px); top: calc(50% - 152px);" src="img/3.png">',
trial_duration: 1000,
choices: jsPsych.NO_KEYS,
on_start: function(){
// reset
document.querySelector('#timer').innerHTML = seconds_per_round.toFixed(2);
document.querySelector('#score').innerHTML = 0;
// show overlay
document.querySelector('#overlay').style.visibility = 'visible';
}
}
var two = {
type: 'html-keyboard-response',
stimulus: '<div style="height: 600px; width: 960px; position: relative;"><img style="position: absolute; width: 223px; height: 305px; left: calc(50% - 111px); top: calc(50% - 152px);" src="img/2.png">',
trial_duration: 1000,
choices: jsPsych.NO_KEYS
}
var one = {
type: 'html-keyboard-response',
stimulus: '<div style="height: 600px; width: 960px; position: relative;"><img style="position: absolute; width: 62px; height: 305px; left: calc(50% - 31px); top: calc(50% - 152px);" src="img/1.png">',
trial_duration: 1000,
choices: jsPsych.NO_KEYS
}
var start_round = {
type: 'call-function',
func: function(){
// reset
score = 0;
shape = jsPsych.plugins["boxes"].generateFullShape(4,4,8);
both_new = true;
correct_responses_for_shape = 0;
shapes_completed = 0;
n_in_this_shape = 0
start_time = performance.now();
function next(time){
remaining_time = seconds_per_round - (time - start_time)/1000;
if(remaining_time < 0){
remaining_time = 0;
}
document.querySelector('#timer').innerHTML = remaining_time.toFixed(2);
document.querySelector('#score').innerHTML = score;
if(remaining_time == 0){
jsPsych.finishTrial({timeout: true}); //TODO: fix this data...
} else {
window.requestAnimationFrame(next);
}
}
window.requestAnimationFrame(next);
}
}
var box_trials = {
timeline: [{
type: 'boxes',
grid_rows: 4,
grid_cols: 4,
filled_in_reference: function() {return shape},
both_new: function() {return both_new},
clearboth: function () {return correct_responses_for_shape == correct_responses_per_shape - 1},
square_size: 70,
rotation_reference: 0,
reflected:jsPsych.timelineVariable("reflected"),
rotation_target: jsPsych.timelineVariable("orientation"),
correct_match: jsPsych.timelineVariable("correct_key"),
data: function() {
return {
round: round,
shape_repetitions: n_in_this_shape
}
},
on_finish: function(){
both_new = false
}
}],
timeline_variables: trials,
sample: {
type: 'without-replacement',
size: 1
},
loop_function: function(data){
if(data.values()[0].timeout){
if(score > best_score){
best_score = score;
}
document.querySelector('#overlay').style.visibility = 'hidden';
jsPsych.pluginAPI.cancelAllKeyboardResponses();
return false;
}
n_in_this_shape++;
if (data.values()[0].correct){
correct_responses_for_shape++
score += points_per_correct;
}
if (correct_responses_for_shape == correct_responses_per_shape) {
// check for perfect shape
if(n_in_this_shape == correct_responses_per_shape){
score += points_per_perfect_shape;
}
shapes_completed++;
n_in_this_shape = 0;
shape = jsPsych.plugins["boxes"].generateFullShape(4,4,8)
correct_responses_for_shape = 0;
both_new = true;
}
return true;
}
}
var round_over = {
type: 'html-button-response',
stimulus: function(){
var this_round_data = jsPsych.data.get().filter({round: round});
var total = this_round_data.filterCustom(function(x) { return typeof x.timeout == 'undefined'; }).count();
var n_correct = this_round_data.filter({correct: true}).count();
if(n_correct > 0){
var rt = Math.round(this_round_data.filter({correct: true}).select('rt').mean()) + "ms";
} else {
var rt = "NA";
}
var html = '<div id="scoreboard" style="width:960px; height: 600px; position: relative;">';
html += '<div id="score-text">';
html += '<h1>Round '+round+' of '+num_rounds+'</h1>';
html += '<p class="big-score">You scored '+score+' points.</p>';
html += '<p><span class="left-score">Correct responses</span><span class="right-score">'+n_correct+' of '+total+'</span></p>';
html += '<p><span class="left-score">Average response time</span><span class="right-score">'+rt+'</span></p>';
html += '<p><span class="left-score">Best score so far</span><span class="right-score">'+best_score+'</span></p>';
html += '</div>';
html += '</div>';
return html;
},
choices: ['CONTINUE'],
margin_horizontal: "0px",
button_html: '<button class="scoreboard-btn">%choice%</button>'
}
var all_rounds = {
timeline: [three, two, one, start_round, box_trials, round_over],
loop_function: function(){
if(round == num_rounds){
return false;
} else {
round++;
return true;
}
}
};
timeline.push(all_rounds);
var switch_to_regular_style = {
type: 'call-function',
func: function(){
document.querySelector('#game_css').remove();
document.querySelector('#btn_css').remove();
}
}
timeline.push(switch_to_regular_style);
var switch_screen = {
type: 'html-button-response',
stimulus: "<p>That's it for the game. Thanks for playing!</p><p>We have a few short questions on the next four screens, and then you'll be finished with the experiment.</p>",
choices: ['CONTINUE'],
}
timeline.push(switch_screen);
var survey1 ={
type: 'survey-text',
questions:[
{prompt:"<p>What is your age?</p>"},
{prompt:"<p>What is your gender?</p>"},
{prompt:"<p>In the past week, how many hours have you played video games of any kind?</p>"}
],
data: {survey_part: 1}
};
timeline.push(survey1);
var survey2 ={
type: 'survey-multi-select',
questions:[
{
prompt:"<p>Which of the following platform(s) have you played games on in the past week?</p>",
options: ['Mobile', 'Desktop/Laptop Web Browser', 'Facebook'],
horizontal: true
}
],
data: {survey_part: 2}
};
timeline.push(survey2);
var survey3 ={
type: 'survey-multi-choice',
questions: [
{
prompt: "<p>If this game were available for free, how likely would you be to play it again?</p>",
options: ['Would not play again', 'Not sure', 'Would play again'],
horizontal: true
},
{
prompt: "<p>If you could see how your scores compare to other people around the world, would that motivate you to play it?</p>",
options: ['Would not motivate me','Not sure','Would motivate me'],
horizontal: true
},
{
prompt: "<p>If you could see how your scores compare to people similar to you (similar age and/or location), would that motivate you to play it?</p>",
options:['Would not motivate me','Not sure','Would motivate me'],
horizontal: true
},
{
prompt:"<p>If you could see how your scores change over time to track your improvement, would that motivate you to play it?</p>",
options:['Would not motivate me','Not sure','Would motivate me'],
horizontal: true}
],
data: {survey_part: 3}
};
timeline.push(survey3);
var survey4 ={
type: 'survey-text',
questions:[
{
prompt:"<p>Is there any other feedback you would like to give?<br>(Aspects of the game that you did or did not like, parts of the instructions that were confusing, technical problems, or anything else that you’d like to share).</p>",
rows: 4,
cols: 100
}
],
data: {survey_part: 4}
};
timeline.push(survey4);
var save_data = {
type: 'call-function',
func: function(){
var data = jsPsych.data.get().values();
serverComm.save_data(data);
}
}
timeline.push(save_data);
var payment ={
type: 'html-keyboard-response',
stimulus: "<p>Thanks for participating!</p><p>Please <a href='https://app.prolific.ac/submissions/complete?cc=WM0EA13G'>click here to complete the experiment and return to Prolific.</a>"+
" You do not need a completion code. Following the link will automatically register completion with Prolific.</p>",
choices: jsPsych.NO_KEYS
};
timeline.push(payment);
jsPsych.init({
timeline: timeline,
display_element: 'experiment'
});
</script>
</html>