Task dossier

Cambridge Gambling Task

T000029T000029-cambridge-gamblingSmoke testedWeb preview availableUpdated Jun 20, 2026

Explicit-risk decision task with red/blue probability judgment and proportional betting.

Cambridge Gambling Task flow diagram
Cambridge Gambling Task flow diagram
Preview path
This task ships with a matched HTML companion so the browser preview can stay aligned to the canonical local repository.
Quick start
Clone locally, then follow the README for install and run instructions.
git clone https://github.com/TaskBeacon/T000029-cambridge-gambling.git
cd T000029-cambridge-gambling
# Follow the README for local setup and run steps

Cambridge Gambling Task

Maturity: smoke_tested

FieldValue
NameCambridge Gambling Task
Versionv0.2.2-dev
URL / Repositoryhttps://github.com/TaskBeacon/T000029-cambridge-gambling
Short DescriptionExplicit-risk decision task with red/blue probability judgment and proportional betting.
Created ByTaskBeacon
Date Updated2026-03-19
PsyFlow Version0.1.9
PsychoPy Version2025.1.1
ModalityBehavior
LanguageChinese
Voice Namezh-CN-YunyangNeural (voice disabled by default)

1. Task Overview

This implementation follows the Cambridge Gambling Task (CGT) structure: participants view explicit red/blue box ratios (10 boxes total), choose the color most likely to hide a token, then choose a betting percentage of current points.

Unlike MID-style templates, this task has no cue-target reaction stage. The core logic is probability judgment + bet selection + point outcome update.

2. Task Flow

Task Flow

Block-Level Flow

StepDescription
1. Block contextController sets block-level bet order (ascending or descending) and tracks points.
2. Trial executionEach trial samples a box ratio, majority color side, and token outcome probability.
3. Block summaryReports score, quality-of-decision, win rate, mean bet, RTs, timeout counts, delay-aversion proxy.
4. Task summaryFinal metrics shown with ascending vs descending bet comparison.

Trial-Level Flow

StepDescription
FixationShort jittered fixation (+) from timing.fixation_duration.
Color choiceShow 10 red/blue boxes + ratio text; participant chooses F=红 or J=蓝.
Bet choiceShow five bet options (5/25/50/75/95) ordered by block context; participant selects with 1-5.
FeedbackReveal token color, applied stake, point delta, and updated score.
ITIShort jittered fixation before next trial from timing.iti_duration.

Controller Logic

ComponentDescription
Ratio samplerSamples one pair from [[9,1],[8,2],[7,3],[6,4]] each trial.
Outcome samplerToken color sampled by visible probability (P(red)=red_boxes/10).
Bet orderascending block uses [5,25,50,75,95]; descending reverses this order.
Score updatebet_amount = round(points_before * bet_percent / 100); win adds, loss subtracts.
Timeout policyColor timeout -> no bet and no score change; bet timeout -> auto-select last displayed percentage.

Runtime Context Phases

Phase LabelMeaning
fixationInter-stage fixation.
color_choiceExplicit probability judgment stage.
bet_choicePercentage betting stage.
feedbackOutcome/score update display.
itiInter-trial interval fixation.

3. Configuration Summary

a. Subject Info

FieldMeaning
subject_id3-digit participant identifier.

b. Window Settings

ParameterValue
size[1280, 720]
unitspix
screen0
bg_colorblack
fullscreenfalse
monitor_width_cm35.5
monitor_distance_cm60

c. Stimuli

NameTypeDescription
trial_prompt, score_text, ratio_text, color_key_hinttextColor-choice stage envelope with explicit ratio and key mapping.
box_token_templaterectTen red/blue boxes generated per trial from sampled ratio and side assignment.
bet_prompt, bet_key_hinttextBet-choice instruction and key legend.
bet_option_templatetextFive on-screen bet options mapped to keys 1-5 in block-specific order.
feedback_outcome, feedback_auto_bet, feedback_color_timeouttextOutcome and timeout-specific feedback messages.
fixation, block_break, good_bye, instruction_texttextShared trial separators and task envelope screens.

d. Timing

PhaseDuration
fixationjittered (0.3-0.6 s human)
color choice3.0 s deadline
bet choice3.5 s deadline
feedback1.0 s
ITIjittered (0.3-0.6 s human)

e. Triggers

TriggerCodeDescription
choice_onset30Color-choice screen onset
choice_red / choice_blue31 / 32Color response events
color_timeout33No color response
bet_onset40Bet-choice screen onset
bet_key_1..541..45Bet key responses
bet_timeout46No bet response
feedback_onset50Outcome screen onset

4. Methods (for academic publication)

Participants completed an explicit-risk gambling paradigm in which probabilities were represented by visible red/blue box ratios (total = 10). On each trial, participants first selected the color judged most likely to hide a token, then selected a stake as a percentage of current points.

The task manipulated bet-order context (ascending vs descending) at block level and recorded key CGT outputs: majority-color choice quality, betting magnitude, outcome sensitivity, and response latency. Score updates were proportional to selected stake and outcome congruence.

All phases were instrumented with phase-level triggers and trial context metadata, enabling synchronized behavioral and acquisition-aligned analyses across human, QA, and simulation modes.