forked from jspsych/jsPsych
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjspsych-image-button-response.html
46 lines (40 loc) · 1.11 KB
/
jspsych-image-button-response.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
<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-image-button-response.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
<style>
img { width: 300px; }
</style>
</head>
<body></body>
<script>
var timeline = [];
timeline.push({
type: 'image-button-response',
stimulus: 'img/happy_face_1.jpg',
choices: ['Happy', 'Sad'],
prompt: "<p>What emotion is this person showing?</p>"
});
timeline.push({
type: 'image-button-response',
stimulus: 'img/happy_face_2.jpg',
choices: ['Happy', 'Sad'],
stimulus_duration: 1000,
prompt: "<p>What emotion is this person showing? (image disappears after 1s)</p>"
});
timeline.push({
type: 'image-button-response',
stimulus: 'img/happy_face_3.jpg',
choices: ['Happy', 'Sad'],
trial_duration: 2000,
response_ends_trial: false,
prompt: "<p>What emotion is this person showing? (trial ends after 2s)</p>"
});
jsPsych.init({
timeline: timeline,
on_finish: function(){jsPsych.data.displayData();}
});
</script>
</html>