forked from jspsych/jsPsych
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata-from-timeline.html
More file actions
52 lines (44 loc) · 956 Bytes
/
Copy pathdata-from-timeline.html
File metadata and controls
52 lines (44 loc) · 956 Bytes
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
<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-image-keyboard-response.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
<style>
img {
width: 300px;
}
</style>
</head>
<body></body>
<script>
var trial_1 = {
stimulus: 'img/happy_face_4.jpg',
}
var trial_2 = {
stimulus: 'img/sad_face_4.jpg',
}
var trial_3 = {
stimulus: 'img/sad_face_3.jpg',
}
var node = {
type: 'image-keyboard-response',
timeline: [trial_1, trial_2, trial_3],
choices: [89, 78], // Y or N
prompt: '<p>Have you seen this face before? Y or N.</p>',
data: {
node_data: true
},
on_finish: function(){
console.log(jsPsych.data.getLastTimelineData().json());
}
}
jsPsych.init({
timeline: [node],
on_finish: function() {
jsPsych.data.displayData();
},
default_iti: 250
});
</script>
</html>