|
Post by researcher on May 14, 2021 22:30:55 GMT
Hi,
I'm setting up an experiment and strugging with coding. It involves 15 questions divided into three groups (namely gp5, gp4 and gp3), while the informant has to press the keys "a" for grammatical sentences and "l" for ungrammatical ones. For every question, the informant has to press a button for the question to be shown and he/she will have to press "a" or "l" as soon as possible. I'd like to measure response time for every question and obtain the score for every group of questions, i.e. X correct answers out of 5.
Could somebody tell me why my codes below don't work? I'd appreciate your help.
----------------------------------------------------------------------------------------------------------
fonts
arial 40
table gp5
"What did you tell him today?" 1
"Why has he lost his wallet?" 1
"Where did the minister eat?" 1
"When the telephone has rung?" 2
"What the cat didn’t see?" 2
table gp4
"Has he closed the door?" 1
"Turn off it" 2
"Has his mother become a teacher?" 1
"You have received the information?" 2
"Switch on it" 2
table gp3
"Does the event matter?" 1
"The manager forget the story" 2
"Do they speak the language?" 1
"Do artists always write letter?" 1
"It do improve my memory?" 2
task simpletask
table gp5 gp4 gp3
keys a l
delay 100
show text @1 0 -25
readkey @2 5000
clear 1
save BLOCKNAME TABLEROW @1 @2 RT TT STATUS
block firstblock
tasklist
simpletask 1
end
|
|
|
Post by matia on May 15, 2021 6:42:15 GMT
Hello, your code doesnt work because you use three tables in one task. You cant have three tables. Make them into one and add a column in which you will define each group (for example add a column to the first table in which you will repeat 5, then in second add a columm containing 4s and in the third add 3s. Merge them into one table and save @3 so you know which group does it belong to..
Additionally, you should check online documentation for the wait_for_key command (if you wish your participants to press the key before they are presented with a sentence). Scores can be calculated with a set commmand (make sure to define which rows you are taking into account (check online docs).
Good luck! Matia
|
|
|
Post by researcher on May 17, 2021 18:03:33 GMT
Hello, your code doesnt work because you use three tables in one task. You cant have three tables. Make them into one and add a column in which you will define each group (for example add a column to the first table in which you will repeat 5, then in second add a columm containing 4s and in the third add 3s. Merge them into one table and save @3 so you know which group does it belong to.. Additionally, you should check online documentation for the wait_for_key command (if you wish your participants to press the key before they are presented with a sentence). Scores can be calculated with a set commmand (make sure to define which rows you are taking into account (check online docs). Good luck! Matia Thank you, Matia. I've just edited the code (see below) but the error message comes up saying "Problem: Your table has different numbers of items on this row within strings than on the row before". I don't really get why as I have three items in every row. ---------------------------------------------------------------------------------------------------------------- fonts arial 40 table reading "What did you tell him today?" 1 5 "Why has he lost his wallet?" 1 5 "Where did the minister eat?" 1 5 "When the telephone has rung?" 2 5 "What the cat didn’t see?" 2 5 "Has he closed the door?" 1 4 "Turn off it" 2 4 "Has his mother become a teacher?" 1 4 "You have received the information?" 2 4 "Switch on it" 2 4 "Does the event matter?" 1 3 "The manager forget the story" 2 3 "Do they speak the language?" 1 3 "Do artists always write letter?" 1 3 "It do improve my memory?" 2 3 task simpletask table reading keys a l delay 100 show text @1 0 -25 readkey @2 2000 clear 1 save BLOCKNAME TABLEROW @1 @2 @3 RT TT STATUS block firstblock wait_for_key tasklist simpletask 1 end
|
|
|
Post by matia on May 18, 2021 6:29:25 GMT
The problem is that when you are saving @1 it actually is saving each word (inside the quotation marks) as a separate column. The error is not (or shouldn't be) an error but a warning to be careful since it could ruin your datafile.
Say you are saving @1 and RT, you could end up with the following:
Col1 Col2 Col3 Col4 Col5 Col6 Col7 What did you tell him today? 562 Turn it off 365
Just don't save @1 (you could perhaps add a column with an ID of each sentence and save it and then later recode it). It all says in the warning itself.
Best, Matia
|
|
|
Post by researcher on May 19, 2021 23:41:24 GMT
The problem is that when you are saving @1 it actually is saving each word (inside the quotation marks) as a separate column. The error is not (or shouldn't be) an error but a warning to be careful since it could ruin your datafile. Say you are saving @1 and RT, you could end up with the following: Col1 Col2 Col3 Col4 Col5 Col6 Col7 What did you tell him today? 562 Turn it off 365 Just don't save @1 (you could perhaps add a column with an ID of each sentence and save it and then later recode it). It all says in the warning itself. Best, Matia Thanks. I tried to run the experiment but just a black screen turned up without the text, i.e. the questions and sentences on the table, that I wanted to show. I wonder if there's anything wrong with the command of showing the text.
|
|
|
Post by matia on May 20, 2021 6:55:40 GMT
Not sure where the problem is. Try this reproducible example (just copy paste it and try it for yourself):
table mytable "There once was a ship that put to sea" 1 "Sentence 1" #@1 is the sentence "And the name of that ship was the Billy o' Tea" 1 "Sentence 2" #@2 is the correct key to be pressed "The winds blew hard, her bow dipped down" 2 "Sentence 3" #@3 is the Sentence ID that can be save since "Blow, me bully boys, blow (Huh!)" 2 "Sentence 4" #each row the same no. of elements (2) task a keys a l show text @1 readkey @2 5000 clear screen delay 200 save RT STATUS @2 @3
block a tasklist a 5 end You'll notice that Psytoolkit will give you an error, but don't mind it, go an run an experiment.
Best, Matia
|
|
|
Post by researcher on May 21, 2021 22:13:01 GMT
Not sure where the problem is. Try this reproducible example (just copy paste it and try it for yourself):
table mytable "There once was a ship that put to sea" 1 "Sentence 1" #@1 is the sentence "And the name of that ship was the Billy o' Tea" 1 "Sentence 2" #@2 is the correct key to be pressed "The winds blew hard, her bow dipped down" 2 "Sentence 3" #@3 is the Sentence ID that can be save since "Blow, me bully boys, blow (Huh!)" 2 "Sentence 4" #each row the same no. of elements (2) task a keys a l show text @1 readkey @2 5000 clear screen delay 200 save RT STATUS @2 @3
block a tasklist a 5 end You'll notice that Psytoolkit will give you an error, but don't mind it, go an run an experiment.
Best, Matia
Many thanks. The problem is solved.
|
|