-
Notifications
You must be signed in to change notification settings - Fork 0
/
stroop.pf
103 lines (81 loc) · 3.04 KB
/
stroop.pf
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
"""
Stroop effect
--------------------
See also:
https://en.wikipedia.org/wiki/Stroop_effect
"""
colors = [red, green, blue, yellow]
test Stroop {
| word | color | congruency | expected |
| ----------- | ----------- | ------------------------------------------- | -------- |
| colors loop | colors loop | congruent if word == color else incongruent | color |
/*
Color mapping:
red color -> left keyboard
green color -> down keyboard
blue color -> right keyboard
yellow color -> up keyboard
*/
/* Response is generated acording to color mapping.
Since this is a relatively small condition table we could just spell it out like:
| word | color | congruency | response |
|----------+---------+-------------+----------|
| red | red | congruent | left |
| red | green | incongruent | left |
| red | blue | incongruent | left |
| red | yellow | incongruent | left |
| green | red | incongruent | down |
| green | green | congruent | down |
| green | blue | incongruent | down |
| green | yellow | incongruent | down |
| blue | red | incongruent | right |
| blue | green | incongruent | right |
| blue | blue | congruent | right |
| blue | yellow | incongruent | right |
| yellow | red | incongruent | up |
| yellow | green | incongruent | up |
| yellow | blue | incongruent | up |
| yellow | yellow | congruent | up |
instead of using expressions in table cells.
*/
fix -> cross() for 1000..3000 choose
exec -> text(content word, color color)
keyboard(valid colors, correct expected)
error -> circle(radius 100, fillColor red, color red) for 100
correct -> circle(radius 100, fillColor green, color green) for 100
// Sound playing in PsychoPy is messy in Windows at the moment
// correct -> sound(freq 500) for 300
// error -> sound(freq 1000) for 300
}
screen Practice {
Stroop test
----------
You will be presented with a colored words.
Your task is to press:
- LEFT for the RED color.
- DOWN for the GREEN color.
- RIGHT for the BLUE color.
- UP for the YELLOW color.
Press SPACE for the practice block.
}
screen Real {
Stroop test
----------
Now a REAL testing will be performed.
Press SPACE for the real block.
}
flow {
show Practice
// Perform practice test serie
execute Stroop(practice true)
show Real
// Perform real test serie (collects data)
execute Stroop(random true)
}
target PsychoPy {
// Map colors to keyboard keys (actual color mapping)
keyboard.red = left
keyboard.green = down
keyboard.blue = right
keyboard.yellow = up
}