Week 1 Flashcards

1
Q

Copy the example and add code to remove the word “hotel” from the screen after 2000 ms and then have an empty 1500ms inter-stimulus interval between words. Also, remove the word “table” from the screen at the end.

text(“hotel”);
await(2000);
text(“table”);
await(2000);

A

text(“hotel”);
await(2000);
clear();
await(1500)

text(“table”);
await(2000);
clear();

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

How do you write a code for an input box and save the response under a certain variable?

A

input(“Write down the words remembered”, “words1”);

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

Write down the NeuroTask Scripting statement for a block that puts the following on the screen: A crimson-colored block with the text ‘Hello’. The block must have a margin of 20% from the left and 30% from the top with similar margins on the right and bottom.

A
var b = main.addblock(20,30,60,40,
                      "yellow","Display text");
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which statement can you use to make the font 60% of the default size when then use the text() function (or any of the standard controls)?

A

main.setfontsize(60);

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

Write the JavaScript code that shows the words “One”, then when you click “Two”, and when you click again “Three”.

A

text(“One”);

await(“click”);

text(“Two”);

await(“click”);

text(“Three”);

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

If you want to use images as stimuli, why is it absolutely necessary to preload these?

A

Because it loads the images before they have to be presenting in the script making presentation times instantaneous, therefore more accurate.

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

Why is it usually not possible to show an image for 15 ms on a computer screen?

A

Because 15ms is typically faster than the refresh rate on a computer monitor, therefore the image will possibly be presented and gone before it even refreshes the screen or it could be longer than 15ms while the screen waits to refresh.

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

Write one line of code that waits for either the left or the right arrow to be pressed with a time-out of 3000 ms.

A

awaitkey(“RIGHT_ARROW,LEFT_ARROW”,3000);

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

Copy and modify the following code so that the subject sees a message that says: “Please, try to respond faster next time (within 3 seconds)” when that are slow (i.e., slower than 3000 ms).

var e;
text(“Press s or l within 3 s”);
e = awaitkey(‘s,l’,3000);
text(“Your RT was: “ + e.RT.toFixed(2) + “ ms”);

A

var e;
text(“Press s or l within 3 s”);
e = awaitkey(‘s,l’);

if (e.RT >3000) or if (e.type === "timeout")
{
    text("Your RT was: " + e.RT.toFixed(2) + " ms, Please try to be faster next time (within 3 seconds)");
    await(4000);
    clear();
}
else if (e.RT.toFixed(2)<3000)
{
    text("Your RT was: " + e.RT.toFixed(2) + " ms, Good job!");
    await(4000);
    clear();
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

If you have written code such as: e = awaitkey(‘s,l’,3000), how can you find out whether the s-key or the l-key was pressed? log + display

A

e = awaitkey(‘s,l’,3000);

text(“You pressed “ + e.key); // to display it

log(e.key, “key_resp”); // to record it as data

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

Give the code for making a bigger input box to allow for lists

A

largeinput(“Write down the words remembered”,”words_remembered”);

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

List three things wrong with the following script:

1 var i;
2 var words = (“glass”, “chair”, “train”, “balloon”,
3 “horse”, “curtain”, “pencil”, “baker”);
4
5 text(“Try to remember the following words”);
6 await(5000); // 5000 ms or 5 s
7
8 for (i = 0, i < words.length, i = i + 1)
9 [
10 text(words[i]);
11 await(2000);
12 clear();
13 await(1000);
14 ]
15
16 text(“Now, count back in threes starting with 307: 307, 304, 301,…”);
17 await(20000);
18
19 largeinput(“Write down the words remembered”,”words_remembered”);
20
21 text(“Thank you for participating!”);
22 await(3000);

A

[ ] are used for an array

{ } are used for if statements

, used instead of ; in for loop specifics

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

write a for loop that goes through 5 cycles

A
for (i = 0; i < 5; i = i + 1)
{
     text(words[i]);
     await(2000);
     clear();
     await(1000);
 }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Describe how to use an array of words using a text file

A

+ first make a text file (i.e., with the extension “.txt”) that contains the stimulus words without quotation marks, but separated by commas.

+ This file must be uploaded with NeuroTask’s Upload Files feature

+ the filename will appear in the Quick Reference side panel next to your script

+ words = getwords(“words.txt”);

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