Skip to content

BumbleBee0819/OnlinePsychophysicsExperiment_AsymmetricMatching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub issues License JavaScript PHP SQL Total visitor Visitors in today

Author: Wenyan Bi

since 2019-10-13

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.

Dependencies

The codes are written in HTML/CSS/Javascript/PHP/MySQL and have been tested with:

Usage

  1. 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.

  1. 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';
  2. Folder description:

    • 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.
    • js: Main Javascript.
    • 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.
  3. 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

Contact

If you have any questions, please contact "wb1918a@american.edu".

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published