Skip to content

Commit 320bee7

Browse files
fixed 'record', randomized keys, full length, ready for live
1 parent 8ebae5c commit 320bee7

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

src/App.vue

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
right part of your screen.
1616
</p>
1717
<p>
18-
Whenever you see a circle, please press the 'p' key on your keyboard,
19-
whenever you see a square, please press the 'q' key - regardless of the
18+
Whenever you see a <strong>{{keyQisForShape == "circle" ? 'circle' : 'square'}}, press 'q'</strong> on your keyboard,
19+
whenever you see a <strong>{{keyQisForShape == "circle" ? 'square' : 'circle'}}, press 'p'</strong> - regardless of the
2020
position of the shape.
2121
</p>
2222
<p>
@@ -36,17 +36,10 @@
3636
<template v-for="(trial, i) in trialsTrain">
3737
<KeypressScreen
3838
:key="i"
39-
:keys="{ q: 'square', p: 'circle' }"
39+
:keys="{ q: keyQisForShape, p: keyQisForShape == 'circle' ? 'square' : 'circle' }"
4040
:fixation-time="Math.floor(Math.random() * 1500 + 1200)"
4141
>
4242

43-
<Record :data="{
44-
trial: i,
45-
target_object: trial.target_object,
46-
target_position: trial.target_position,
47-
phase: 'test'
48-
}" />
49-
5043
<template #stimulus>
5144
<CanvasStage :config="{ width: 800, height: 400 }">
5245
<CanvasLayer>
@@ -71,6 +64,13 @@
7164
/>
7265
</CanvasLayer>
7366
</CanvasStage>
67+
<Record :data="{
68+
trial: i,
69+
keyQisForShape: keyQisForShape,
70+
target_object: trial.target_object,
71+
target_position: trial.target_position,
72+
phase: 'test'
73+
}" />
7474
</template>
7575
</KeypressScreen>
7676
</template>
@@ -82,16 +82,10 @@
8282
<template v-for="(trial, i) in trialsTest">
8383
<KeypressScreen
8484
:key="i"
85-
:keys="{ q: 'square', p: 'circle' }"
85+
:keys="{ q: keyQisForShape, p: keyQisForShape == 'circle' ? 'square' : 'circle' }"
8686
:fixation-time="Math.floor(Math.random() * 1500 + 1200)"
8787
>
8888

89-
<Record :data="{
90-
trial: i,
91-
target_object: trial.target_object,
92-
target_position: trial.target_position,
93-
phase: 'training'
94-
}" />
9589
<template #stimulus>
9690
<CanvasStage :config="{ width: 800, height: 400 }">
9791
<CanvasLayer>
@@ -116,28 +110,40 @@
116110
/>
117111
</CanvasLayer>
118112
</CanvasStage>
113+
<Record :data="{
114+
trial: i,
115+
keyQisForShape: keyQisForShape,
116+
target_object: trial.target_object,
117+
target_position: trial.target_position,
118+
phase: 'training'
119+
}" />
119120
</template>
120121
</KeypressScreen>
121122
</template>
122123

123124

124125
<PostTestScreen />
125126

126-
<DebugResultsScreen />
127+
<SubmitResultsScreen />
128+
127129
</Experiment>
128130
</template>
129131

130132
<script>
131133
import _ from 'lodash';
134+
135+
var keyQisForShape = _.sample(["square", "circle"])
136+
132137
export default {
133138
name: 'App',
134139
135140
data() {
136-
const trialsTrain = _.map(_.range(1), () => _.sample(conditions));
137-
const trialsTest = _.map(_.range(2), () => _.sample(conditions));
141+
const trialsTrain = _.map(_.range(10), () => _.sample(conditions));
142+
const trialsTest = _.map(_.range(20), () => _.sample(conditions));
138143
return {
139144
trialsTrain,
140-
trialsTest
145+
trialsTest,
146+
keyQisForShape
141147
};
142148
}
143149
};

0 commit comments

Comments
 (0)