|
Download CODEBOOK.md from princessamygdala/TreasureHuntForTwo: direct link, hf CLI and curl.
- Browser
- Download file 13.2 kB
-
https://huggingface.co/spaces/princessamygdala/TreasureHuntForTwo/resolve/main/CODEBOOK.md
- Command line
-
hf download hf://spaces/princessamygdala/TreasureHuntForTwo/CODEBOOK.md
-
curl -L -o CODEBOOK.md https://huggingface.co/spaces/princessamygdala/TreasureHuntForTwo/resolve/main/CODEBOOK.md
13.2 kB
| # Codebook, TreasureHuntForTwo combined CSV | |
| Each participant exports to **one** file, `user_data_<seed>_data.csv`, in **long format**: | |
| many row types share one set of columns, and cells are blank where a column doesn't apply | |
| to that row. **Always filter by `row_type` first.** | |
| | `row_type` | One row per… | Count per complete session | | |
| |------------|--------------|----------------------------| | |
| | `trial` | chest opening (a choice + its outcome) | 6 practice + 192 main = 198 | | |
| | `rating` | end-of-house preference rating | 1 practice + 12 main = 13 | | |
| | `quiz` | quiz answer (incl. re-asks of missed items) | 7+ | | |
| | `slide` | intro-slide enter/exit | 8 (4 slides × enter/exit) | | |
| | `click` | a button/mouse click | many | | |
| | `break` | a completed "take a break" pause | 0+ | | |
| | `summary` | the whole session | exactly 1 | | |
| > **Coins vs. analysis units.** Outcomes are stored two ways: **±1 / 0** (`self_outcome`, | |
| > `other_outcome`) for analysis, and the **±10 / 0** coins the child actually saw | |
| > (`shown_self_outcome`, `shown_other_outcome`). | |
| > | |
| > **Leading zeros.** `pid` is a string like `0003`; the CSV stores it correctly, but Excel | |
| > may *display* it as `3`. Import the column as **Text**, or read in R/Python. | |
| --- | |
| ## Identifiers, on every data row | |
| | Column | Values | Meaning | | |
| |--------|--------|---------| | |
| | `row_type` | see table above | Which kind of row this is. | | |
| | `pid` | e.g. `0003` | Participant ID (string; leading zeros meaningful). First digit = group. | | |
| | `gid` | `0`, `1` | Group: **0 = control/healthy**, **1 = CU**. | | |
| | `orderID` | integer | The participant number within the group (numeric part of `pid`). | | |
| | `practice` | `0`, `1` | `1` = practice house, `0` = main task. (`trial` & `rating` rows.) | | |
| --- | |
| ## `trial` rows, one chest opening | |
| | Column | Values | Meaning | | |
| |--------|--------|---------| | |
| | `blockIndex` | `0`–`11` or `practice` | **The experienced block** (OG-style block order): block 0 = the first house entered, block 1 = the second, etc. The pair at each block is fixed per participant, **independent of where the houses sit**. | | |
| | `trialIndex` | `0`–`19` (`0`–`4` practice) | Trial number within the block. | | |
| | `physical_place` | `0`–`11` | Which physical house slot this block happened in. | | |
| | `physical_house` | e.g. `castle` | The physical house's appearance. | | |
| | `float_order` | `you-first` / `partner-first` | Which avatar's coin animates first this block (counterbalanced 6/6). | | |
| | `option_pairs` | e.g. `AC` | The two reward profiles offered in this house. | | |
| | `option_left` / `option_right` | `A`–`D` | Which profile was on each side **this trial** (sides swap across trials). | | |
| | `left_stim` / `right_stim` | int `0`–`25` | Chest stimulus id on each side. Every one of the 24 main-task chests is unique to its (house, side) slot for the session, a look never recurs, so it carries no persistent identity across houses (only PRACTICE reuses the same 4 named looks by design). | | |
| | `left_stim_desc` / `right_stim_desc` | text | Verbal chest look, e.g. `blue arched-lid stripes`. | | |
| | `chosen_side` | `left`, `right` | Which side the participant picked. | | |
| | `chosen_key` | `ArrowLeft`, `ArrowRight` | The key pressed. | | |
| | `chosen_option` | `A`–`D` | The chosen reward-profile letter (= `option_left`/`option_right` by side). The `choices` input for the pyem RL models; build the fit arrays with `pyem_data.py`. | | |
| | `chosen_stim` | int | Stimulus id of the chosen chest. | | |
| | `chosen_stim_desc` | text | Verbal look of the chosen chest. | | |
| | `self_outcome` | `1`, `0`, `-1` | Outcome to the **player** from the chosen chest this trial. | | |
| | `other_outcome` | `1`, `0`, `-1` | Outcome to the **partner** from the chosen chest this trial. | | |
| | `shown_self_outcome` | `10`, `0`, `-10` | Same as `self_outcome`, in the **coins shown** on screen. | | |
| | `shown_other_outcome` | `10`, `0`, `-10` | Same as `other_outcome`, in coins shown. | | |
| | `A_self` … `D_self` | `1`/`0`/`-1` or blank | The **self** outcome that *each option would have given this trial*. Only the two options in this house's pair are filled; the other two are blank. | | |
| | `A_other` … `D_other` | `1`/`0`/`-1` or blank | As above, for the **partner**. | | |
| | `better_self_option` | `A`–`D` or `tie` | Which offered option is better **for the player** by its underlying profile (`tie` if both share a valence). | | |
| | `chose_better_self` | `1`, `0`, blank | Did the participant pick `better_self_option`? Blank when `tie`. | | |
| | `better_other_option` | `A`–`D` or `tie` | Which offered option is better **for the partner**. | | |
| | `chose_better_other` | `1`, `0`, blank | Did they pick `better_other_option`? Blank when `tie`. | | |
| | `cumulPts_self` / `cumulPts_other` | int | Running coin total (player / partner) after this trial (main task). | | |
| | `choice_rt_ms` | int (ms) | **Decision time**: choice screen shown → arrow keypress. | | |
| | `outcome_view_ms` | int (ms) | **Outcome viewing time**: outcome shown → Space/continue. | | |
| | `stim_onset` | ISO | When the two chests appeared. The PsychoPy task's `stimuli_onset`. | | |
| | `outcome_onset` | ISO | When the outcome appeared. The PsychoPy task's `outcome_onset`. | | |
| | `pre_choice_ms` | int (ms) | Idle time from the previous action to `stim_onset`, where PsychoPy drew `ITI_dur`. Measured, not drawn, and ~0: this task has no blank interval between trials. | | |
| | `choice_to_outcome_ms` | int (ms) | Keypress to `outcome_onset`, where PsychoPy drew `ISI_dur`. Also ~0: the outcome follows the keypress with nothing in between. | | |
| | `choice_time` / `outcome_time` | ISO timestamp | Absolute time of the choice keypress / continue press (for aligning with breaks). | | |
| | `house_type` | `0`–`12` | House id (`12` = practice forest hut). | | |
| | `house_name` | e.g. `castle` | Human-readable house. | | |
| | `displayedtarget` | `both` | Both recipients' outcomes are shown every trial. | | |
| --- | |
| ## `rating` rows, end-of-house preference | |
| | Column | Values | Meaning | | |
| |--------|--------|---------| | |
| | `rating_blockIndex` | `0`–`11` or `practice` | Which house was rated. | | |
| | `rating_pair` | e.g. `AC` | The two profiles rated (first letter = first/left chest). | | |
| | `preferred_box_0to6` | `0`–`6` | 7-point scale: **0 = strongly prefer the *first* option** (left chest, first letter of `rating_pair`), **6 = strongly prefer the *second*** (right chest), **3 = no preference**. | | |
| --- | |
| ## `quiz` rows, comprehension check | |
| | Column | Values | Meaning | | |
| |--------|--------|---------| | |
| | `quizIndex` | `0`–`6` | The question's fixed identity. | | |
| | `quiz_position` | int, or `-1` | Order this question was shown (randomized per participant). `-1` marks a re-ask of a previously missed item. | | |
| | `quiz_statement` | text | The true/false statement shown. | | |
| | `quiz_answer` | `TRUE`, `FALSE` | The participant's answer. | | |
| | `quiz_correct_answer` | `TRUE`, `FALSE` | The correct answer. | | |
| | `quiz_is_correct` | `True`, `False` | Whether they were right. | | |
| | `quiz_attempt` | `1`, `2`, … | `1` = first pass; `2+` = re-asks of missed items (asked until correct). | | |
| | `quiz_feedback` | text | The feedback shown after answering. The PsychoPy task's `quizFeedback`. Recorded from 2026-11-09; blank in earlier sessions. | | |
| --- | |
| ## `slide` rows, intro screen timing | |
| | Column | Values | Meaning | | |
| |--------|--------|---------| | |
| | `event_kind` | `slide` |, | | |
| | `slide_name` | `welcome`, `cover`, `howto`, `explorer` | Which intro screen. | | |
| | `slide_phase` | `enter`, `exit` | Arrival vs. leaving. | | |
| | `dwell_ms` | int (ms) | Time on the slide (on `exit` rows). | | |
| | `event_time` | ISO timestamp | When the event fired. | | |
| ## `click` rows, every button/mouse click | |
| | Column | Values | Meaning | | |
| |--------|--------|---------| | |
| | `event_kind` | `click` |, | | |
| | `click_label` | text | Button text if a button was clicked (blank otherwise). | | |
| | `click_tag` | `BUTTON`, `IMG`, … | HTML tag of the click target. | | |
| | `click_x` / `click_y` | int (px) | Click position in the viewport. | | |
| | `event_time` | ISO timestamp | When the click happened. | | |
| ## `break` rows, a completed pause | |
| | Column | Values | Meaning | | |
| |--------|--------|---------| | |
| | `event_kind` | `break` |, | | |
| | `break_start` / `break_end` | ISO timestamp | When the break overlay opened / closed. | | |
| | `break_ms` | int (ms) | Break duration. | | |
| --- | |
| ## `summary` row, one per session | |
| **Session & timing** | |
| | Column | Meaning | | |
| |--------|---------| | |
| | `role` | `c` = child, `p` = parent, captured at ID entry (parent/child dyad study); each plays independently. Only affects instruction wording (e.g. "young person" vs "person") and the post-game questionnaire's family-member label, not randomization/seeding. | | |
| | `started_at` / `ended_at` | First / last gameplay action (ISO). | | |
| | `duration_min` | Minutes between them (includes breaks). | | |
| | `n_breaks` / `total_break_ms` | Number of breaks and total break time (subtract for time-on-task). | | |
| **Outcome & payment** | |
| | Column | Meaning | | |
| |--------|---------| | |
| | `partner_relation` | What the participant is told the partner is. `stranger` in every arm, the BEAR dyad arm included: there the family member is the imagined player in the questionnaire's `hyp_*` block and never the partner. | | |
| | `partner_id` | The anonymous "community-database" partner code shown to the participant (e.g. `4421`). The partner does not play, and a real stranger is paid the coins earned for them. Deterministic from `rando` where there is one, from the pid otherwise. Sessions from 2026-11-09 on record the code they showed; earlier ones are re-derived from the pid (`orders.partner_id_for`). | | |
| | `partner_avatar_idx` / `partner_avatar_gender` | Which of the 4 partner avatar looks (`sprites.PARTNER_AVATARS`, index 0-3) was shown at the matching reveal and used for the partner throughout the game, and its gender label (`f`/`m`). Randomized per participant but deterministic/reproducible from `rando`, or from the pid where there is no `rando` (`orders.partner_avatar_for`), like `partner_id`. With four looks, two people in one household draw the same face about a quarter of the time; their partner codes differ. | | |
| | `total_self` / `total_partner` | Final coin totals (player / partner), main task. | | |
| | `money_self` / `money_partner` | Bonus in $ = coins ÷ 100, capped 0–6. | | |
| **Randomization (this participant's whole design)** | |
| | Column | Meaning | | |
| |--------|---------| | |
| | `stim_by_block` | Per-block chest ids, e.g. `0:A5-D21_1:A14-B6_…`, `letter+id` for the pair's 2 letters at that block (from the logged data; ground truth). Chest looks are unique per (block, letter) slot, not per profile letter overall, see `left_stim` above. | | |
| | `stim_desc_by_block` | As above, with verbal looks instead of ids. | | |
| | `house_by_place` | `place:house` map, e.g. `0:castle_1:pagoda_…`. | | |
| | `pos_by_place` | `place:(row,col)` map positions on the world grid. | | |
| | `blocks_visited_order` | The order the participant actually entered houses (place indices). | | |
| **Technical / device** | |
| | Column | Meaning | | |
| |--------|---------| | |
| | `game_version` / `nicewebrl_version` | Software versions. | | |
| | `framerate_fps` | Browser framerate sampled at start. | | |
| | `browser` / `os` | Parsed from `user_agent`. | | |
| | `screen_w` / `screen_h` / `device_pixel_ratio` | Physical display geometry. | | |
| | `viewport_w` / `viewport_h` | Browser window size. | | |
| | `language` / `timezone` / `cpu_cores` | Browser locale, timezone, logical CPU cores. | | |
| | `user_agent` | Raw browser user-agent string. | | |
| --- | |
| ## The `randomization_log.csv` (separate file, on GitLab) | |
| One **self-describing** row per participant. | |
| | Column | Meaning | | |
| |--------|---------| | |
| | `pid`, `gid`, `group`, `orderID` | ID, group code (0/1), group label (control/CU), participant number | | |
| | `partner_id` | Anonymous partner code shown in the instructions (cover story only; deterministic) | | |
| | `partner_avatar_idx` / `partner_avatar_gender` | Which of the 4 partner avatar looks (index 0-3) + gender label (`f`/`m`); deterministic from pid, same value used at the matching reveal and in-game | | |
| | `layout_id` | Which of the 5 fixed house-location layouts (= `number % 5`) | | |
| | `stim_by_block` (+ `_desc`) | Every one of the 24 chests, one per (block, letter) slot, never reused this session, `0:A5-D21_…` | | |
| | `block_order` | **The experienced sequence of pairs**, `0:CD_1:BC_…` (block 0 = first house entered), a cyclic Latin square over `number`, systematically counterbalanced across the sample. | | |
| | `float_order` | You-first / partner-first per block, `0:you-first_1:partner-first_…` | | |
| | `house_by_place` / `pos_by_place` | Physical house appearance / grid position per place slot | | |
| | `houses_done` / `completed` / `last_saved` | Progress, completion flag, last-save timestamp | | |
| | `role` | `c` = child, `p` = parent (parent/child dyad study); does not affect the design columns above | | |
| Use **`next_id.py`** to read this log and get the next ID to assign per group (+ a balance | |
| check of chest color vs. reward valence across the sample). The design columns are fully | |
| reproducible from the `pid` via `orders.make_order`; `make_order_files.py` writes a | |
| per-participant, code-independent record to `orders/order_<pid>.csv` (`--verify` checks it | |
| still matches live computation); `migrate_rando_log.py` rewrites an old log into this schema. | |