Does the function psychoJS.gui.Dlg exist?

Beforehand I might add that I am fairly experienced in programming Python, but I am completely new to JavaScript, so please be specific. Thanks :slight_smile:

Description of the problem:

I have created an experiment using the PsychoPy builder. There, I wanted a more sophisticated dialog than the “basic” ones that are created with the gui.DlgFromDict()-function. So, in the experiment settings, I set the “Show Info dialog” to false. Then, I created a code component and coded in Python in the Before Experiment-section something as in the following:

myDlg1 = gui.Dlg(title="Info")
myDlg1.addText('Some text here.\n')
myDlg1.addText('Some more text')
myDlg1.addField('A question with choices', choices=['A','B','C','others'])
myDlg1.addText('Please give your date of birth')
myDlg1.addField('Day', choices=[*range(1,32)])
myDlg1.addField('Month', choices=[*range(1,13)])
myDlg1.addField('Year', choices=[*range(1920,2020)])
ok_data = myDlg1.show()  # show dialog and wait for OK or Cancel
    
if myDlg1.OK: # declare variables and maybe ask further questions
    
    Subject = {'Info1':ok_data[0],
           'Birth':str(ok_data[1])+'.'+str(ok_data[2])+'.'+str(ok_data[3])}
    
    # if Info1 is not given explicitly, ask further questions
    InfoForSpecification = 'others'
    if Subject['Info1'] == InfoForSpecification:
        myDlg1_1 = gui.Dlg(title="further Info")
        myDlg1_1.addText('Please be more specific:')
        myDlg1_1.addField('')
        ok_data_specific = myDlg1_1.show()  # show dialog and wait for OK or Cancel
        if myDlg1_1.OK: # declare variables
            Subject['Info1'] = InfoForSpecification + ': ' + ok_data_specific[0]
        else:
            core.quit()  # the user hit cancel so exit
else:
    core.quit()  # the user hit cancel so exit

All together there are up to 4 dialog boxes that the user must click through before the actual experiment starts, but you get the idea from this section. It all works perfectly offline. Now I wanted to upload the project and pilot it on pavlovia. There, I always get one of the following errors:

TypeError: psychoJS.gui.Dlg is not a constructor
or
TypeError: psychoJS.gui.Dlg is not a function
when I tried something as in the following:

myDlg = new psychoJS.gui.Dlg({"title": "Basic Params for Image Localiztion"});

So, my actual question is: Does the function psychoJS.gui.Dlg() exist and how can I call it? Or do I have to settle with the slightly limited possibilities of psychoJS.gui.DlgFromDict()?

I’m not sure this is possible online? Have a look at my demographics online demo for how to embed an html web form.

Hello, for the demographics part of my study at first I tried with forms but it gave errors. (Issue with forms) Then I tried textbox component but its stuck on initialising. Now I found your demographics demo (VESPR / Demographics · GitLab) and I am trying to modify it to my own task. I want to ask participants questions like " what is your native language" " enter your year of birth" “what is the primary language you use at home” " if you have lived outside of the US please specify the years cities and countries where you lived"For these questions I dont know how I will adjust options. Because I see some questions have options categorized like yes no or genders or ages. But these are open ended for the spreadsheet under options column, how can I enter the options? Thank you very much.