forked from jspsych/jsPsych
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjspsych-RDK.html
55 lines (45 loc) · 1.92 KB
/
jspsych-RDK.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
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-RDK.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
</head>
<body></body>
<script>
/*
We would appreciate it if you cited this paper when you use the RDK:
Rajananda, S., Lau, H. & Odegaard, B., (2018). A Random-Dot Kinematogram for Web-Based Vision Research. Journal of Open Research Software. 6(1), p.6. DOI: [http://doi.org/10.5334/jors.194]
*/
//---------Create trials---------
//Create an array of 2 different trials (different conditions)
var RDK_trials = [
{//Condition 1
correct_choice: "a", //The correct answer for Condition 1
coherent_direction: 180 //The coherent direction for Condition 1 (dots move left)
},
{//Condition 2
correct_choice: "l", //The correct answer for Condition 2
coherent_direction: 0 //The coherent direction for Condition 2 (dots move right)
},
];
//The test block where all the trials are nested. The properties here will trickle down to all trials in the timeline unless they have their own properties defined
var test_block = {
type: "RDK",
timing_post_trial: 0, //The Inter Trial Interval. You can either have no ITI, or have an ITI but change the display element to be the same color as the stimuli background to prevent flashing between trials
number_of_dots: 200, //Total number of dots in each aperture
RDK_type: 3, //The type of RDK used
choices: ["a", "l"], //Choices available to be keyed in by participant
trial_duration: 1000, //Duration of each trial in ms
timeline: RDK_trials, //The timeline of all the trials
}
//---------Run the experiment---------
//Initiate the experiment
jsPsych.init({
timeline: [test_block],
on_finish: function(){ //Execute this when the experiment finishes
jsPsych.data.displayData(); //Display the data onto the browser screen
}
});
</script>
</html>