Post by isaidhi on Mar 3, 2023 16:26:54 GMT
Hi, 5 years ago I'm creating a modified Stroop task for mobile phone usage. The task is not very different with the one existing in PsyToolkit experiment page. The only different is graphic design, and extra 4 button for response (answering what color appear).
Past 6 months I come back to make a shorter version for showcase purpose, but the the bug appear.
Here's my code (sorry for the language, but hope you guys get the logic)
Bug detail:
I've heard similar bug happened in phaser (game development tool). Can anyone find how to fix?
Past 6 months I come back to make a shorter version for showcase purpose, but the the bug appear.
Here's my code (sorry for the language, but hope you guys get the logic)
options
resolution 780 460
mouse on
fullscreen
bitmaps
biru1 #blue1
hijau1 #green1
kuning1 #yellow1
merah1 #red1, etc. first word indicates color name, "1" indicates task 1, guessing the word
biru2
hijau2
kuning2
merah2
biruhijau # this is two words combined, means bluegreen. This is for task 3, guessing the color with different text label than its color
birukuning
birumerah
hijaubiru
hijaukuning
hijaumerah
kuningbiru
kuninghijau
kuningmerah
merahbiru
merahhijau
merahkuning
i
ia1 # i stands for instruction. "a" stands for 1st block, "1" stands for page 1 of instruction in first block
ia2
ia3
ia4
ib
ib1
ib2
ib3
ib4
ic
ic1
ic2
ic3
ic4
start
next
back
Btap #these are "tap", the button for the initial colors: biru (blue), hijau (green), merah (red), and kuning (yellow)
Htap
Mtap
Ktap
Brespon #these are just a helper. So these are buttons in light blue color. When you tap one button, this appear to indicate what you are tapping
Hrespon
Krespon
Mrespon
benar #correct
salah #wrong
fonts
arial 18
# table: write condition,stimulus,response
table word
"biru word" biru1 2
"hijau word" hijau1 3
"kuning word" kuning1 4
"merah word" merah1 5
table color
"biru color" biru2 2
"hijau color" hijau2 3
"kuning color" kuning2 4
"merah color" merah2 5
table cw
"biru hijau" biruhijau 3
"biru kuning" birukuning 4
"biru merah" birumerah 5
"hijau biru" hijaubiru 2
"hijau kuning" hijaukuning 4
"hijau merah" hijaumerah 5
"kuning biru" kuningbiru 2
"kuning hijau" kuninghijau 3
"kuning merah" kuningmerah 5
"merah biru" merahbiru 2
"merah hijau" merahhijau 3
"merah kuning" merahkuning 4
task word
table word
show background 255 255 255 #1, the background
draw off
show bitmap Btap -290 130 #2, B button, etc.
show bitmap Htap -100 130 #3
show bitmap Ktap 100 130 #4
show bitmap Mtap 290 130 #5
show bitmap @2 0 -100 #6
draw on
set &klik 0
readmouse l @3 5000 range 2 5
set &klik UNDER_MOUSE # which bitmap was clicked?
clear 6
if &klik == 2
show bitmap Brespon -290 130 #bitmap 7
fi
if &klik == 3
show bitmap Hrespon -100 130 #bitmap 7
fi
if &klik == 4
show bitmap Krespon 100 130 #bitmap 7
fi
if &klik == 5
show bitmap Mrespon 290 130 #bitmap 7
fi
if STATUS == CORRECT
show bitmap benar 0 -100 #bitmap 8
fi
if STATUS != CORRECT
show bitmap salah 0 -100 #bitmap 8
fi
delay 300
clear 7 8
save BLOCKNAME @1 TABLEROW STATUS RT &klik MOUSE_X MOUSE_Y
task color
table color
show background 255 255 255 #1
draw off
show bitmap Btap -290 130 #2
show bitmap Htap -100 130 #3
show bitmap Ktap 100 130 #4
show bitmap Mtap 290 130 #5
show bitmap @2 0 -100 #6
draw on
set &klik 0
readmouse l @3 5000 range 2 5
set &klik UNDER_MOUSE # which bitmap was clicked?
clear 6
if &klik == 2
show bitmap Brespon -290 130 #bitmap 7
fi
if &klik == 3
show bitmap Hrespon -100 130 #bitmap 7
fi
if &klik == 4
show bitmap Krespon 100 130 #bitmap 7
fi
if &klik == 5
show bitmap Mrespon 290 130 #bitmap 7
fi
if STATUS == CORRECT
show bitmap benar 0 -100 #bitmap 8
fi
if STATUS != CORRECT
show bitmap salah 0 -100 #bitmap 8
fi
delay 300
clear 7 8
save BLOCKNAME @1 TABLEROW STATUS RT &klik MOUSE_X MOUSE_Y
task cw
table cw
show background 255 255 255 #1
draw off
show bitmap Btap -290 130 #2
show bitmap Htap -100 130 #3
show bitmap Ktap 100 130 #4
show bitmap Mtap 290 130 #5
show bitmap @2 0 -100 #6
draw on
set &klik 0
readmouse l @3 5000 range 2 5
set &klik UNDER_MOUSE # which bitmap was clicked?
clear 6
if &klik == 2
show bitmap Brespon -290 130 #bitmap 7
fi
if &klik == 3
show bitmap Hrespon -100 130 #bitmap 7
fi
if &klik == 4
show bitmap Krespon 100 130 #bitmap 7
fi
if &klik == 5
show bitmap Mrespon 290 130 #bitmap 7
fi
if STATUS == CORRECT
show bitmap benar 0 -100 #bitmap 8
fi
if STATUS != CORRECT
show bitmap salah 0 -100 #bitmap 8
fi
delay 300
clear 7 8
save BLOCKNAME @1 TABLEROW STATUS RT &klik MOUSE_X MOUSE_Y
block word
message ib mouse
bitmap back -240 190 next 240 190 start 0 190
pager option mouse back -240 190 next 240 190 start 0 190
pager i ia1 ia2 ia3 ia4
maxtime 60s
tasklist
word 10 no_repeat
end
block color
message ic mouse
bitmap back -240 190 next 240 190 start 0 190
pager option mouse back -240 190 next 240 190 start 0 190
pager ib1 ib2 ib3 ib4
maxtime 60s
tasklist
color 10 no_repeat
end
block cw
bitmap back -240 190 next 240 190 start 0 190
pager option mouse back -240 190 next 240 190 start 0 190
pager ic1 ic2 ic3 ic4
maxtime 60s
tasklist
cw 10 no_repeat
end
feedback
text align center
set &Benar sum c4 ; select c4 == 1
set &BenarDtk mean c5; select c4 == 1
text 0 -100 "Hasil tes anda"
text 0 -75 &Benar ; prefix "Benar: " ; postfix " dari 30"
text 0 0 "Waktu (rata-rata)"
text 0 25 &BenarDtk; prefix "Rata-rata waktu menjawab benar:" ; postfix "ms"
text 0 100 "Sentuh untuk melanjutkan survey"
wait_for_key mouse
end
Bug detail:
- The order is: first instruction, then first task, this is block one; end of first instruction, second instruction, second task (this is block two); end of second task instruction, third instruction, third task (this is third block)
- The bug appear in instruction 2 and 3.
- So when instructions appear, the former K button area hitbox still active even though the K button already removed. And instead of the bug recording response, it acted like start button: skip all the instructions and start the task rightaway.
I've heard similar bug happened in phaser (game development tool). Can anyone find how to fix?