forked from jspsych/jsPsych
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjspsych-html-keyboard-response.html
42 lines (38 loc) · 1.13 KB
/
jspsych-html-keyboard-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
<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-html-keyboard-response.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
</head>
<body></body>
<script>
var trial_1 = {
type: 'html-keyboard-response',
stimulus: '<p style="color: red; font-size: 48px; font-weight: bold;">GREEN</p>',
choices: ['y', 'n'],
prompt: '<p>Does the color match the word? (Y or N)</p>'
}
var trial_2 = {
type: 'html-keyboard-response',
stimulus: '<p style="color: red; font-size: 48px; font-weight: bold;">RED</p>',
choices: ['y', 'n'],
trial_duration: 5000,
prompt: '<p>Does the color match the word? (Y or N; 5s time limit)</p>'
}
var trial_3 = {
type: 'html-keyboard-response',
stimulus: '<p style="color: orange; font-size: 48px; font-weight: bold;">BLUE</p>',
choices: jsPsych.NO_KEYS,
trial_duration: 2000,
prompt: '<p>No response allowed. 2s wait.</p>'
}
jsPsych.init({
timeline: [trial_1, trial_2, trial_3],
on_finish: function() {
jsPsych.data.displayData();
},
default_iti: 250
});
</script>
</html>