Here is an index of the posts in my daily tips thread, grouped into topics. I will edit this post as I add the tips.
Fundamentals
- Builder isn’t Coder
- Experiment Settings
- Filtering components
- Pilot mode
- PsychoPy Primer
- Should I install the modern (py3.10) or compatibility+ (py 3.8) version?
- Spreadsheets
- Test the installation
Builder
- Check (or uncheck) isTrials
- Code components go at the top
- Code components still run if routine is skipped
- Create your own Routine Templates
- Delaying the end of a routine
- Don’t use polygon borders above 20
- Find in experiment
- How to use the colour picker
- Interruption tasks
- Know your quotes
- Presenting to multiple screens
- PsychoPy files are saved in plain text
- Random functions
- Reuse your routines
- Reuse your visual objects
- Saving screenshots
- Showing different trials to a returning participant
- Show your file extensions
- Try out PsychoPy 2025.1.0
- Use a stable version
- Use keyboard components instead of event.getKeys()
- Use Routine Settings
- Use the textbox component
Online
- Allowing others to pilot your experiment
- Check your experiment name
- Compare elements not lists
- Copying an existing project
- Custom function: defined
- Custom function: remove
- Daisy chaining
- Define functions to reduce manual editing of JavaScript code
- Developer Tools
- Disable right-click context menu
- Don’t delete your repository
- Downloading resources on the fly
- Exit cleanly
- How to use the Pavlovia Shelf
- “initialising…” isn’t an error message
- Know the difference between PsychoJS and jsPsych
- Mirror images
- Output path should be blank
- Pavlovia usernames should contain letters
- Preloading stimuli in code
- Reverting to an earlier version
- Run the latest version of your experiment
- Saving incomplete results
- Set initial values if you update Each Frame
- Setting colours in code
- Sound components should start after the routine has started
- Skipping dialogue boxes online
- Splitting textbox.text online
- Submitting slider responses
- The answer is (almost) never to edit the generated code
- Use Auto → JS code components wherever possible
- Use Embedded Surveys in online experiments
- Use foreslashes not backslashes in file paths
- Use height units
- Use HTTPS to connect to GitLab not SSH
- Use relative paths
- Using .pop() online
Variables and spreadsheets
- Avoid multiple spreadsheets
- Check for blank rows in your spreadsheets
- Coding is case sensitive
- Data variable order
- Define your variables
- Don’t modify spreadsheet variables
- Extending lists
- Loops without a conditions spreadsheet
- Naming conventions
- Sentence case
- Spreadsheets can be semicolon or tab delimited
- Use Print statements
PsychoPy error messages
Pavlovia error messages
- IndexSizeError: Failed to execute ‘getImageData’ on ‘OffscreenCanvasRenderingContext2D’: The source width is 0.
- RangeError: Maximum call stack size exceeded
- ReferenceError: currentLoop is not defined
- ReferenceError: varName is not defined
- resources should be either (a) a string or (b) an array of string or objects
- TypeError: Cannot read properties of undefined (reading ‘x’)
- TypeError: Cannot read property ‘x’ of undefined
- TypeError: x is not a constructor
- unable to convert undefined to a number
- Uncaught SyntaxError: Illegal return statement
Pavlovia Surveys
- Dynamic Survey Completion URLs
- Editing JSON code directly
- Embedded surveys failing to download in 2025.1.0
- Embedding media in a Pavlovia Survey
- Save your survey
- Sharing surveys
- Single-select matrix requirements
- Survey pages with descriptions must have questions
- Survey versions
Python Scripts
Study Design
Forum
- Consultancy as support
- Formatting code in forum posts
- Post Python code whenever possible
- Use the error message as the title of your forum post
- Use the topic template