Stuck in debugging online experiment (Corsi-like task): loops with updating Canvas & ROIs
Hi everyone,
I'm trying to set up a Corsi-like task. As I'm not quite sure where the origin of my problem is (maybe OSWeb-functionalities?), I'll attach the experiment and describe the general procedure and problem:
Each participant is presented with a screen with 10 squares in 18 trials. The squares are colored yellow in a certain order, which is what the subject is supposed to click on. The squares also change their position in each trial. In the first two trials 2 of these squares turn yellow, in the 3rd and 4th trials 3 of these squares turn yellow, in the 5th and 6th trials 4 of these squares turn yellow ... until all 10 squares turn yellow in the 17th and 18th trial (see n_yellow in corsi_loop). On each trial, the subjects are asked to click (mouse response) the order of the squares that they see light up. They click on OK when they think that they are done.
Each square a subject has clicked should light up yellow (before clicking on OK, getting feedback and moving to the next trial).
My problem is: Only the first square (defined by c1 = x, d1 = y) lights up (turns yellow), independent of the square I click on, and I cannot get to the next trial when clicking OK. Also, when getting to the next trial (forced through setting OK_clicked = "yes" in the script), the Canvas is somehow distorted.
Potential origin of the problem: I have the feeling that there may be a problem with the loops (e.g., OpenSesame constantly shows me that variables are not defined when using other backends, but they are defined in the loops and - due to this issue - additionally in the script before calling them. background: I used the experiment backend in order to see if the ROIs are correctly defined). Also the distortion of the Canvas makes me wonder if its loop-related (using feedback items instead of the sketchpads did not solve my problem).
Maybe there is also an issue with the use of arrays in inline javascript (but I tested their general functionality before implementing the loop).
I have already programmed online experiments in which squares appear in a similar way in the places where they were clicked. I feel like I have tried everything, but I really do not know any more - probably I am blind from all the searching.
I know the request is rather extensive, but if someone has the time to look into this - or knows from reading this description what the origin of my problem might be - I would be very grateful!
Many thanks in advance!
Carla
Comments
Update: I found an (unrelated) bug that I'll fix and then upload the updated version again.
Edit: I recognized that I was accessing "internal" variables (probably not the correct wording) through "height" and "width", which distorted the image on the screen - solving that issue at least ;-)