I modified your code to add two more color patches on the top and the bottom. Specifically, the changes included creating four images (named left, right, top, and bottom), putting them on a canvas and adding top and bottom to your original code (see below). When I tried to log the var(“choice”), it showed up “undefined” in the result while other results were recorded correctly.
newFunction( ()=>new Promise(r=>$(".PennController-left, .PennController-right, .PennController-top, .PennController-bottom").bind('mouseenter', e=>getVar("choice").set( e.target.className.replace(/^.*(left|right|top|bottom).*$/,"$1") )._runPromises().then(r) )) ).call()
I also added a feedback screen, and sometimes the error feedback shows up even though I choose the correct response. This usually happens after a few trials.
To test the script, I changed the correct answer to always be the top one (see below), but I still got error feedback sometimes when I only chose the top patch. This also usually only happens after a few trials.
Is there something wrong with my modification? Here is the link to my experiment in case you want to take a look. Thank you!
getVar("choice").test.is("top") .failure(getTooltip("wrong").print("center at 50vw" , "center at 50vh").wait(), newTimer(1000).start().wait()) .success(newTimer(500).start().wait()) )