sweetbean.stimulus.HtmlKeyboardResponse
Blank
Bases: HtmlKeyboardResponse
shows a blank screen
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
__init__(duration=None, choices=None, correct_key='', side_effects=None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
time in ms the stimulus is presented |
None
|
|
choices
|
the keys that will be recorded if pressed |
None
|
|
correct_key
|
the correct key to press |
''
|
|
side_effects
|
Optional side-effect configuration passed to the runtime. This expects a list of SideEffect definitions (see SweetBean docs) which can be used to update global data like overall score or trial counter. |
None
|
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
Feedback
Bases: Text
show the word correct or incorrect dependent on a correct response to a stimulus before
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
__init__(duration=None, correct_message='Correct!', false_message='False!', correct_color='green', false_color='red', window=1, side_effects=None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
time in ms the stimulus is presented |
None
|
|
correct_message
|
the message to show if the response was correct |
'Correct!'
|
|
false_message
|
the message to show if the response was false |
'False!'
|
|
correct_color
|
the color of the message if the response was correct |
'green'
|
|
false_color
|
the color of the message if the response was false |
'red'
|
|
window
|
how far back is the stimulus to check (that stimulus needs to have a choice and a correct_key parameter) |
1
|
|
side_effects
|
Optional side-effect configuration passed to the runtime. This expects a list of SideEffect definitions (see SweetBean docs) which can be used to update global data like overall score or trial counter. |
None
|
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
Fixation
Bases: Text
show a white cross in the middle of the screen
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
__init__(duration=None, side_effects=None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
time in ms the stimulus is presented |
None
|
|
side_effects
|
Optional side-effect configuration passed to the runtime. This expects a list of SideEffect definitions (see SweetBean docs) which can be used to update global data like overall score or trial counter. |
None
|
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
Flanker
Bases: Text
show a flanker stimulus (<< < <<; << > <<, >> < >>, ...)
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |
__init__(duration=None, direction='left', distractor='left', choices=None, correct_key='', color='white', n_flankers=2, side_effects=None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
time in ms the stimulus is presented |
None
|
|
direction
|
the direction of the target (allowed: left, right, l, r, L, R) |
'left'
|
|
distractor
|
the direction of the distractor (allowed: left, right, l, r, L, R) |
'left'
|
|
choices
|
the keys that will be recorded if pressed |
None
|
|
correct_key
|
the correct key to press |
''
|
|
color
|
the color of the text |
'white'
|
|
n_flankers
|
the number of distractors |
2
|
|
side_effects
|
Optional side-effect configuration passed to the runtime. This expects a list of SideEffect definitions (see SweetBean docs) which can be used to update global data like overall score or trial counter. |
None
|
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |
HtmlKeyboardResponse
Bases: _KeyboardResponseStimulus
A base class for html stimuli
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
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 | |
__init__(duration=None, stimulus='', choices=None, correct_key='', side_effects=None, fit_to_viewport=None, min_rt=None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
time in ms the stimulus is presented |
None
|
|
stimulus
|
the html string representing that is rendered |
''
|
|
choices
|
the keys that will be recorded if pressed |
None
|
|
correct_key
|
the correct key to press |
''
|
|
side_effects
|
Optional side-effect configuration passed to the runtime. This expects a list of SideEffect definitions (see SweetBean docs) which can be used to update global data like overall score or trial counter.s |
None
|
|
fit_to_viewport
|
If True (default), the rendered content is
CSS-zoomed to fill (but not overflow) the viewport.
If False, natural layout + scrolling is used. If None,
the class-level default ( |
None
|
|
min_rt
|
Minimum response time in milliseconds. While > 0,
a document-level capturing keydown listener swallows
every key press for the first |
None
|
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
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 | |
Text
Bases: HtmlKeyboardResponse
Show colored text
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
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 | |
__init__(duration=None, text='', color='white', choices=None, correct_key='', side_effects=None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
time in ms the stimulus is presented |
None
|
|
text
|
the text should be presented |
''
|
|
color
|
the color of the text |
'white'
|
|
choices
|
the keys that will be recorded if pressed |
None
|
|
correct_key
|
the correct key to press |
''
|
|
side_effects
|
Optional side-effect configuration passed to the runtime. This expects a list of SideEffect definitions (see SweetBean docs) which can be used to update global data like overall score or trial counter.s |
None
|
Source code in sweetbean/stimulus/HtmlKeyboardResponse.py
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 | |