NOTE: My original experiment was created in PsychoPy 2020.1.3. I have since saved the file (and added the form component) in PsychoPy 2021.2.0. I have had no issues editing or running my experiment.
I’m attempting to integrate my demographics form at the beginning of my PsychoPy experiment, instead of having to run it separately in a browser. Creating the form has worked fine, but I’m running into 2 problems when I try to run the experiment (both explained and shown in the image below).
Problem 1: I can only select ‘choice’ options at either end of the options. I cannot select any choice in the middle; it selects the choice at the closest end. See image below where my mouse is and which choice option is selected. Questions with only 2 options (i.e., ‘yes’/‘no’ work fine; you can select either choice by clicking on it).
Problem 2: One of my questions has a lot of text for each choice option. The options are showing on top of each other and on top of the question text. Is there any way to change the formatting so this doesn’t happen (e.g., change spacing or make options vertical)?
Additionally, I receive this notice after I run my experiment:
20.0922 WARNING Form currently only formats correctly using height units. Please change the units in Experiment Settings to ‘height’
My experiment is set to ‘pix’ because that’s what I need for the rest of the experiment. When I run, the form shows up fine (I think), except for the problems noted above. When I changed the experiment units to ‘height’, the form crashed the experiment with a MemoryError. I’m not sure if this is an issue at all, as the form seems to run with no problems when my experiment is set to ‘pix’. Full error below for documentation purposes (note: the form is the first routine of my experiment and there is nothing that shows prior to the form opening):
Any help is appreciated!
- Elisabeth
Traceback (most recent call last):
File “C:\Users\Elisabeth\OneDrive\PhD\Research\Visual Search And Personality\Experiment 3a\MultipleTargets_lastrun.py”, line 187, in
depth=0.0);
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\text.py”, line 226, in init
self.setText(text, log=False)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\text.py”, line 374, in setText
setAttribute(self, ‘text’, text, log)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\tools\attributetools.py”, line 141, in setAttribute
setattr(self, attrib, value)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\tools\attributetools.py”, line 32, in set
newValue = self.func(obj, value)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\text.py”, line 365, in text
self._setTextShaders(text)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\text.py”, line 391, in _setTextShaders
multiline=True, width=self.wrapWidthPix) # width of the frame
File "C:\Program Files\PsychoPy\lib\site-packages\pyglet\text_init.py", line 462, in init
‘align’: align,
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\document.py”, line 604, in set_style
0, len(self.text), attributes)
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\document.py”, line 512, in set_style
self.dispatch_event(‘on_style_text’, start, end, attributes)
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\event.py”, line 418, in dispatch_event
if handler(*args):
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\layout.py”, line 1073, in on_style_text
self._init_document()
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\layout.py”, line 1043, in _init_document
self._update()
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\layout.py”, line 966, in _update
lines = self._get_lines()
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\layout.py”, line 942, in _get_lines
glyphs = self._get_glyphs()
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\layout.py”, line 1085, in get_glyphs
glyphs.extend(font.get_glyphs(text[start:end]))
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\font\base.py”, line 394, in get_glyphs
self.glyphs[c] = glyph_renderer.render(c)
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\font\win32.py”, line 471, in render
glyph = self.font.create_glyph(image)
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\font\base.py”, line 362, in create_glyph
self.texture_mag_filter)
File "C:\Program Files\PsychoPy\lib\site-packages\pyglet\image_init.py", line 1549, in create_for_size
blank = (GLubyte * (width * height * 4))()
MemoryError