Skip to content

Commit e095213

Browse files
committed
Refresh H000037 task snapshot
1 parent f8ec80c commit e095213

3 files changed

Lines changed: 247 additions & 3 deletions

File tree

public/psyflow-web/task-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schema_version": 1,
3-
"generated_at": "2026-04-04T02:55:09.4450074Z",
3+
"generated_at": "2026-04-04T03:11:29Z",
44
"org": "TaskBeacon",
55
"runner_repo": "psyflow-web",
66
"runner_url": "https://taskbeacon.github.io/psyflow-web/",
@@ -28,12 +28,12 @@
2828
"acquisition": "behavior",
2929
"maturity": "prototype",
3030
"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",
31+
"short_description": "Browser companion for the Chinese explicit-risk dice gambling task with four known-probability options, cumulative capital feedback, and psyflow-web trial-context stamping",
3232
"repo_url": "https://github.com/TaskBeacon/H000037-game-of-dice",
3333
"default_branch": "main",
3434
"download_url": "https://github.com/TaskBeacon/H000037-game-of-dice/archive/refs/heads/main.zip",
3535
"run_url": "https://taskbeacon.github.io/psyflow-web/?task=H000037-game-of-dice",
36-
"last_updated": "2026-04-03T13:05:44Z"
36+
"last_updated": "2026-04-04T03:11:29Z"
3737
},
3838
{
3939
"directory": "H000038-two-armed-bandit",
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Game of Dice Task (HTML Preview)
2+
3+
| Field | Value |
4+
|---|---|
5+
| Name | Game of Dice Task |
6+
| Version | html (v0.1.0-dev) |
7+
| URL / Repository | https://github.com/TaskBeacon/H000037-game-of-dice |
8+
| Short Description | Browser companion for the Chinese explicit-risk dice gambling task with four known-probability options, cumulative capital feedback, and psyflow-web trial-context stamping |
9+
| Created By | TaskBeacon py2js port |
10+
| Date Updated | 2026-04-04 |
11+
| Modality | Behavior |
12+
| Language | Chinese |
13+
14+
## 1. Task Overview
15+
16+
This HTML companion mirrors the local `T000037-game-of-dice` task. Participants make explicit-risk gambling choices on each trial by selecting one of four options with known win probabilities and fixed win/loss magnitudes. The browser companion keeps the same trial stages, scoring meaning, response mapping, and deterministic die-roll logic as the local task, while shortening the run to a smaller 8-trial preview block for fast review in the shared runner. Participant-visible phases now stamp trial context through the psyflow-web unit API so the browser preview stays aligned with the shared runner contract.
17+
18+
## 2. Task Flow
19+
20+
### Block-Level Flow
21+
22+
| Step | Description |
23+
|---|---|
24+
| Load Config | Load the browser preview config. |
25+
| Show Instructions | Present the Chinese instruction screen. |
26+
| Initialize Capital | Start the running total at 1000 points. |
27+
| Generate Conditions | Repeat the single `gdt_standard` condition across the preview block. |
28+
| Run Trials | Execute the same fixation -> choice -> outcome -> feedback -> ITI flow as the local task with `set_trial_context(...)` annotations on each visible phase. |
29+
| Save Data | Export preview data through the shared runner. |
30+
| Finalize | Close the session through the browser task shell. |
31+
32+
The default preview uses one block, so the optional block-break screen is defined but skipped.
33+
34+
### Trial-Level Flow
35+
36+
| Step | Description |
37+
|---|---|
38+
| Fixation | A central fixation cross is shown briefly. |
39+
| Choice screen | The current total, prompt, and four risk cards are shown; the participant presses `1`-`4`. |
40+
| Outcome reveal | If a valid response was made, the sampled die roll and selected option are shown. |
41+
| Feedback | If a valid response was made, the win/loss message and updated capital are shown. |
42+
| Timeout branch | If the response window expires, the trial logs `timeout=true`, skips outcome/feedback, and keeps capital unchanged. |
43+
| ITI | A short fixation interval separates trials. |
44+
45+
### Controller Logic
46+
47+
| Feature | Description |
48+
|---|---|
49+
| Condition scheduling | A single repeated `gdt_standard` label is scheduled by block generation, matching the canonical trial contract. |
50+
| Capital tracking | `current_capital` and `total_score` are updated after each valid outcome. |
51+
| Response contract | Keys `1`-`4` select the four gamble options; the same keys are used in preview mode. |
52+
| Trial context | Each displayed unit stamps `trial_context` metadata through the shared psyflow-web API. |
53+
| Adaptive control | None. This is a static explicit-risk task, not a staircase or reversal task. |
54+
55+
### Other Logic
56+
57+
| Feature | Description |
58+
|---|---|
59+
| Deterministic roll | `trialSeed(...)` combines the block seed, block index, and trial id to produce a reproducible six-sided roll. |
60+
| Outcome evaluation | `computeChoiceOutcome(...)` maps the selected option to win/loss magnitude, reward sign, and capital update. |
61+
| Advantageous choice flag | Options with 3 or 4 die faces are marked as advantageous choices for summary reporting. |
62+
| Trial summary | `summarizeGdtTrials(...)` computes win rate, advantageous-choice rate, timeout count, RT, and final capital. |
63+
| Browser API alignment | `main.ts`, `run_trial.ts`, and `utils.ts` now follow the current `psyflow-web` unit/context pattern used by newer TaskBeacon H tasks. |
64+
65+
## 3. Configuration Summary
66+
67+
Settings are defined in `config/config.yaml`.
68+
69+
### a. Subject Info
70+
71+
| Field | Meaning |
72+
|---|---|
73+
| `subject_id` | Numeric participant identifier supplied by the shared runner. |
74+
75+
### b. Window Settings
76+
77+
| Parameter | Value |
78+
|---|---|
79+
| `window.size` | `[1280, 720]` |
80+
| `window.units` | `pix` |
81+
| `window.screen` | `0` |
82+
| `window.bg_color` | `black` |
83+
| `window.fullscreen` | `false` |
84+
| `window.monitor_width_cm` | `35.5` |
85+
| `window.monitor_distance_cm` | `60` |
86+
87+
### c. Stimuli
88+
89+
| Name | Type | Description |
90+
|---|---|---|
91+
| `instruction_text` | text | Chinese instructions describing the four dice betting options and the 1000-point starting capital. |
92+
| `fixation` | text | Central fixation cross shown before choice and during ITI. |
93+
| `capital_banner` | text | Current total capital shown at the top of the choice screen. |
94+
| `choice_prompt` | text | Prompt asking the participant to choose one of the four options. |
95+
| `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. |
96+
| `outcome_text` | text | Die roll reveal and selected option label. |
97+
| `feedback_win` | text | Win feedback with the point gain and updated capital. |
98+
| `feedback_loss` | text | Loss feedback with the point loss and updated capital. |
99+
| `block_break` | text | Optional block summary for multi-block runs. |
100+
| `end_summary` | text | Final total capital shown at task completion. |
101+
102+
### d. Timing
103+
104+
| Phase | Duration |
105+
|---|---|
106+
| `timing.fixation_duration` | `0.5 s` |
107+
| `timing.choice_duration` | `10.0 s` |
108+
| `timing.outcome_duration` | `0.9 s` |
109+
| `timing.feedback_duration` | `1.0 s` |
110+
| `timing.iti_duration` | `0.8 s` |
111+
112+
### e. Browser Preview Differences
113+
114+
| Parameter | Meaning |
115+
|---|---|
116+
| `task.total_blocks` | Shortened to 1 for preview. |
117+
| `task.total_trials` | Shortened to 8 for preview. |
118+
| `task.voice_enabled` | Disabled in the browser preview. |
119+
120+
## 4. Methods (for academic publication)
121+
122+
The HTML companion presents the same explicit-risk dice gambling task as the local PsychoPy build, but inside the shared browser runner. On each trial, the participant chooses one of four gambles with known probabilities and fixed win/loss magnitudes. The preview keeps the condition semantics, response mapping, scoring meaning, and timeout behavior aligned with the local task while shortening the overall run length for browser testing and gallery navigation.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Game of Dice Task (HTML Preview)
2+
3+
| Field | Value |
4+
|---|---|
5+
| Name | Game of Dice Task |
6+
| Version | html (v0.1.0-dev) |
7+
| URL / Repository | https://github.com/TaskBeacon/H000037-game-of-dice |
8+
| Short Description | Browser companion for the Chinese explicit-risk dice gambling task with four known-probability options, cumulative capital feedback, and psyflow-web trial-context stamping |
9+
| Created By | TaskBeacon py2js port |
10+
| Date Updated | 2026-04-04 |
11+
| Modality | Behavior |
12+
| Language | Chinese |
13+
14+
## 1. Task Overview
15+
16+
This HTML companion mirrors the local `T000037-game-of-dice` task. Participants make explicit-risk gambling choices on each trial by selecting one of four options with known win probabilities and fixed win/loss magnitudes. The browser companion keeps the same trial stages, scoring meaning, response mapping, and deterministic die-roll logic as the local task, while shortening the run to a smaller 8-trial preview block for fast review in the shared runner. Participant-visible phases now stamp trial context through the psyflow-web unit API so the browser preview stays aligned with the shared runner contract.
17+
18+
## 2. Task Flow
19+
20+
### Block-Level Flow
21+
22+
| Step | Description |
23+
|---|---|
24+
| Load Config | Load the browser preview config. |
25+
| Show Instructions | Present the Chinese instruction screen. |
26+
| Initialize Capital | Start the running total at 1000 points. |
27+
| Generate Conditions | Repeat the single `gdt_standard` condition across the preview block. |
28+
| Run Trials | Execute the same fixation -> choice -> outcome -> feedback -> ITI flow as the local task with `set_trial_context(...)` annotations on each visible phase. |
29+
| Save Data | Export preview data through the shared runner. |
30+
| Finalize | Close the session through the browser task shell. |
31+
32+
The default preview uses one block, so the optional block-break screen is defined but skipped.
33+
34+
### Trial-Level Flow
35+
36+
| Step | Description |
37+
|---|---|
38+
| Fixation | A central fixation cross is shown briefly. |
39+
| Choice screen | The current total, prompt, and four risk cards are shown; the participant presses `1`-`4`. |
40+
| Outcome reveal | If a valid response was made, the sampled die roll and selected option are shown. |
41+
| Feedback | If a valid response was made, the win/loss message and updated capital are shown. |
42+
| Timeout branch | If the response window expires, the trial logs `timeout=true`, skips outcome/feedback, and keeps capital unchanged. |
43+
| ITI | A short fixation interval separates trials. |
44+
45+
### Controller Logic
46+
47+
| Feature | Description |
48+
|---|---|
49+
| Condition scheduling | A single repeated `gdt_standard` label is scheduled by block generation, matching the canonical trial contract. |
50+
| Capital tracking | `current_capital` and `total_score` are updated after each valid outcome. |
51+
| Response contract | Keys `1`-`4` select the four gamble options; the same keys are used in preview mode. |
52+
| Trial context | Each displayed unit stamps `trial_context` metadata through the shared psyflow-web API. |
53+
| Adaptive control | None. This is a static explicit-risk task, not a staircase or reversal task. |
54+
55+
### Other Logic
56+
57+
| Feature | Description |
58+
|---|---|
59+
| Deterministic roll | `trialSeed(...)` combines the block seed, block index, and trial id to produce a reproducible six-sided roll. |
60+
| Outcome evaluation | `computeChoiceOutcome(...)` maps the selected option to win/loss magnitude, reward sign, and capital update. |
61+
| Advantageous choice flag | Options with 3 or 4 die faces are marked as advantageous choices for summary reporting. |
62+
| Trial summary | `summarizeGdtTrials(...)` computes win rate, advantageous-choice rate, timeout count, RT, and final capital. |
63+
| Browser API alignment | `main.ts`, `run_trial.ts`, and `utils.ts` now follow the current `psyflow-web` unit/context pattern used by newer TaskBeacon H tasks. |
64+
65+
## 3. Configuration Summary
66+
67+
Settings are defined in `config/config.yaml`.
68+
69+
### a. Subject Info
70+
71+
| Field | Meaning |
72+
|---|---|
73+
| `subject_id` | Numeric participant identifier supplied by the shared runner. |
74+
75+
### b. Window Settings
76+
77+
| Parameter | Value |
78+
|---|---|
79+
| `window.size` | `[1280, 720]` |
80+
| `window.units` | `pix` |
81+
| `window.screen` | `0` |
82+
| `window.bg_color` | `black` |
83+
| `window.fullscreen` | `false` |
84+
| `window.monitor_width_cm` | `35.5` |
85+
| `window.monitor_distance_cm` | `60` |
86+
87+
### c. Stimuli
88+
89+
| Name | Type | Description |
90+
|---|---|---|
91+
| `instruction_text` | text | Chinese instructions describing the four dice betting options and the 1000-point starting capital. |
92+
| `fixation` | text | Central fixation cross shown before choice and during ITI. |
93+
| `capital_banner` | text | Current total capital shown at the top of the choice screen. |
94+
| `choice_prompt` | text | Prompt asking the participant to choose one of the four options. |
95+
| `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. |
96+
| `outcome_text` | text | Die roll reveal and selected option label. |
97+
| `feedback_win` | text | Win feedback with the point gain and updated capital. |
98+
| `feedback_loss` | text | Loss feedback with the point loss and updated capital. |
99+
| `block_break` | text | Optional block summary for multi-block runs. |
100+
| `end_summary` | text | Final total capital shown at task completion. |
101+
102+
### d. Timing
103+
104+
| Phase | Duration |
105+
|---|---|
106+
| `timing.fixation_duration` | `0.5 s` |
107+
| `timing.choice_duration` | `10.0 s` |
108+
| `timing.outcome_duration` | `0.9 s` |
109+
| `timing.feedback_duration` | `1.0 s` |
110+
| `timing.iti_duration` | `0.8 s` |
111+
112+
### e. Browser Preview Differences
113+
114+
| Parameter | Meaning |
115+
|---|---|
116+
| `task.total_blocks` | Shortened to 1 for preview. |
117+
| `task.total_trials` | Shortened to 8 for preview. |
118+
| `task.voice_enabled` | Disabled in the browser preview. |
119+
120+
## 4. Methods (for academic publication)
121+
122+
The HTML companion presents the same explicit-risk dice gambling task as the local PsychoPy build, but inside the shared browser runner. On each trial, the participant chooses one of four gambles with known probabilities and fixed win/loss magnitudes. The preview keeps the condition semantics, response mapping, scoring meaning, and timeout behavior aligned with the local task while shortening the overall run length for browser testing and gallery navigation.

0 commit comments

Comments
 (0)