Randomizing variables.

Back to Contents

First, make sure you have:

(as of June 2020)

You will learn:

  1. How to randomize trials
  2. How to randomize check box options

For these code heavy tutorials, it is recommended to full screen the video and watch at 720p


The changed files for this step can be found here.

  1. Most of this tutorial is writing the objects in charge of trial order. You can just download the code, and skip to the experiment specific parts in the video
    • Adding trials to the TrialOrder object constructor (also increase the size of the order array to match your trial array)
    • Adding the TrialOrder object to v.html
    • Changing button code to go to trials in the proper order
    • Reworking v.html to have areas for the trial order object to add text
  2. The trial order object goes to the comment page when the last trial finishes. If you want to show every trial's end page, you can go to the last page at the beginning of the startNext() function instead of end.
  3. If you have trial specific code you wish to run at the start/end of a trial, functions can be added just like the debug method, and called from the start/end functions in the Trial object.
  4. If you waited till now to check your duplicated trial pages, you can use:
    trialOrder.rearrange([ whatever trial index you want first , next , next , etc ]);
    at the bottom of v.html to go to a specific trial with the debug button.

Proceed to learn how to collect data from your remote clients.