Dear @jordandejoie , @dfareri ,
I just had a look at our server logs. It appears that almost all (> 99%) of the participant results are marked as incomplete. You can also ascertain that it is the case on your end, on the experiment page, where Jordan found the date of the last session:
The logs show the typical sign of experiment sessions interrupted before the data are saved.
This looked very odd to me since it is not possible for participants to be redirected at the end of a session without the session completing and the results being uploaded, i.e. PsychoJS waits for the data to be uploaded and, if all went well, redirect the participants.
So I had a look at the experiment code.
The problem is that contrary to Jordanâs answer to Wakeâs question about using PsychoPyâs completion URL and not custom code, this experiment is indeed using custom code and not PsychoPy/PsychoJS approach to redirection.
Indeed in the quitPsychoJS
function of WTP_SM_Choice_legacy.js
, we find
psychoJS.quit({message: message, isCompleted: isCompleted});
window.location.replace(weblink);
with window.location.replace(weblink);
as the manually added code.
The issue here is that PsychoJS.quit
is an asynchronous function, and you are not using await
. So, what happens, is that your experiment calls quit
, which starts taking care of results, but, almost immediately, you navigate to the completion URL. This results in a variety of session data not being saved since, as mentioned in the âSave incomplete resultsâ of the experiment page we cannot guarantee that data will be saved when experiments are suddenly interrupted (e.g. when tabs or browsers are abruptly closed, or when the tab suddenly navigates to a new URL).
The solution would be to remove the manual relocation code and use PsychoPy/PsychoJS approach. That should do the trick.
Cheers,
Alain