URL of experiment: No repository · Samantha Walters / TIQuestionnaires_v2 · GitLab
Description of the problem: I’m trying to find a way to end a “Form” on pavlovia, after first making sure that the form has been filled out. I have tried two approaches, and both result in being stuck at “initializing experiment” in the browser.
Psychopy2020.2.2, win10, firefox.
What I’ve tried:
- Using the code component from the BFI demo that creates a visualButton.stim & checks for form.Complete, changing the formName to mine (TIQues). The BFI demo is only written in PY, so I also used Auto > JS to attempt online functionality.
Result: Stuck on “initializing experiment” when I try to run it in psychopy. I’m not sure if this is just an issue with the auto translation to js, or if this is not yet supported for Forms on pavlovia. Any insight?
#1 Auto>JS code in BeginRoutine:
continueButton = new visual.ButtonStim(win, {"labelText": "Continue", "pos": [0.35, (- 0.4)]});
#1 Auto>JS code in EachFrame:
continueButton.draw();
if (TIQues.formComplete()) {
continueButton.buttonEnabled = true;
}
if (continueButton.buttonSelected) {
continueRoutine = false;
}
- I tried adapting from this post for Slider: How to get space bar to end routine only after rating is collected - #8 by dvbridges , where the ptp can only press “space” to proceed after the slider has been used. It works successfully for me on pavlovia as a slider; I essentially changed "
thisSlider.getRating()
" to “thisForm.formComplete”.
Result: After syncing to pavlovia, I again get stuck at “initializing experiment”.
#2 JS code in Each Frame:
let theseKeys = psychoJS.eventManager.getKeys({keyList:['space']});
// check for quit:
if (theseKeys.indexOf('escape') > -1) {
psychoJS.experiment.experimentEnded = true;
}
if (theseKeys.length > 0) { // at least one key was pressed
let completed_ratings = 0;
for(var thisForm of [TIQues]) {
if (TIQues.formComplete() !== undefined) {
completed_ratings = completed_ratings + 1;
}
}
if (completed_ratings === 1) {
continueRoutine = false; // end now
}
}
Are these issues due to Pavlovia “Form” functionality being new/still in beta for py2020.2.2? Or is there a current work-around solution to check that the entire form is filled out before allowing either a button/key press advance in a JS code component (or ideally both PY & JS if possible!)?
Thanks in advance!