Neurotask Flashcards

Lecture 2 + 3 (73 cards)

1
Q

What is the structure of experiment script?

A
  • Welcome the subject
  • Ask for informed consent
  • Give instructions
  • Present stimuli (such as words)
  • Record responses (such as words remembered)
  • Debrief, where you may thank the subject for participating
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what does function ‘‘text’’ do?

A

it makes words centralized and big (remember to put word into a string “ “)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the main function of semicolons?

A

they enable to perform operations step-by-step

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does await() function?

A

it gives participant a visual break -> it waits for the number of ms typed in or for example until subjects clicks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what does function clear()?

A

it clears the text out

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what does function largeinput()?

A

it makes a text field with text to put into brackets, lasts until sb presses okay button

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the characteristic of code url of participant?

A

it is unique for each participant = can be used to identify participants

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

where is the experimental data stored?

A

in data dashword (export trial data - the one which interest you usually, but you can also export n variables - which gives you much more information)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how to put notes for yourself in the script?

A

// <- easiest way to do it!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between input() and largeinput()?

A

input() yields single line text box, whereas largeinput() generates large text box, of about 5 rows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the default box?

A

default box is a white box on a white background - called main
it fills the largest possible square on the screen and resizes on window resize

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the code to change the box color?

A

there are 2 ways to do it:
1 )var main = new Box(“lightgrey”)
2)var main = new Box(“#d3d3d3”) <- to achieve exact vision you have in mind you can use HEX color codes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What if you want to create sky blue box with orange border on the gray background?

A

var main = new Box(“skyblue”,”grey”,”red”,
100,40,”orange”,2);
where:
- “skyblue” - color of the box
- “grey” - color of the background
- “red”, 100 - red text, 100% standard font size
- 40 - 40 pixel-wide border
- “orange” - color of the border
- 2 - box has 2% margin inside so it doesn’t touch edges of the box

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

how to add blocks?

A

addblock(10,25,80,50, “yellow”, “Carrot”)
it adds yellow block at
- 10% from the left (margin)
- 25% from the top (margin),
- with width of 80% (100 - 10 - 10)
- and height of 50% (100 - 25 -25)
- with text Carrot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to organize space inside the box?

A

you can use blocks! you can put any number of blocks inside default box

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to make block centered?

A

addblock(“center”, “center”, 80, 50, “yellow”, “Carrot”)
it yields the same results as before, but instead of manually calculating margins, you can just use center command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How blocks can be stored?

A

Blocks can be stored in variables:
var t = addblock (“center”, “top”, 80, 10)
it is advisable because then you can for example apply text function directly to variable:
t.text (“this is experiment”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is default color of block?

A

Block is see-through, but desired colors can be given as 5th argument

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How to make font smaller or larger?

A

main.setfontsize(70); // Sets font-size to 70%
before setting the text function!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How to remove blocks?

A

removeblock()
if additionally you add parameter true:
main.removeblock(b,true)
the command removes block b from main but doesn’t destroy it!
you can put the block back with function Q.pushblock

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

how to permanently destroy block?

A

destroy()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How to clear all contents of box object?

A

boxclearall()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How to implement pictures into your experiment?

A

1) preload (“image.png”)
2) image.await(“preloading_completed”)
3) setimage (“image.png”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Why preloading images is important?

A

Because normally image needs to be retrieved from the server, then mapped to browser window and then shown = it takes a lot of time
However, with preloading the picture can be put into browser window within 1 second!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
What you should put into setimage() function?
you can put either name of image+extension (if updated in neurotask) or directly url address (it also works for preloading)
25
What is a difference between showimage() and setimage() functions?
showimage -> browser only changes style from invisible to visible -> so you need to make sure that preloading was successful -> however, it is advisable for brief stimuli presentation setimage -> makes image visible but can also retrieve it without preloading
26
How to show image in smaller size?
setimage("image.png",50) //shows image 50% smaller
27
What is preloading shortcut?
If all of your image files are the same and they differ just by number you can preload with range function! -> preload_range("cars{0}.png",1,7); image.await("preloading_completed"); it loads images titles cars1.png - cars6.png (note Python-esque indexing)
28
How to construct loops?
for (initialization; condition; step) initialization - where we start (f.ex: i = 0) condition - when to stop (f.ex. i < words.length -> as long as the count of words presented is equal to length of words list, the loop will run again) step = current value which will be changed after each execution of the loop (f.ex. i = i+1) don't forget curly brackets!
29
How to combine 2 arrays into 1 and then randomize order of items?
use stimuli = stimuli.concat(array1, array2) and then stimuli = shuffle(stimuli)
30
How to measure reaction times with now()?
for example: text("Press s or l"); t1 = now(); awaitkey('s,l'); t2= now(); RT = t2 - t1; text("Your reaction time was:" + RT)
31
What is important to remember when you want to present stimuli briefly and precisely?
you are limited by screen refresh rate - every about 16.7 ms screen refreshes - therefore, for subliminal presentation it is best to use await function with time that is just below the closest multiple of the refresh period (16 ms, 33 ms, 50 ms etc)
32
What is e variable?
it is event variable - it stores information about event can be used to for example store information about await function e = await(33)
33
How you can you check if everything went okay with your experiment with e = await(33)?
e.intendedTime -> the intended waiting time, which is 33 ms e.duration -> the REALIZED duration which may be f.ex. 34 or 39 ms e.delta -> e.duration - e.intendedTime e.timestamp = low-resolution time in ms that can be converted into date and time of day
34
What are printable keys?
letter keys! or in general any key on the keyboard
35
How to wait until subject presses key ''e''?
e = awaitkey("e") remember about lower case
36
How to wait until subjects presses any key?
e = await("keypress")
37
How to measure reaction time with e? What is main advantage of this method?
var e; text("Press s or l"); e = awaitkey('s,l'); text("Your reaction time was:" + e.RT) main advantage: RT is auto-recorded
38
How to add timeout?
var e; text("Press s or l within 3 seconds "); e = awaitkey('s,l', 3000); text("Your reaction time was:" + e.RT)
39
How to round reaction time to 2 decimals?
e.RT.toFixed(2)
40
How to motivate subject to respond faster?
var e; text("Press s or l within 3 seconds "); e = awaitkey('s,l', 3000); if (e.type === "timeout") { text("Please, respond faster!") } + optional else part note: pay attention to ( ) brackets
41
About what informs e.type?
about what kind of actions was triggered some examples: keypress (printable key pressed); keydown (non-printable key pressed), keyup (release of key), timeout (when subject pressed the key after designated time)
42
What equal sign is better for Java Script?
Java Script prefers === !
43
How to wait until subject presses non-printable key? For example any arrow key?
awaitkey("DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW) note: capitalized letters + underscore
44
what is funky about space bar?
it is considered both printable and non-printable so may be entered both as awaitkey(" ") awaitkey("SPACE")
45
how to wait until subject clicks any key?
await("click")
46
How to check what key was pressed?
e.key or console.log ("event: ", e)
47
How to make even shorter scripts?
You can always use getwords() function getowords("words.txt") this enables you to access text file with desired words (they need to be seperated by commas)
48
How to store data into your account?
use log function! log (e.RT, "Reaction Time") stores value of reaction time with name "Reaction Time" you can re-use log function and it will add rows to your data
49
What types of data are stored automatically? Why is it useful?
session state, browser (type), operating system, screen + window height and width useful for large experiments when you encounter weird data you can check whether the browser isn't too old or window size too small
50
What can you check with focus and blur?
Whenever a person changes the browser or tab, it is marked as blur Coming back to experiment is indicated as focus If you see blur-focus, blur-focus in data, you know participant was doing sth else at the same time
51
What is the difference between store() and log() functions?
Both of them work in the background however: -> log() every 10 seconds tries to send data to the server, each time it is called -> a new line of data is added -> store() overwrited its variable in the table (so it adds only one row)
52
What if you want to make sure that crucial piece of data is stored?
store_now() function! it interrupts the script flow -> data is saved, before script can proceed
53
What does increase function? How we can use it?
increase function increases the value of variable with 1 it can be used to assign subjects to conditions ! var subject_id = increase("Subject_ID", "script") so know subject id is stored as 1 then you can use modulo function subject_id%2 === 0 (even) subject_id%2 === 0 (odd) to check if subject_id is even or not and then divide participants based on their subejct id to the groups!
54
How to use logtrial?
as the name suggests logtrial does log the trial -> however -> it is extra fancy -> in addition to logging just a value and a variable name, you can also log the conditions logtrial(e.RT. "RT", stimuli, e.type) -> it logs RT under RT column + stores stimuli under con1 + stores e.type under con2 in datadashboard
55
What are layout options available?
fill layout - which fills the whole window square layout - limits the area in which your experiment is shown to the largest square that can be drawn across the window in which your experiments runs; unused areas are the background, resizing is automatic (font also resizes)
56
What is default font in Neurotask?
Arial
57
How can we stylize blocks to our liking?
var b = addblock ("right", "bottom", 10,10); b.text. ("Potato") to modify it we can use style() b.style("color","gray") <- makes text color gray b.style ("font-size", "80%") <- makes font size 80% smaller
58
Why you should be careful while using style function?
Because there may be subtle differences between browsers' implementation styles! Especially prominent with missing fonts -> it is better to use images of words if you need specific font
59
What if you want non-standard color combination?
b.style("color", "rgb(42%, 35%, 80%)") rgb = red green blue -> you can choose percentages of those colors to make your own color
60
What is opacity?
it is opposite to transparency! opacity = 0 (invisible) opacity = 1 (visible) can be also used with style() to make things more or less visible
61
How to make your own functions?
function text() <- signals the system you want to define the function { <- start body end ->} example: function hello() { text("Hello World!"); }
62
What are local variables?
those are variables defined inside the function, which won't exist outside it
63
What are important features of neurotask stats?
stat.mean stat.median stat.stddev stat.stderr (standard deviation of population mean) stat.variance stat.sumsqerr (sum of squared errors example: sum of squared deviations from mean) stat.min stat.max stat.range (difference between highest and lowest value)
64
What are limitations of functions?
function cannot return 2 values (possible in Python) when it does not return anything -> usually still returns undefined you cannot give default argument values
65
How to organize complex experiments with functions?
if you have many subtests, you can put each of these in a function and put that into seperate script then in your main experiment script, you can include those scripts in which functions are already defined
66
What if you want participants to click on pictures?
var e,response, first, create buttons with left = addblock(....).button("Yes") right = addblock(....).button("No") then assign waitfor { e = left.await('click'); response = "yes"; } or { e = right.await('click'); response = "no"; }
67
What are characteristics of waitfor...or... function?
it can be used when you are waiting for several events, if one event occurs, you move on with the rest of the script (so you are waiting for either one)
68
what are controls?
they are elements used in forms such as: – instruction – button – (text) input – (large text area) largeinput – select (dropdown) – radio (forced choice of one option) – scale (as radio but horizontal; Likert Scale) – check (boxes)
69
What are characteristics of select?
the options are provided in an array such as: select("What is your gender?", ['male', 'female'], 'gender') values are either male or female and they are stored in the gender column
70
What are characteristics of range?
it enables to quickly generate range of integers: select("What is your age", range (0,122), "age") watch out for Python indexing
71
What are characteristics of scale?
basically a likert scale scale("How well do you sleep at night?","Very badly", "Very well","sleep_quality",7);
72
What are characteristics of ratio?
the same format as select() but with fewer options possible