Preface
- Audience
- Typographic Convention
- Acknowledgements
1Getting Started with NeuroTask Scripting
- 1.1What Are Scripts and Why Do We Need Them?
- 1.2Scripting Psychological Experiments
- Writing Scripts
- 1.3Scripts
- The Structure of an Experiment Script
- Your first script: A small experiment
- Walking through Script 1.1
- Script 1.2: A free recall experiment
- Script 1.3: A shorter script with a
forloop - White Space
- Variables
- Assigning Values to Variables
- Arrays
forloops- Parts of a
forloop: Head and Body - Increment
- Declaring Multiple Values at Once
- Script 1.4: Even shorter scripts with
getwords() - 1.4You have started with online experiments!
2Capturing Keys and Reaction Times
- 2.1Achieving Precise Timing with
await() - 2.2Handling Various Types of Events with
Await() - Click events
- 2.3
Await-ing Keyboard Events - A Simplified Script for a Lexical Decision Task
- Key presses
- I) Printable Keys
- II) Any Key
- III) Non-printable Keys
- Event Properties
- 2.4Measuring Reaction Time (with
now(),await(), andawaitkey()) - Reaction Time in Theory (Long-hand)
- Reaction Time in Practice (Short-hand)
- Reaction Times with Timeouts
- 2.5
if...thenstatements - Operators
- Order of Interpretation of Operators
- 2.6More Examples with Keyboard Events
- Shift-Alt-Ctrl
- 2.7A More Complete Script for a Lexical Decision Task
3Screen layout with “Box” and “Block”
- 3.1Maintaining Experimental Control in an Online Setting: Layout
- 3.2Two Standard Layout Choices in NeuroTask: Fill and Square
- The fill layout
- The square layout
- 3.3Cross-Browser Layout Issues
- Font size
- Zooming and Text-Sizing
- Font Type
- Centering Text and Images
- 3.4The Backbone of Layout in NeuroTask:
BoxandBlock - 3.5Box
- The Pre-set Box Called “main”
- “
main” is the Default for Many Box Functions - Customizing Boxes
- Box Color
- Box Borders, Backgrounds, and Fonts
- 3.6Block
- Adding Blocks
- Removing and Destroying Blocks
- Removing vs. Destroying
- Example Block Layouts
- Showing Text in Blocks
- Showing Images in Blocks
- 3.7Combining Box and Block: the
makebox()convenience function - 3.8Deleting All Contents of a Box
- 3.9Using Blocks as Stimuli
- Corsi Block Tapping Task
- Random Dot Stimuli
4Images
- 4.1Visual recognition task
concat(array1,array2)contains(array,element)log(variable,label)- 4.2Image linking and uploading
- Uploading images
- Linking images
- Uploading versus linking images
- 4.3Where your images are stored
- 4.4Preloading images
- The
preload()function - Preloading is Block-specific
- 4.5Resizing images
5Style
- 5.1Style with
style() - Chaining of block function calls
- 5.2Setting font size of an entire Box
- 5.3Queries with tag name,
classandid - Styling the background behind boxes
- 5.4Color
- Named colors
- RGB and Hex
- Opacity and transparency
- 5.5Fonts and text styles
- Font family
- Font size and other text style properties
- Font weight: bold and bolder
- Font style: italic
- Text decoration: underline and line-through
- Font size and line-height
- Text align: left, right, or justify
- Top, left, width, height, and getshape()
- 5.6Borders
- 5.7Padding
- 5.8Preset functions versus block functions
6Survey questions with form controls
- 6.1Instruction
- 6.2Button
- 6.3Input
- 6.4Using response values in scripts
- Return values
- The response object
- Feedback with
- 6.5Largeinput
- 6.6Select, radio, and scale
select()radio()scale()- 6.7Check
- 6.8Sleep questionnaire example
- 6.9Combining controls with startform() and endform()
- 6.10Validation
7Data logging and handling
- 7.1Data logging with
log() - 7.2Data that is always logged in ‘activated’ scripts
- 7.3Data tables in your account
- What a ‘session’ is
- 7.4Data storage and retrieval
- Storing ‘behind the scenes’ or storing now
- Storing at the ‘script’ and ‘author’ level
increase()anddecrease()- 7.5Working with the data tables
- Filtering data
- 7.6Exporting data
- Pivot tables, or how to make your tables ‘square’ again
- 7.7Logging, storing, and the ‘response’ object
- 7.8Deleting data
- 7.9Data Dashboard
8Animation and drag-and-drop
- 8.1Animation
- Feedback with
blink() - Blinking other properties with
toggle() - Using the
animate()function - A general approach to animation with
RAF() - Using icons with the
icon()function - An animation loop
- 8.2Drag-and-drop
- Drag-and-drop basics
- Dragging a block inside (on top of) another
- Drag-and-drop with multiple drop targets
- 8.3Putting everything together: A simple game
9Sound
- 9.1Preloading sounds
- 9.2Advanced options
10Working with video
- 10.1Subtitles and chapters
- 10.2Advanced options
- 10.3Supported video options
- 10.4Getting the video player
- 10.5Showing the same video simultaneously in two blocks
11Graphics
12Pivot Tables
13Synchronous and asynchronous programming
- 13.1Asynchronous programming (is still possible in NeuroTask Scripting!)
- 13.2The
waitfor .. orconstruction
Appendix
- Background Code
- Example Scripts
- Corsi Block Tapping Task
- Random Dot Pattern Recognition