0

I'm fairly new to Python and PsychoPy, and I'm quite dependable on this forum which is so helpful. So thank you!

But now I'm stuck: I couldn't find a way to display an interactive dialogue box after participant performs a block (loop) of trials to ask them to enter sentences of worlds or/and numbers that must be then saved for later analysis. This is the code I have so far after a loop:

Begin Experiment:

from psychopy import gui

Begin Routine:

# Present dialogue box
background = visual.Window(fullscr=False, color =[0,0,], size=[5000, 5000], allowGUI=False)  # optional: a temporary big window to hide the desktop/app to the participant
background.show()

myDlg = gui.Dlg(title="Yor description of the task")
myDlg.addField('Blue Deck: What percentage of times you get response A:')
myDlg.addField('                                    you get response B:')
myDlg.addField('Red Deck: What percentage of times you get response A:')
myDlg.addField('                                    you get response B:')
myDlg.show()

event.waitKeys() 

ok_data = myDlg.show()  # show dialog and wait for OK or Cancel
if myDlg.OK:  # or if ok_data is not None
    print(ok_data)
else:
    print('User cancelled')

I have found some bits of code in this thread Why does my dialogue box not show when fullscr=True?, but can't get my head around it to make work for me.

I would really appreciate any help. Thanks!

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
  • I suspect that it wouldn't work from Builder code components. The example from the link is for code-only experiments. – Jonas Lindeløv Feb 18 '17 at 20:52
  • 1
    You may get better and more timely advice over at the psychopy users forum: https://discourse.psychopy.org/ – Gavin Mar 01 '17 at 23:59

0 Answers0