psychopy.org | Reference | Downloads | Github

Drag and drop online experiment crashes when using ipad

URL of experiment: Pavlovia

psychopy version: 2020.2.10

Description of the problem:

I have an experiment that has 3 different modes of operation depending on participant data. 2 methods just click on one of 2 boxes. The other drags a button into one of 2 boxes.
Everything works fine offline and online if I am using a PC. However when I am using an ipad it crashes after the 4th or 5th drag and drop action. I have tried using chrome instead of safari but it has the same problem.
It is not a problem with the click click only operations.
I cleaned up all browser data history and reset the network settings but nothing seems to help.
I suspect it is because the code does something every frame and this a problem for the ipad but do not know.

Any help would be greatly appreciated.

Thanks Phil

I have provided my javascript code below.


// DragAndDropState
// 0 Idle
// 1 Over The Target
// 2 Picked Up
// 3 Over Left Box
// 4 Over Right Box
// 5 Dropped In Left Box
// 6 Dropped In Right Box

// console.log('DragAndDropState' + DragAndDropState);

// Idle State
if (DragAndDropState === 0) {
    if (questionmark2.contains(mouse)) {
        DragAndDropState = 1; //Over The target
        boxchosen = null;
    }
}

// Over Target State
if (DragAndDropState === 1) {
    if (questionmark2.contains(mouse)) {
        DragAndDropState = 1; //stay in the same State
    } else {
        DragAndDropState = 0; //Idle
    }
    if (mouse.getPressed()[0] === 1) { //mouse button down
        DragAndDropState = 2; //Picked Up
    }
}

// Picked Up State
if (DragAndDropState === 2) {
    if (leftresponse3.contains(mouse)) {
        DragAndDropState = 3; // Over Left Box
        basketchosen = "left";
    }
    if (rightresponse3.contains(mouse)) {
        DragAndDropState = 4; // Over Right Box
        basketchosen = "right";
    }
    if (mouse.getPressed()[0] === 0) { //mouse button up
        DragAndDropState = 1; // Over Target
    }
 questionmark2.pos = mouse.getPos(); // move the target
}

// Over Left Box State
if (DragAndDropState === 3) {
    if (mouse.getPressed()[0] === 0) { //mouse button up
        DragAndDropState = 5; // Dropped In Left Box
  continueRoutine = false;
    }
    if (leftresponse3.contains(mouse)) {
        DragAndDropState = 3; // stay in the same State
 } else {
        DragAndDropState = 2; // picked up
        basketchosen = null;
    }
 questionmark2.pos = mouse.getPos(); // move the target
}


// Over right Box State
if (DragAndDropState === 4) {
    if (mouse.getPressed()[0] === 0) { //mouse button up
        DragAndDropState = 6; // Dropped In right Box
  continueRoutine = false;
    }
    if (rightresponse3.contains(mouse)) {
        DragAndDropState = 4; // stay in the same State
 } else {
        DragAndDropState = 2; // picked up
        basketchosen = null;
    }
 questionmark2.pos = mouse.getPos(); // move the target
}```

Hi @philBartlett, could you send me a link to your repo? Thanks, s.

Hi Sotirios,

Thanks for your response. I appreciate it.
I have never sent an experiment link to anyone before. Do I just copy the URL in Pavlovia to you or do I have to provide access to you, if so how?

Thanks Phil

Hi @philBartlett, no problem, yes you can just paste the URL into the message box. If the repo is private you can let me in by giving my account developer access as explained below,

https://docs.gitlab.com/ee/user/project/members/#add-a-user

Sorry, I cannot see a People option anywhere. Which screen on Pavlovia is it on? I have tried all of them. Maybe it needs to be enabled somehow?

Phil

Add a user

Right next to People, start typing the name or username of the user you want to add.

No worries @philBartlett, you need visit the GitLab project page, an URL in the form of gitlab.pavlovia.org/<username>/<project>, then Settings / Members as shown below,

When I go to the settings page I do not see members. I apologise but I just don’t see it. Below is what I see. Does the project have to be running. It is correctly in pilot mode.

@philBartlett That’s Chrome settings, it’s Pavlovia’s GitLab you want, x

Found it under view code!!! Not exactly obvious. I’ll let you know when I have given permission.

Alright, thanks, please note, I would need developer rights to access the code

Sotirios,

You are now a guest. The URL is https://pavlovia.org/bartl115/bunnynext
I really appreciate you looking at this for me. Good luck.
Running the experiment should be self explanatory but if you have any questions please ask.
As I said in my post when running it on an IPAD it fails the drag and drop after about 4 or 5 elements.

Phil

OK thanks, could you make it developer access por favor?

Done

Hi Sotiri,

Did you ever get a chance to try running the experiment.
Since my last post I have been having all kinds of problems running experiments on my ipads. Please see the post below for more details. Any help is greatly appreciated.

Phil

Hi @philBartlett, sorry I have been busy working on the new release, I should be able to take a look very soon, thanks, s.

Thanks Sotirios. I really appreciate your help.

Phil

Hi @philBartlett, no problem, alright I tried piloting the study on several iPads and can see there are issues with linking to a really old version of PsychoJS (3.2), which OK should be fairly straighforward to address, but was unable to get to the drag and drop routine. Can I ask which iPad model and which iOS / Safari version you are on please? Thanks, s.

Sotirios,

The latest version of my experiments no longer runs on either of the 2 ipads that I own. The only changes I have made to experiments is to add .wav files.
The ipads I have are:
ipad 8th generation - MYL92VC/A - ios 14.4
ipad 4th generation - MD510C/A - ios 10.3.3

The following posting describes what I have found from my investigations.
https://discourse.psychopy.org/t/experiment-does-not-run-on-my-ipad-but-does-on-another/20167

The latest version of the experiment I gave you access to is:
https://pavlovia.org/bartl115/uofwmemorystudydccs

I have given you developer access to it.

I have seen some posts where there is mention of a support fork. Is that what I need? And what does it do? I have 4 experiments that all have the same problem.

Thanks again.

Phil

Hi @philBartlett, many thanks for all the information, I can tell your project is based on a relatively old version of PsychoJS and would have liked to bring it up to date, but my PsychoPy is struggling to read the .psyexp open on the Mac for some reason!

That said, I was able to narrow the problem down to one of our dependencies used for audio playback, legacy howler.js, complaining about having to deal with .wav files. You could try a different format like .mp3, but I have created a support fork linking in howler.js latest and it seems to be running OK as is?