jsPsych/examples/jspsych-serial-reaction-time.html
2017-06-24 23:53:50 -04:00

59 lines
1.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-serial-reaction-time.js"></script>
<script src="../plugins/jspsych-text.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
</head>
<script>
var locations = [
[0,0],
[0,1],
[0,2],
[0,3]
];
locations = jsPsych.randomization.shuffle(locations);
var timeline = {
timeline: [
{
type: 'serial-reaction-time',
target: jsPsych.timelineVariable('target1'),
grid_square_size: 80
},
{
type: 'serial-reaction-time',
target: jsPsych.timelineVariable('target2'),
grid_square_size: 80
}
],
timeline_variables: [
{target1: locations[0], target2: locations[1]},
{target1: locations[2], target2: locations[3]}
],
randomize_order: true,
repetitions: 10
}
var instructions = {
type: 'text',
text: 'Four boxes will be shown on the screen. Press the key associated with the box that is dark. The keys are 3, 5, 7, and 9. Press any key to start.'
}
jsPsych.init({
timeline: [instructions, timeline],
on_finish: function() {
jsPsych.data.displayData();
},
default_iti: 0
});
</script>
</html>