-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathexperiment.html
executable file
·71 lines (60 loc) · 2.54 KB
/
experiment.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
<!DOCTYPE html>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<html>
<head>
<title>Two-Step Task</title>
<!-- Load libraries -->
<script src="https://unpkg.com/[email protected]"></script>
<!-- Initialize jsPsych -->
<script src="./js/init-jspsych.js"></script>
<!-- Load jsPsych plug-ins -->
<script src="./js/plugin-two-step-alien-practice.js"></script>
<script src="./js/plugin-two-step-trial.js"></script>
<script src="./js/plugin-two-step-instructions.js"></script>
<script src="./js/plugin-two-step-comprehension.js"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<!-- Load experiment -->
<!-- Note: the order matters for the following imports -->
<script src="./js/two-step-drifts.js" type="text/javascript"></script>
<script src="./js/two-step-experiment.js" type="text/javascript"></script>
<script src="./js/two-step-instructions.js" type="text/javascript"></script>
<!-- Load CSS styles -->
<link href="https://unpkg.com/[email protected]/css/jspsych.css" rel="stylesheet" type="text/css" />
<link href="./css/two-step-css.min.css" rel="stylesheet" type="text/css"></link>
</head>
<body></body>
<script>
// Define image preloading.
var PRELOAD = {
type: jsPsychPreload,
images: preload_images,
message: 'Loading images. This may take a moment depending on your internet connection.',
error_message: '<p>The experiment failed to load. Please try restarting your browser.</p><p>If this error persists after 2-3 tries, please contact the experimenter.</p>',
continue_after_error: false,
show_progress_bar: true,
max_load_time: 30000
}
// Define experiment fullscreen.
var FULLSCREEN = {
type: jsPsychFullscreen,
fullscreen_mode: true
}
// Initialize timeline.
var timeline = [];
timeline = timeline.concat(PRELOAD);
timeline = timeline.concat(FULLSCREEN);
timeline = timeline.concat(INSTRUCTIONS_SKIP);
timeline = timeline.concat(INSTRUCTIONS);
timeline = timeline.concat(READY_01);
timeline = timeline.concat(TWO_STEP_TASK.slice(0,100));
timeline = timeline.concat(READY_02);
timeline = timeline.concat(TWO_STEP_TASK.slice(100,201));
timeline = timeline.concat(FINISHED);
// Execute timeline.
jsPsych.run(timeline);
</script>
</html>