Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip initial dialog for incorporation of PsychoJS in interactive experiments #526

Open
mgrewe opened this issue Aug 30, 2022 · 0 comments
Open

Comments

@mgrewe
Copy link

mgrewe commented Aug 30, 2022

Hi Devs,

we are currently developing an online experiment that combines interactive content from Unity with experiments created by PsychoJS. We are using multiple small PsychoJS experiments for the different parts of the whole experiment, e.g., welcome screen, demographics, questionnaires to collect dependent measures, etc., which should be placed before and after the interactive unity experience. We are still struggling with skipping of the initial dialog where participants have to give their ID for the later PsychoJS parts.

If we just skip scheduling the Dialog, i.e., remove psychoJS.schedule(psychoJS.gui.DlgFromDict(....)); and just directly schedule the flowScheduler with psychoJS.schedule(flowScheduler);, then we get the error

DOMException: Failed to execute 'getImageData' on 'OffscreenCanvasRenderingContext2D': The source width is 0.
    at TextMetrics2.measureFont (http://localhost:8081/psychojs/lib/psychojs-2022.2.3.js:407:2310)
    at TextMetrics2.measureText (http://localhost:8081/psychojs/lib/psychojs-2022.2.3.js:406:65428)
    at TextStim.getTextMetrics (http://localhost:8081/psychojs/lib/psychojs-2022.2.3.js:1303:59536)
    at TextStim._estimateBoundingBox (http://localhost:8081/psychojs/lib/psychojs-2022.2.3.js:1303:61610)
    at new TextStim (http://localhost:8081/psychojs/lib/psychojs-2022.2.3.js:1303:59328)
    at Scheduler.experimentInit [as _currentTask] (http://localhost:8081/psychojs/test.js:143:13)
    at Scheduler._runNextTasks (http://localhost:8081/psychojs/lib/psychojs-2022.2.3.js:1049:33108)
    at async Scheduler._runNextTasks (http://localhost:8081/psychojs/lib/psychojs-2022.2.3.js:1049:33150)
    at async update (http://localhost:8081/psychojs/lib/psychojs-2022.2.3.js:1049:32204)

This is independent of the PsychoJS version (we tried several versions from 2022.1.1 onward). Do you see any chance to change the way the size of the VisualStim is estimated during experiment initialization? That would be awesome. I'm also willing to prepare a pull request but currently stuck with the internal logic of PsychoJS.

Thanks a lot
Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant