A web-based risk survey experiment for behavioral research.
-
Install dependencies:
npm install
-
Set up environment:
- Create
.envfile with your MongoDB connection string:
MONGODB_URI=your_mongodb_connection_string - Create
-
Run the experiment:
node server.js
- Open http://localhost:3000 in your browser
Generate new trial configurations:
python generate_trials.pyThe experiment saves 15 fields per trial:
participant_id,trial_number,bar_size_conditionchoice(risk/safe/timeout),confidence(0-100 or NaN)risk_probability,risk_reward,safe_probability,safe_rewardrisk_position,safe_position,ev(same/safe/risky)bar_choice_time,confidence_choice_time,trial_id
server.js- Express server with MongoDB integrationpublic/js/experiment.js- Main experiment logicpublic/css/styles.css- Stylingpublic/config.json- Experiment configurationpublic/full_trials.csv- Trial datagenerate_trials.py- Trial generation script