Post by bitmap-under-mouse trouble on Oct 9, 2019 10:58:47 GMT
Good morning everybody.
I am trying to program an online version of the Portuguese version of the Horne Ostberg Morningness-Eveningness Questionnaire. In order to do so, i am scripting the questions with the time-scales (kind of a ruler, where the participants should select their optimal time to perform certain tasks) on the experiment module of Psytoolkit and embeding them on a script on the online survey module.
However, i am having some problem collecting the participants responses. In order to do so, I wanted to use the "bitmap-under-mouse" function to make the program return the number corresponding to the position of specific bitmap on a list (the participant can select some bitmaps, but there are other ones that just present for graphical reasons). I already tried to set up a variable with the "bitmap-under-mouse" function in several ways (setting the variable as a global or local variable, restricting the "bitmap-under-mouse" funtion to a specific range of stimulus, and use the X e Y mouse coordinate funtions) and looked at the examples in the documentation and experiment library, but i can´t make the platform return the values of the specific bitmaps. Almost every combination retruns a compiling error. Psytoolkit only complies my script if i set up a variable containing the "bitmap-under-mouse" function as a global variable (set &resposta bitmap-under-mouse), but in this case when i try to run the experiment, the only thing i see is a black screen. The platform also compiles the script if i use the mouse coordinates function in conjunction with the "bitmap-under-mouse" function (set $resposta bitmap-under-mouse MOUSE_X MOUSE_Y) but in this case every response is returned with the value 1.
Basically, i want that the platform retains the position number (e. g. 1, 2, 3) of the stimulus that is clicked by the participant. Bellow, I leave you a draft of my script (the options that the want that the "bitmap-under-mouse" returns are highlighted in red) and the error i get if i try to use this function has it is examplified in the syntax documentation (advanced mouse functions: find number of stimulus clicked).
Thank you so much for your time and attention.
Regards,
Fábio.
Script example:
options
resolution 1000 800
set &WindowDuration 50000
mouse on
startbutton text Carregue uma vez na barra de espaço para avançar
startbutton readkey space
origin topleft
#set &resposta bitmap-under-mouse
bitmaps
EightFifteen
Eight
EightThirty
Nine
EightFortyFive
Horizontal_Line_1
Horizontal_Line_2
table MyTable
EightFifteen
Eight
EightThirty
Nine
EightFortyFive
task Pergunta1
table MyTable
show background 255 255 255
show bitmap EightFifteen 400 340
show bitmap Eight 400 380
show bitmap EightThirty 480 380
show bitmap Nine 560 380
show bitmap EightFortyFive 560 340
show bitmap Horizontal_Line_1 440 380
show bitmap Horizontal_Line_2 520 380
mouse show
readmouse l @1 &WindowDuration range 2 6
set $resposta bitmap-under-mouse
save $resposta
block testBlock
tasklist
Pergunta1 1
end
Compiling error:
/usr/bin/psycc.2.6.0:2307:in `process': undefined method `[]' for nil:NilClass (NoMethodError)
from /usr/bin/psycc.2.6.0:4275:in `block (2 levels) in
'
from /usr/bin/psycc.2.6.0:3980:in `each'
from /usr/bin/psycc.2.6.0:3980:in `block in
'
from /usr/bin/psycc.2.6.0:3841:in `each'
from /usr/bin/psycc.2.6.0:3841:in `
'
I am trying to program an online version of the Portuguese version of the Horne Ostberg Morningness-Eveningness Questionnaire. In order to do so, i am scripting the questions with the time-scales (kind of a ruler, where the participants should select their optimal time to perform certain tasks) on the experiment module of Psytoolkit and embeding them on a script on the online survey module.
However, i am having some problem collecting the participants responses. In order to do so, I wanted to use the "bitmap-under-mouse" function to make the program return the number corresponding to the position of specific bitmap on a list (the participant can select some bitmaps, but there are other ones that just present for graphical reasons). I already tried to set up a variable with the "bitmap-under-mouse" function in several ways (setting the variable as a global or local variable, restricting the "bitmap-under-mouse" funtion to a specific range of stimulus, and use the X e Y mouse coordinate funtions) and looked at the examples in the documentation and experiment library, but i can´t make the platform return the values of the specific bitmaps. Almost every combination retruns a compiling error. Psytoolkit only complies my script if i set up a variable containing the "bitmap-under-mouse" function as a global variable (set &resposta bitmap-under-mouse), but in this case when i try to run the experiment, the only thing i see is a black screen. The platform also compiles the script if i use the mouse coordinates function in conjunction with the "bitmap-under-mouse" function (set $resposta bitmap-under-mouse MOUSE_X MOUSE_Y) but in this case every response is returned with the value 1.
Basically, i want that the platform retains the position number (e. g. 1, 2, 3) of the stimulus that is clicked by the participant. Bellow, I leave you a draft of my script (the options that the want that the "bitmap-under-mouse" returns are highlighted in red) and the error i get if i try to use this function has it is examplified in the syntax documentation (advanced mouse functions: find number of stimulus clicked).
Thank you so much for your time and attention.
Regards,
Fábio.
Script example:
options
resolution 1000 800
set &WindowDuration 50000
mouse on
startbutton text Carregue uma vez na barra de espaço para avançar
startbutton readkey space
origin topleft
#set &resposta bitmap-under-mouse
bitmaps
EightFifteen
Eight
EightThirty
Nine
EightFortyFive
Horizontal_Line_1
Horizontal_Line_2
table MyTable
EightFifteen
Eight
EightThirty
Nine
EightFortyFive
task Pergunta1
table MyTable
show background 255 255 255
show bitmap EightFifteen 400 340
show bitmap Eight 400 380
show bitmap EightThirty 480 380
show bitmap Nine 560 380
show bitmap EightFortyFive 560 340
show bitmap Horizontal_Line_1 440 380
show bitmap Horizontal_Line_2 520 380
mouse show
readmouse l @1 &WindowDuration range 2 6
set $resposta bitmap-under-mouse
save $resposta
block testBlock
tasklist
Pergunta1 1
end
Compiling error:
/usr/bin/psycc.2.6.0:2307:in `process': undefined method `[]' for nil:NilClass (NoMethodError)
from /usr/bin/psycc.2.6.0:4275:in `block (2 levels) in
'
from /usr/bin/psycc.2.6.0:3980:in `each'
from /usr/bin/psycc.2.6.0:3980:in `block in
'
from /usr/bin/psycc.2.6.0:3841:in `each'
from /usr/bin/psycc.2.6.0:3841:in `
'