If you have routines or experiments that are likely to be useful to others, please create a post in this thread, editing your post to add new demos so there is one post per creator. Ideally set your demos so they can be tested without consuming a credit (if you don’t have a site license) by adding a final routine that can’t end, disabling save incomplete results and adding a small number of credits.
Please do not discuss the demos in this thread or create more than one post unless you have a large number of demos to share, in which case please use separate posts for separate categories.
Based on Russell, Weiss, and Mendelsohn (1989) but with an even number of scale points. Russell, J. A., Weiss, A., & Mendelsohn, G. A. (1989). Affect grid: A single-item scale of pleasure and arousal. Journal of Personality and Social Psychology, 57, 493–502. The grid is created in code using an array of ShapeStim polygons.
Brookes Template 2020 code | try it | discussion thread
Demonstrations of code_JS, embedding html forms and external videos, and using code components for free text responses.
Demographics code | try it | discussion thread
An embedded html demographics form (online only) using iFrame code shared by @arnon_weinberg. The responses are saved to the data file as expInfo variables, which means that they will appear on every line of the data if the form is placed before the experiment. Use my Form to HTML for Pavlovia web app to convert PsychoPy form csv files to html pages.
Random digits are presented at a rate of one per second. The first digit cannot be 0 Following digits can be 0 but cannot be the same as the previous digit. If the answer is correct the span is increased for the next trial If the answer is wrong the span is decreased for the next trial. If there are at least two errors at a given span and that represents more than half of the total attempts at that span then the experiment ends, returning a span of one less than the final span attempted.
Free Recall code | try it | discussion thread
Free text response for up to 20 words/phrases with arrow key and mouse interactions both between and within words. The correct answers for the demo are the numbers one to twenty.
Pre-load one column from a spreadsheet so that the contents can be displayed in an independent random order alongside the contents of another column. This demo also uses shuffle to randomise the location of the target.
Interactive Slider code | try it | discussion thread
This shows a PsychoPy slider object which can be moved using the left and right arrow keys or hovering over the slider with the mouse. Responses are submitted with a mouse click or the return key. The position of the slider is also recorded every 3 frames and presented on the screen in addition to being saved to the console and the data file. The code for using the keyboard may be useful for anyone wanting to detect whether particular keys are currently pressed or not. A custom slider is also included which looks and behaves the same as the standard slider offline and still works online. The custom slider can cope with changes in the numbers of tick points and labels, wrapping the label text accordingly to avoid overlaps.
Moving Cue code | try it | discussion thread
Moves a pulsating circle around the screen like an eye tracker calibration cue. Paths are read from an Excel file but implemented using a TrialHandler in code (which requires a number of edits to work online).
Music Box code | try it | discussion thread
Plays music (Greensleeves) from a spreadsheet containing three columns: Note, Duration and Octave. The quality isn’t great and it sometimes warbles towards the end so suggestions for improvements are welcome.
Music Player code | try it | discussion thread
An interactive version of Music Box which uses the same Greensleeves spreadsheet. Press the letter of the displayed note and it will be played at the start of the next routine with the specified duration, sharp and octave. Press space if you see “_”.
PM Time code | try it | discussion thread
I have been writing prospective memory experiments for students for over 20 years. This one features both event-based and time-based tasks with a clock that appears when the space bar is pressed to allow the participant to check the time. This experiment features my interleaved lists method as detailed in my code snippets page.
Three quick reaction time tests (simple keyboard, choice keyboard and simple mouse). Mean RTs are calculated for each type.
ScreenScale code | try it | discussion thread
Use to ask a participant to work out their screen scale relative to a credit card.
Self-Paced Reading code | try it | discussion thread
Based on code from my code snippets Google page and using sentences from @Zeinab_Alipour, this demo includes reading times for each word and an editable text box comprehension question. Variants include incremental phrase, central word, moving window and moving word.
Scroll Text code | try it | discussion thread
Scroll a text box up and down using arrow keys, mouse on a scroll bar or dragging and dropping the text itself. The code automatically estimates the total length of the text so the scroll bar is updated when the text is moved by other means. Press spacebar to continue appears once the text has been scrolled to the bottom. I use a new jitter method to update otherwise static components to keep them in front of the scrolling text.
Testing some options including PsychoPolyFill