Wilbert's website at SocSci

> Javascript> Tutorial

stimuli/tutorial.html 2015-01-27

HTML 5 experiment using the staircase handler

Your experiment will consist of a stimulus shown several times while many stimulus parameters are constant, some may be random and precisely one is variable. The free variable is determined by the settings of the stair handler and the responses given by the participant. Data is saved to the server for later retrieval.


First choose a stimulus. You can choose one from the "stimuli" menu in the left menu bar or ask me to make a new one for you.

Finetune your stimulus choosing the precise parameter settings. Press stimulate to test your stimulus. You can go back to the parameter form with the browser back button or if you are in full screen mode, with alt-←. You need not go back to the form each time you change a parameter. You can also change them in the browser address bar.

Staircase handler

Copy all the parameters of your stimulus in the browser address bar. This is everything after '?'. make sure you select the whole line, also the part that is not visible on the right. The go to the staircase handler. Paste alle parameters in the additional stimulus parameters field

Decide what parameter will not be constant. Remove it from additional stimulus parameters (including the trailing or preceding '&') and determine its start value, step size, stop criteria, etcetera. Note that the step field takes either a number or a list of numbers seperated by semicolons (;).

The data handler parameters (u-number, experiment, participant) do not influence your experiment, but are essential for data retrieval and analysis. Change the experiment number for different constant parameters. It is your own responsibility to remember the constant parameters.

Experiment execution

Click start to start the experiment. After each response your will see a new stimulus. Copy the entire address in the address bar and paste it in an invitation e-mail that you send to a single participant. Make sure to change the participant number if different emails. You can also use this address as the goodbye page in Limesurvey to string the experiment to a survey.

Data retrieval

All data is saved on the server. Go to the data retrieval page to get your data. Make sure to logon with the same u-number used in the data handler parameters of the staircase. You can select data based on several parameters. Retrieve the raw data or plot it directly. The following image shows a 1-up/1-down staircase with a stepsize of 0.2 with the response sequence: true, false, true, false, false, false, true, true, true, false. Click here to participate yourself.


Stringing with Limesurvey

If you want a participant to answer a few survey question prior to the experiment you can make a survey in LimeSurvey and set the End URL of LimeSurvey to take him to the staircase handler. Make sure to include the text participant={TOKEN} in the End URL. That way you can later combine the data. Explanation on using the LimeSurvey End URL can be found here and here. Make sure the token exists and is a decimal number not more than 32 bits (9 decimal digits) long. Your token csv-file could look like this:

firstname, lastname, email, token
Wilbert, van Ham, W.vanHam@socsci.ru.nl, 101
Wilbert, van Ham, W.vanHam@socsci.ru.nl, 102
Wilbert, van Ham, W.vanHam@socsci.ru.nl, 103
Wilbert, van Ham, W.vanHam@socsci.ru.nl, 104

Giving you a token list like this:

Note that the end URL that you want to use may be very long. Limesurvey only allows end-urls of up to 255 characters. Use a URL shortening service, such as para.ms or this one to shorten your experiment URL.

Rather than tokens from LimeSurvey you can also use passthrough arguments that were created by the system invoking LimeSurvey. You can even use answer fields and expressions to make the stimulus dependent on the answers in the survey. The possibilities for LimeSurvey guru's are endless.