Skip to content

Commit bf01f85

Browse files
committed
Add Game of Dice site data
1 parent 7e651b7 commit bf01f85

6 files changed

Lines changed: 655 additions & 1 deletion

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"schema_version": 1,
3+
"generated_at": "2026-04-03T13:05:44.2838962Z",
4+
"org": "TaskBeacon",
5+
"runner_repo": "psyflow-web",
6+
"runner_url": "https://taskbeacon.github.io/psyflow-web/",
7+
"tasks": [
8+
{
9+
"directory": "H000036-risk-perception-estimation",
10+
"id": "H000036",
11+
"slug": "risk-perception-estimation",
12+
"title": "Risk Perception Estimation Task",
13+
"acquisition": "behavior",
14+
"maturity": "prototype",
15+
"release_tag": "v0.1.0-dev",
16+
"short_description": "Browser preview of the Chinese health-risk judgment task with 3 scenario levels and 1-7 ratings",
17+
"repo_url": "https://github.com/TaskBeacon/H000036-risk-perception-estimation",
18+
"default_branch": "main",
19+
"download_url": "https://github.com/TaskBeacon/H000036-risk-perception-estimation/archive/refs/heads/main.zip",
20+
"run_url": "https://taskbeacon.github.io/psyflow-web/?task=H000036-risk-perception-estimation",
21+
"last_updated": "2026-04-03T12:02:17Z"
22+
},
23+
{
24+
"directory": "H000037-game-of-dice",
25+
"id": "H000037",
26+
"slug": "game-of-dice",
27+
"title": "Game of Dice Task",
28+
"acquisition": "behavior",
29+
"maturity": "prototype",
30+
"release_tag": "v0.1.0-dev",
31+
"short_description": "Browser preview of the Chinese explicit-risk dice gambling task with four known-probability options and cumulative capital feedback",
32+
"repo_url": "https://github.com/TaskBeacon/H000037-game-of-dice",
33+
"default_branch": "main",
34+
"download_url": "https://github.com/TaskBeacon/H000037-game-of-dice/archive/refs/heads/main.zip",
35+
"run_url": "https://taskbeacon.github.io/psyflow-web/?task=H000037-game-of-dice",
36+
"last_updated": "2026-04-03T13:05:44Z"
37+
}
38+
]
39+
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Risk Perception Estimation Task
2+
3+
| Field | Value |
4+
|---|---|
5+
| Name | Risk Perception Estimation Task |
6+
| Version | main (0.1.0-dev) |
7+
| URL / Repository | https://github.com/TaskBeacon/T000036-risk-perception-estimation |
8+
| Short Description | Chinese health-risk judgment task with 3 scenario levels and 1-7 ordinal ratings |
9+
| Created By | TaskBeacon build pipeline |
10+
| Date Updated | 2026-04-03 |
11+
| PsyFlow Version | local checkout |
12+
| PsychoPy Version | 2025.1.1 |
13+
| Modality | Behavior |
14+
| Language | Chinese |
15+
16+
## 1. Task Overview
17+
18+
Participants judge the perceived health risk of brief everyday scenarios. The task uses three scenario levels (`low_health_risk`, `medium_health_risk`, `high_health_risk`) and a discrete 1-7 response scale. There is no objective correctness score and no reward feedback.
19+
20+
The runtime is split into human, QA, and simulation modes. Participant-facing wording is stored in `config/*.yaml` so the same task logic can be audited and localized without editing trial code.
21+
22+
## 2. Task Flow
23+
24+
### Block-Level Flow
25+
26+
| Step | Description |
27+
|---|---|
28+
| Load Config | Load the mode-specific config and task settings. |
29+
| Collect Subject Info | Collect `subject_id` in human mode; inject deterministic IDs in QA/sim. |
30+
| Setup Runtime | Initialize triggers, window, keyboard, and stimulus bank. |
31+
| Show Instructions | Present the Chinese instruction screen, with optional instruction voice in human mode. |
32+
| Generate Conditions | Use built-in `BlockUnit.generate_conditions(...)` with the three risk labels. |
33+
| Run Trials | Execute the per-trial risk judgment flow for each condition. |
34+
| Show Block Break | Display block mean rating and mean RT. |
35+
| Save Data | Write trial-level CSV output and settings JSON. |
36+
| Finalize | Emit the end trigger, close the trigger runtime, and quit PsychoPy. |
37+
38+
### Trial-Level Flow
39+
40+
| Step | Description |
41+
|---|---|
42+
| Fixation | Show a central fixation cross. |
43+
| Scenario Preview | Show the condition-specific risk vignette without response options. |
44+
| Rating Response | Show the scenario again with the risk question and 1-7 scale; collect one keypress or timeout. |
45+
| ITI | Show the fixation cross again before the next trial. |
46+
47+
### Controller Logic
48+
49+
| Feature | Description |
50+
|---|---|
51+
| Condition Scheduling | Uses PsyFlow `BlockUnit.generate_conditions(...)` with the configured condition labels. |
52+
| Determinism | Block seeds come from `TaskSettings` so QA/sim runs are reproducible. |
53+
| Adaptive Control | None. This task does not adapt difficulty or reward. |
54+
55+
## 3. Configuration Summary
56+
57+
### a. Subject Info
58+
59+
| Field | Meaning |
60+
|---|---|
61+
| `subject_id` | Numeric participant ID in human mode; QA/sim inject deterministic placeholders. |
62+
63+
### b. Window Settings
64+
65+
| Parameter | Meaning |
66+
|---|---|
67+
| `window.size` | Window resolution in pixels. |
68+
| `window.units` | PsychoPy coordinate units. |
69+
| `window.bg_color` | Background color. |
70+
| `window.fullscreen` | Fullscreen toggle. |
71+
72+
### c. Stimuli
73+
74+
| Stimulus ID | Purpose |
75+
|---|---|
76+
| `instruction_text` | Chinese task instructions. |
77+
| `fixation` | Central fixation cross. |
78+
| `scenario_low` / `scenario_medium` / `scenario_high` | Condition-specific health-risk scenarios. |
79+
| `rating_prompt` | Risk question shown during the response window. |
80+
| `rating_scale` | 1-7 ordinal rating legend. |
81+
| `block_break` | Block summary with mean rating and mean RT. |
82+
| `good_bye` | Final summary screen. |
83+
84+
### d. Timing
85+
86+
| Parameter | Meaning |
87+
|---|---|
88+
| `timing.fixation_duration` | Duration of the fixation screen. |
89+
| `timing.scenario_preview_duration` | Duration of the scenario-only preview screen. |
90+
| `timing.response_window_duration` | Duration of the rating response window. |
91+
| `timing.iti_duration` | Inter-trial interval duration. |
92+
93+
### e. Triggers
94+
95+
| Parameter | Meaning |
96+
|---|---|
97+
| `exp_onset` / `exp_end` | Experiment start/end. |
98+
| `block_onset` / `block_end` | Block start/end. |
99+
| `fixation_onset` | Fixation screen onset. |
100+
| `scenario_preview_onset` | Scenario preview onset. |
101+
| `rating_response_onset` | Rating screen onset. |
102+
| `rating_response_key` | Rating keypress trigger. |
103+
| `rating_response_timeout` | Rating window timeout trigger. |
104+
| `iti_onset` | ITI onset. |
105+
106+
### f. Adaptive Controller
107+
108+
| Parameter | Meaning |
109+
|---|---|
110+
| `task.conditions` | Condition labels scheduled across blocks. |
111+
| `task.condition_weights` | Optional weights; `null` means even scheduling. |
112+
| `task.key_list` | Valid rating keys (`1`-`7`). |
113+
| `task.seed_mode` | Seed mode for reproducible block ordering. |
114+
115+
## 4. Methods (for academic publication)
116+
117+
Participants completed a computerized risk-perception judgment task implemented in PsychoPy/PsyFlow. Each trial presented a brief health-risk scenario, followed by a discrete 1-7 subjective risk rating. Trials were organized into three condition levels corresponding to low, medium, and high perceived risk. The task measured ordinal risk judgments and response latency, with no binary correctness or reward contingency. Trial stimuli, timings, and response mapping were config-defined to support reproducibility, auditability, and localization.
118+
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Game of Dice Task
2+
3+
| Field | Value |
4+
|---|---|
5+
| Name | Game of Dice Task |
6+
| Version | v0.1.0-dev |
7+
| URL / Repository | https://github.com/TaskBeacon/T000037-game-of-dice |
8+
| Short Description | Chinese explicit-risk dice gambling task with four known-probability options and cumulative capital feedback. |
9+
| Created By | TaskBeacon build pipeline |
10+
| Date Updated | 2026-04-03 |
11+
| PsyFlow Version | local checkout |
12+
| PsychoPy Version | 2025.1.1 |
13+
| Modality | Behavior |
14+
| Language | Chinese |
15+
| Voice Name | zh-CN-YunyangNeural |
16+
17+
![Task Flow](./task_flow.png)
18+
19+
## 1. Task Overview
20+
21+
Participants complete an explicit-risk dice betting task with four visible gamble options on each trial. Each option corresponds to betting on 1, 2, 3, or 4 die faces with fixed win/loss magnitudes and known probabilities. The task tracks cumulative capital starting at 1000 points, shows the sampled die result after each valid choice, and then displays win/loss feedback with the updated total. Human mode uses 18 trials in a single block, while QA and simulation configs use shorter 8-trial preview runs for fast validation.
22+
23+
## 2. Task Flow
24+
25+
### Block-Level Flow
26+
27+
| Step | Description |
28+
|---|---|
29+
| Load config | `main.py` loads `config/config.yaml` or the mode-specific QA/sim variant and prepares the task settings. |
30+
| Collect subject info | Human mode collects `subject_id`; QA uses a deterministic stand-in value and sim mode uses the runtime session participant id. |
31+
| Initialize runtime | Triggers, window, keyboard, stimulus bank, and optional instruction voice are initialized. |
32+
| Initialize capital | The running capital state starts at 1000 points and is stored on `settings`. |
33+
| Show instructions | The Chinese instruction screen is shown before the trial block begins. |
34+
| Generate conditions | `BlockUnit.generate_conditions(...)` repeats the single `gdt_standard` condition across the block. |
35+
| Run trials | `run_trial(...)` executes fixation, choice, outcome, feedback, and ITI phases for each trial. |
36+
| Save data | Trial rows are written to CSV and the settings snapshot is saved to JSON. |
37+
| Finalize | The end trigger is emitted, the goodbye screen is closed, and PsychoPy exits. |
38+
39+
### Trial-Level Flow
40+
41+
| Step | Description |
42+
|---|---|
43+
| Fixation | A central fixation cross is shown briefly. |
44+
| Choice screen | The current total, prompt, and four risk cards are shown; the participant presses `1`-`4`. |
45+
| Outcome reveal | If a valid response was made, the sampled die roll and selected option are shown. |
46+
| Feedback | If a valid response was made, the win/loss message and updated capital are shown. |
47+
| Timeout branch | If the response window expires, the trial logs `timeout=true`, skips outcome/feedback, and keeps capital unchanged. |
48+
| ITI | A short fixation interval separates trials. |
49+
50+
### Controller Logic
51+
52+
| Feature | Description |
53+
|---|---|
54+
| Condition scheduling | A single repeated `gdt_standard` label is scheduled by PsyFlow block generation. |
55+
| Capital tracking | `settings.current_capital` and `settings.total_score` are updated after each valid outcome. |
56+
| Response contract | Keys `1`-`4` select the four gamble options; the same keys are used in QA/sim. |
57+
| Adaptive control | None. This is a static explicit-risk task, not a staircase or reversal task. |
58+
59+
### Other Logic
60+
61+
| Feature | Description |
62+
|---|---|
63+
| Deterministic roll | `trial_seed(...)` combines the block seed, block index, trial id, and choice key to produce a reproducible six-sided roll. |
64+
| Outcome evaluation | `compute_choice_outcome(...)` maps the selected option to win/loss magnitude, reward sign, and capital update. |
65+
| Advantageous choice flag | Options with 3 or 4 die faces are marked as advantageous/safe choices for summary reporting. |
66+
| Trial summary | `summarize_gdt_trials(...)` computes win rate, advantageous-choice rate, timeout count, RT, and final capital. |
67+
68+
## 3. Configuration Summary
69+
70+
Settings are defined in `config/config.yaml` and mode-specific variants for QA and simulation.
71+
72+
### a. Subject Info
73+
74+
| Field | Meaning |
75+
|---|---|
76+
| `subject_id` | Numeric participant identifier collected in human mode and injected deterministically in QA/sim modes. |
77+
78+
### b. Window Settings
79+
80+
| Parameter | Value |
81+
|---|---|
82+
| `window.size` | `[1280, 720]` |
83+
| `window.units` | `pix` |
84+
| `window.screen` | `0` |
85+
| `window.bg_color` | `black` |
86+
| `window.fullscreen` | `false` |
87+
| `window.monitor_width_cm` | `35.5` |
88+
| `window.monitor_distance_cm` | `60` |
89+
90+
### c. Stimuli
91+
92+
| Name | Type | Description |
93+
|---|---|---|
94+
| `instruction_text` | text | Chinese instructions describing the four dice betting options and the 1000-point starting capital. |
95+
| `fixation` | text | Central fixation cross shown before choice and during ITI. |
96+
| `capital_banner` | text | Current total capital shown at the top of the choice screen. |
97+
| `choice_prompt` | text | Prompt asking the participant to choose one of the four options. |
98+
| `option_1` / `option_2` / `option_3` / `option_4` | text | Four explicit-risk gamble cards with 1/6, 2/6, 3/6, and 4/6 probabilities. |
99+
| `outcome_text` | text | Die roll reveal and selected option label. |
100+
| `feedback_win` | text | Win feedback with the point gain and updated capital. |
101+
| `feedback_loss` | text | Loss feedback with the point loss and updated capital. |
102+
| `end_summary` | text | Final total capital shown at task completion. |
103+
104+
### d. Timing
105+
106+
| Phase | Duration |
107+
|---|---|
108+
| `timing.fixation_duration` | `0.5 s` |
109+
| `timing.choice_duration` | `10.0 s` in human mode, `8.0 s` in QA/sim configs |
110+
| `timing.outcome_duration` | `0.9 s` |
111+
| `timing.feedback_duration` | `1.0 s` |
112+
| `timing.iti_duration` | `0.8 s` |
113+
114+
### e. Triggers
115+
116+
| Event | Code |
117+
|---|---|
118+
| `exp_onset` | `1` |
119+
| `exp_end` | `2` |
120+
| `block_onset` | `10` |
121+
| `block_end` | `11` |
122+
| `fixation_onset` | `20` |
123+
| `choice_onset` | `30` |
124+
| `choice_response_key` | `31` |
125+
| `choice_timeout` | `32` |
126+
| `outcome_onset` | `40` |
127+
| `feedback_onset` | `50` |
128+
| `iti_onset` | `60` |
129+
130+
### f. Adaptive Controller
131+
132+
| Parameter | Value |
133+
|---|---|
134+
| `task.conditions` | `gdt_standard` repeated across the block |
135+
| `task.condition_weights` | `null` |
136+
| `task.key_list` | `[1, 2, 3, 4]` |
137+
| `task.seed_mode` | `same_across_sub` |
138+
| `task.roll_seed_mode` | `same_across_sub` |
139+
| `task.initial_capital` | `1000` |
140+
| `Adaptive controller` | None; the task uses static condition scheduling and deterministic outcome helpers. |
141+
142+
## 4. Methods (for academic publication)
143+
144+
Participants completed a computerized explicit-risk gambling task implemented in PsychoPy/PsyFlow. On each trial, they chose one of four gambles with known success probabilities and fixed win/loss magnitudes. The participant-facing choice screen displayed the current capital, the four gamble cards, and a single response prompt, while the subsequent outcome screen revealed the sampled die roll and the selected option.
145+
146+
The task operationalizes risk preference through repeated choice behavior and capital accumulation. A valid choice triggers a deterministic die roll derived from a stable seed, followed by win/loss feedback and an updated capital display. If no response is made within the choice window, the trial is logged as a timeout and the capital remains unchanged, preserving the one-trial-one-row analysis contract without fabricating an outcome.
147+
148+
All participant-facing wording is defined in YAML stimulus templates so the same trial logic can be reused across human, QA, and simulation modes without code edits. The human configuration runs 18 trials in one block, whereas QA and simulation configurations shorten the run to 8 trials to support fast validation while preserving the same state sequence, response mapping, and scoring rules.

0 commit comments

Comments
 (0)