Post by vinc690 on Jan 9, 2024 23:59:46 GMT
Hello,
I've been trying to use textboxes and/or readkeys to acquire multiple bits of information from a participant, but I'm having trouble.
The task is a simple ranking of 5 photo displayed on a screen. I'd like to have a small textbox under each photo where the participant can enter a number.
However it seems that at best I can get textboxes displaying sequentially; after one response is registered than another textbox becomes available.
Is there any way to have 5 textboxes present on the screen simultaneously where a participant may enter values?
The code below is a modification of textbox example code - but it only allows textboxes sequentially.
options
fullscreen
resolution 1920 1080 #This makes the screen range from x = -960 -> 960 and y = -540 -> 540
task test
show text "Enter words and click green rectangle when done" 0 -280
show rectangle 0 400 50 50 green
textbox new -300 0 200 200 white blue 24 arial
readmouse l 2 99999 range 1 5 #mouse button press after value entered into first textbox.
set %a textbox #save textbox 1 value
textbox 2 0 0 200 200 white green 24 arial
readmouse l 2 99999 range 1 5
set %b textbox #save textbox 2 value
textbox 3 300 0 200 200 white red 24 arial
readmouse l 2 99999 range 1 5
set %c textbox #save textbox 3 value
save %a %b %c
textbox 1 clear
textbox 2 clear
textbox 3 clear
block x
tasklist
test 1
end
I've been trying to use textboxes and/or readkeys to acquire multiple bits of information from a participant, but I'm having trouble.
The task is a simple ranking of 5 photo displayed on a screen. I'd like to have a small textbox under each photo where the participant can enter a number.
However it seems that at best I can get textboxes displaying sequentially; after one response is registered than another textbox becomes available.
Is there any way to have 5 textboxes present on the screen simultaneously where a participant may enter values?
The code below is a modification of textbox example code - but it only allows textboxes sequentially.
options
fullscreen
resolution 1920 1080 #This makes the screen range from x = -960 -> 960 and y = -540 -> 540
task test
show text "Enter words and click green rectangle when done" 0 -280
show rectangle 0 400 50 50 green
textbox new -300 0 200 200 white blue 24 arial
readmouse l 2 99999 range 1 5 #mouse button press after value entered into first textbox.
set %a textbox #save textbox 1 value
textbox 2 0 0 200 200 white green 24 arial
readmouse l 2 99999 range 1 5
set %b textbox #save textbox 2 value
textbox 3 300 0 200 200 white red 24 arial
readmouse l 2 99999 range 1 5
set %c textbox #save textbox 3 value
save %a %b %c
textbox 1 clear
textbox 2 clear
textbox 3 clear
block x
tasklist
test 1
end