Project Planets is a sophisticated JavaScript-based web application designed for conducting research on decision-making, risk assessment, and learning patterns. It presents an interactive space-themed environment where participants engage with different planets to earn rewards while managing the risk of pirate attacks.
Built using the jsPsych framework and deployed with Docker, the application provides a fully configurable platform for psychological research with detailed data collection capabilities. The experiment guides participants through multiple phases with varying reward-punishment contingencies, systematically revealing how people adapt their behavior based on experience.
This project showcases my abilities in both frontend development and research technology, combining clean, maintainable code with scientifically rigorous experimental design.
Developing a behavioral experiment platform presented several unique challenges:
My approach combined software engineering best practices with an understanding of behavioral research requirements:
// Example from the custom planet-response-command.js plugin
let planet_ship = {
type: "planet-response-command",
show_ship: true,
prompt: planet_labels,
stimulus: planet_list,
stimulus_select: stim_selector_highlight,
ship_stimulus: ship_list,
reset_planet_wait: reset_planet_wait_const,
shield_charging_time: shield_charging_time_const,
ship_attack_time: ship_attack_time_const,
ship_attack_effect: get_indexed_constant_array('ship_attack_effect'),
show_whether_shield_blocked_attack_or_bonus:
show_whether_shield_blocked_attack_or_bonus,
block_duration: block_duration,
probability_trade: get_indexed_constant_array('probability_trade'),
probability_ship: get_indexed_constant_array('probability_ship'),
probability_shield: get_indexed_constant_array('probability_shield'),
trade_outcomes: get_indexed_constant_array('trade_outcome_set'),
ship_outcomes: get_indexed_constant_array('ship_emergence_set'),
shield_outcomes: get_indexed_constant_array('shield_available_set'),
attack_images: get_indexed_constant_array('attack_img'),
image_paths_to_preload: get_indexed_constant_array('attack_img_path'),
attack_text_colours: get_indexed_constant_array('attack_text_colour'),
attack_blocked_images: get_indexed_constant_array('attack_blocked_img'),
win_100_text: win_100_text,
data: {
phase: "phase2",
block_type: "planet_ship",
},
on_start: function(trial) {
trial.data.points = points;
trial.data.block_number = block_number;
trial.data.trial_number = trial_number;
},
on_finish: function(data) {
points = data.points_total;
trial_number = data.trial_number;
trial_number++;
// script for continuous response block
if (continuousResp) {
jsPsych.endCurrentTimeline();
block_number = data.block_number;
block_number++;
console.log("Block " + block_number);
} else {
if (trial_number >= nTrialspBlk) {
trial_number = 0;
block_number = data.block_number;
block_number++;
console.log("Block " + block_number);
}
}
},
};
version: "3.8"
name: researchproject
services:
proxy:
image: jc21/nginx-proxy-manager:2.10.4
restart: unless-stopped
ports:
- 80:80
- 443:443
- 81:81
depends_on:
jatos:
condition: service_healthy
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsecrypt
jatos:
image: jatos/jatos:3.9.3
restart: unless-stopped
ports:
- 9000:9000
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/ping"]
interval: 2s
timeout: 2s
retries: 1000
start_period: 10s
volumes:
- ./jatos-logs:/opt/jatos/logs
- ./jatos-data:/opt/jatos_data
- ./jatos.conf:/opt/jatos/conf/jatos.conf:ro
filebrowser:
image: filebrowser/filebrowser:v2.31.1
restart: unless-stopped
ports:
- 8080:8080
depends_on:
jatos:
condition: service_healthy
volumes:
- ./jatos-data/study_assets_root:/srv
- ./filebrowser/database.db:/database.db
- ./filebrowser/.filebrowser.json:/.filebrowser.json
environment:
- PUID=1000
- GUID=1000
The Project Planets experiment follows a structured flow designed to measure how people learn from experience and adjust their behavior:
Project Planets has been used to study how people learn from experience and make decisions under risk. The platform has enabled researchers to systematically investigate: