-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample_jspsych.html
More file actions
69 lines (61 loc) · 2.3 KB
/
example_jspsych.html
File metadata and controls
69 lines (61 loc) · 2.3 KB
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
<!DOCTYPE html>
<html>
<head>
<!-- Title shown in tab -->
<title>Minimal Example</title>
<!-- Load JsPsych -->
<script src="https://unpkg.com/jspsych"></script>
<link href="https://unpkg.com/jspsych/css/jspsych.css" rel="stylesheet" type="text/css" />
<!-- core plugins we use -->
<script src="https://unpkg.com/@jspsych/plugin-call-function"></script>
<script src="https://unpkg.com/@jspsych/plugin-preload"></script>
<script src="https://unpkg.com/@jspsych/plugin-html-keyboard-response"></script>
<script src="https://unpkg.com/@jspsych/plugin-fullscreen"></script>
<!-- Game scripts -->
<script src="game/game.js"></script>
<script src="game/engine.js"></script>
<script src="game/intro.js"></script>
<script src="game/levels/level1.js"></script>
<script src="game/levels/intro.js"></script>
<script src="game/levels/level2.js"></script>
<!-- Integration helpers -->
<script src="game/jspsych.js"></script>
</head>
<body></body>
<script>
// Initialize experiment =================================================
var timeline = []
var jsPsych = initJsPsych({
on_finish: function () {
jsPsych.data.displayData("json") // Display data in browser
},
})
timeline.push({
type: jsPsychFullscreen,
fullscreen_mode: true,
})
// Timeline -------------------------------------------------------------------
timeline.push(
...DoggoNogo.level1({
includePreload: true,
assetBasePath: "game/assets/",
trialsNumber: 18,
markerEnabled: true,
fullscreen: true,
}),
...DoggoNogo.level2({
includePreload: true,
assetBasePath: "game/assets/",
trialsNumber: 18,
markerEnabled: true,
fullscreen: true,
})
)
timeline.push({
type: jsPsychFullscreen,
fullscreen_mode: false,
})
// Run the timeline =====================================================
jsPsych.run(timeline)
</script>
</html>