-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
41 lines (38 loc) · 1.36 KB
/
example.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
<!DOCTYPE html>
<html>
<head>
<title>experiment</title>
<script src="https://unpkg.com/jspsych"></script>
<script src="https://unpkg.com/@jspsych/plugin-preload"></script>
<script src="https://unpkg.com/@jspsych/plugin-html-keyboard-response"></script>
<script src="https://unpkg.com/@jspsych/plugin-call-function"></script>
<script src="https://unpkg.com/@jspsych/plugin-canvas-keyboard-response"></script>
<script src="https://unpkg.com/@jspsych/plugin-instructions"></script>
<script src="https://cdn.jsdelivr.net/gh/kinleyid/jspsych-2st@v0.6.0/2st.js"></script>
<link href="https://unpkg.com/jspsych/css/jspsych.css" rel="stylesheet" type="text/css" />
</head>
<body></body>
<script>
var jsPsych = initJsPsych({
on_finish: function() {
jsPsych.data.displayData();
},
});
two_step_task.images.set_files_to_default();
var timeline = [
{ // preload
type: jsPsychPreload,
images: two_step_task.images.list_filenames()
},
two_step_task.trials.initialize_experiment(),
two_step_task.trials.example_instructions(),
// Reset reward probabilities:
two_step_task.trials.initialize_experiment(),
{ // full experiment
timeline: [two_step_task.trials.single_trial()],
repetitions: 100
},
];
jsPsych.run(timeline);
</script>
</html>