Author: Wenyan Bi
Online Psychophysics Experiment: Asymmetric Matching
This folder contains the codes for the online asymmetric matching experiment, which are used in our paper Effect of Geometric Sharpness on Translucent Material Perception.
- Experimental Procedure: Subjects change the material properties of the match image (right) until it matches the target image (left) by sliding the slider bar with the mouse or pressing the left/right arrow keys. During any time of the experiment, subjects can click the "Show Instruction" button to read the instruction.
Saving data: The default subject name is "test". By default, the data are saved as .json files in the folder "results/[subject name]".
If you want to save the data to MySQL dataset:
In "js/main.js": use
//var dataSaveFile = 'modulus/@WriteDataJSON.php'; var dataSaveFile = 'modulus/@WriteDataSQL.php';
In "modulus/Database_config.php", set your SQL configuration:
$servername = "localhost"; //$port=3306; $username = "root"; $password = "mysql"; $dbname = "myResults"; // [wb]: Database name $table = "Trans_matching_data"; // [wb]: Table name
To export data from the dataset. In terminal:
SELECT * FROM [TableName: e.g., Trans_matching_data] INTO OUTFILE [Absolute path: e.g., '/Users/Fiona/tmp.txt'] FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n';
- conditions: The condition files for each subject. Will be automatically generated for the new subjects.
- conditions: Main style sheet.
- img: Images that be used in HTML.
- modulus: Php codes.
- results: Stores the saved .json data files (when
var dataSaveFile = 'modulus/@WriteDataJSON.php').
- stimuli: Image stimuli that are used in the experiment.
Using Localhost: The codes can be run locally using Ampps. After downloading the software, open terminal to setup AMPPS localhost:
# MacOS configuration: ln -s [Path/To/Online_AsymmetricMatchingExperiment/Folder] /Applications/AMPPS/www
If you have any questions, please contact "email@example.com".