-
Notifications
You must be signed in to change notification settings - Fork 4
/
index_jspsych6.html
119 lines (108 loc) · 3.54 KB
/
index_jspsych6.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html>
<html>
<head>
<title>My experiment</title>
<script src="https://unpkg.com/jspsych@6.3.1"></script>
<script src="js/jspsych-audio-tokens.js"></script>
<script src="js/audio-tokens.js"></script>
<script src="//d3js.org/d3.v4.min.js"></script>
<link href="https://unpkg.com/jspsych@6.3.1/css/jspsych.css" rel="stylesheet" type="text/css" />
</head>
<body>
</body>
<script>
// Array with stimulus file paths
var stimuli = [
'data/cven_00_02286_84473_617520.wav',
'data/cven_03_26059_84473_17388318.wav',
'data/cven_05_14026_84473_17255724.wav',
'data/cven_06_31405_84473_97708.wav',
'data/cven_07_27838_84473_566483.wav',
'data/cven_08_19497_84473_17246733.wav',
'data/cven_09_26764_84473_17637624.wav',
'data/cven_10_19680_84473_665433.wav',
'data/cven_17_17551_84473_512103.wav'
]
var single_feature_trial = {
type: 'audio-tokens',
ratingtype: 'features',
stimuli: stimuli.slice(0,4), // select only first four stimuli
label: ['Feature 1'],
anchors: [['low', '', 'high']],
force_listen: false,
loop: true,
prompt: '<p>Please rate these files</p>'
}
var multiple_feature_trial = {
type: 'audio-tokens',
ratingtype: 'features',
stimuli: stimuli.slice(0,4),
label: ['Feature 1', 'Feature 2', 'Feature 3'],
anchors: [['low', '', 'high'],
['low', '', 'high'],
['low', '', 'high']],
force_listen: false,
loop: true,
draw_edges: true
}
var features2d_trial = {
type: 'audio-tokens',
ratingtype: 'features2d',
stimuli: stimuli, // select all stimuli
label: ['Feature 1', 'Feature 2'],
anchors: [['low', '', 'high'],
['low', '', 'high']],
force_listen: false,
loop: true,
draw_edges: true
}
var categories_trial = {
type: 'audio-tokens',
ratingtype: 'categories',
stimuli: stimuli,
label: ['Category 1', 'Category 2'],
force_listen: false,
loop: true
}
var cluster_trial = {
type: 'audio-tokens',
ratingtype: 'cluster',
stimuli: stimuli,
force_listen: false,
loop: true
}
var similarity_trial = {
type: 'audio-tokens',
ratingtype: 'similarity',
stimuli: stimuli,
force_listen: false,
loop: true,
draw_edges: true
}
var triplets_trial = {
type: 'audio-tokens',
ratingtype: 'triplets',
stimuli: stimuli,
force_listen: false,
loop: true
}
// Add all trials to a timeline array
var timeline = [
single_feature_trial,
multiple_feature_trial,
features2d_trial,
categories_trial,
cluster_trial,
similarity_trial,
triplets_trial
]
// Start jspsych experiment
jsPsych.init({
timeline: timeline,
show_progress_bar: true,
on_finish: function() {
jsPsych.data.displayData();
}
})
</script>
</html>