I wrote a JavaScript template to perform experiments which involve dissimilarity ratings of multiple stimuli.
The code is modularized and allows easy customisation and integration in existing (Amazon MTurk) experiments.
Participant Data is recorded throughout the session and stored as JSON file on the server (requires PHP).
On each trial, a set of stimuli are displayed in a circle on a two-dimensional canvas.
The participants are instructed to drag and drop the items on this surface, until the pairwise distances between all items reflects the subjectively perceived (dis)similarity. It's not possible to move the items out of the circular area. Once the participant is satisfied with the arrangement he/she continues with the next trial via button press. The script ends automatically and stores the data on the server once the predefined number of trials has been reached.
All sample stimuli are taken from the CNBC Bank of Standarized Stimuli dataset
The minimal setup required to run this template is an apache2 server with PHP.
- from the main folder, run
chmod -R 777 data
- open a browser and open stimeval_page.html, which is located in the html subfolder
- click your way through the demo and be delighted that everything works straight out of the box.
Desktop and Touchscreen Devices are currently supported.
The demo was tested on Macs, Linux and Windows notebooks with safari /google chrome and on Ipads and Android Devices. No issues were detected.
Usually, the experimenter only needs to adapt the arena_parameters.js and arena_stimuli.js files and change the title and instruction text in the stimeval_page.html file.
This is the main function which sets up the canvas and populates the arena with stimuli
All experiment, stimulus and UI related parameters are defined here
the drag and drop mechanism is defined in this file. Based on raphaeljs
stimulus and trial related definitions are taking place in here
This file defines trial-to-trial transitions
The arena itself and buttons are defined in this file
defines data export
defines how the arena is populated with stimuli
Further customisations are possible via the files contained in the css and html folders.
log files are handled via the arena_expt.js and io.php script and stored as JSON files in data/final/
-04072017: added grid: user can now set params_vis.grid to display a coordinate system in the arena