-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexperiment.html
32 lines (28 loc) · 941 Bytes
/
experiment.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
<!DOCTYPE html>
<html>
<head>
<title>My experiment</title>
<script src="https://unpkg.com/[email protected]"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<script src="https://unpkg.com/@jspsych-contrib/plugin-pipe"></script>
<link href="https://unpkg.com/[email protected]/css/jspsych.css" rel="stylesheet" type="text/css" />
</head>
<body></body>
<script>
const jsPsych = initJsPsych();
const subject_id = jsPsych.randomization.randomID(10);
const filename = `${subject_id}.csv`;
const hello_trial = {
type: jsPsychHtmlKeyboardResponse,
stimulus: 'Hello world!'
}
const save_data = {
type: jsPsychPipe,
action: "save",
experiment_id: "0OEr3EfICc11",
filename: filename,
data_string: ()=>jsPsych.data.get().csv()
};
jsPsych.run([hello_trial, save_data]);
</script>
</html>