Forum Replies Created
-
AuthorPosts
-
pchen
ParticipantThat’s good to know. Thank you!
Peiyao
pchen
ParticipantHi Jeremy,
Thank you for your quick reply. I totally forgot about the CORS settings. It works again now.
When I tested the experiment under Incognito mode, it worked great. But when I tested under non-incognito mode, it sometimes still had the loading problem until I cleared the cache. Do you have any explanations for this? I’m just curious.
Thanks again,
Peiyaopchen
ParticipantI went back to 1.8 and everything is working now.
Thank you!pchen
ParticipantHi Jeremy,
Due to the recent upgrade (to 1.9), one function you wrote for my project doesn’t work anymore (see below). The original goal was to make a canvas disappear when the mouse moves to any of the four objects on that canvas (this thread has more details).
Is there a way I can access the older version of PennController? If not, could you help modify the following code? Thank you!newFunction( ()=>new Promise(r=>$(".PennController-left-container, .PennController-right-container, .PennController-top-container, .PennController-bottom-container").bind('mouseenter', function(e) { getVar("choice").set( this.className.replace(/^.*(right|top|bottom|left).*$/,"$1") )._runPromises().then(r); } )) ).call()
Peiyao
pchen
ParticipantThat works! Thanks!
pchen
ParticipantIt worked perfectly. Thank you so much!
pchen
ParticipantIt worked! Thanks!
pchen
ParticipantIt works now! Thank you!
Peiyao
pchen
ParticipantHi Jeremy,
I added “-container” to each element but still have the same issue. The var(“choice”) can’t log the actual response after a few trials.
The undefined problem has been resolved.Peiyao
pchen
ParticipantHi Jeremy,
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()) )
pchen
ParticipantHi Jeremy,
Yes. I did have a big canvas element. It worked now. Thank you so much for your help!
Peiyao
pchen
ParticipantHi Jeremy,
Thank you so much for your response. The script worked well for the study.
I do have two followup questions:1) what does the timeout of 1000 ms do exactly? I tried to change its duration, but nothing noticeable happened. However, there were a few times when I first moved the mouse, the trial didn’t end. The trial only ended when I moved the mouse again to a different location. Does this has anything to do with the timeout?
2) Where should I add the feedback on a trial? When I added a tooltip after your second function, the tooltip itself appeared on the screen, but for some reason I can’t click on it and thus can’t move onto the next trial.
Let me know if you’d like more information.
Thanks,
Peiyaopchen
ParticipantIt worked! Thank you so much!
-
AuthorPosts