Removes all 353 em dashes across the task, the quiz prefixes becoming
"Correct:" and "Not quite:". Also untracks the study documents a git add -A
swept into main, and adds the script that built this commit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploy: counterbalance the side within a block, fix the feedback capital
Each block now puts the pair's first letter on the left for exactly half its
trials and its second for the other half, shuffled, matching the 20-trial
PsychoPy scheme. Applies to the dyad arm and the SONA arm. The quiz feedback
sentence is recapitalised after its prefix is stripped.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploy: record the trial landmarks, the quiz feedback and the clicks
stim_onset/outcome_onset plus the two interval columns, from stamps nicewebrl
was already writing; the quiz feedback text; partner_relation; and the screen
recorder fix that was losing every click count and the timing file's rt.
Also deals the partner code and avatar from the pool instead of per session.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
30 days ago
Deploy: name a quiz retry after the question it re-asks
Brings the Space up to main. What changes for a running session:
- ?rando=<n> picks the design from the predetermined pool (randos.py), so a
dyad can share one pid and still get two different tasks.
- dyad_mode sessions write to bear/<pid>/ and bear_randomization_log.csv,
leaving data/ and randomization_log.csv to the SONA sample.
- every screen is timed into a per-participant CSV with PsychoPy's column
names, including the quiz answer and whether it was right.
- savequeue_fix.py no longer carries two real participant ID codes, which
this repository has been serving publicly.
The two .docx files on main are left out; HF rejects loose binaries.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Stop a reload from stranding a participant at the end of the hunt
SONA 64408 finished all 192 trials and all 12 ratings, and then the page
never advanced. 64450 hit the same wall the night before and gave up without
writing in. Both sessions are complete in the data and neither one ended.
Reloading mid-game sends EnvStage.activate down its "load stage state from
memory" branch, where flax restores every array as numpy. custom_data_fn then
indexes those arrays and gets numpy scalars back, which make_serializable does
not convert because np.generic is not np.ndarray, so msgpack refuses the
record. That raise lands inside _process_save_queue ahead of its task_done(),
the queue keeps an unfinished task forever, and the queue.join() that ends the
stage can never return. Every later reload blocks at the same await.
Three guards, because the last step turns a lost record into a lost two-hour
session and that should not be possible however a record goes bad:
- get_latest_stage_state runs the restored state through match_types, so a
reload hands back…
Restructure belief/liking into one per-partner check, plus 3 smaller fixes
Belief and liking now run once, covering every partner across both
tasks (not just this task's own), before TriPM/demographics, on
whichever task finishes second. Adds a kind field to the handoff's
partner-row format so the belief question's wording (receive vs. lose)
matches each partner's actual mechanic; backward compatible with the
3-field format.
Also: fixed a real bug where the experimenter ID-entry screen was
showing on every non-dyad session (role was never set outside dyad
mode, but was required to skip it); added partner numbering to the
match-reveal screen; quiz feedback now states the correct answer
outright instead of only explaining it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The retry loop had no exit besides answering correctly, and its attempt
counter was global across every wrong item rather than per item. A
participant who could not pass a given item for any reason had no way
through it. Matches task_pe-cu-nicewebrl's day-quiz cap; a still-wrong
item at the cap is let through flagged forced=True.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add a dev one-house override and carry dev/trials across the handoff
?houses=N shortens a dev run to the first N houses, matching the existing
?trials=N (per-house). The cross-task handoff was also missing the
dev=/trials= passthrough task_pe-cu-nicewebrl already had, so a shortened
session here handed over to a full-length one there; mirrored their fix.
The entry-order redirect now skips itself under ?dev=1 for the same reason
their equivalent redirect does.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Squashed deploy snapshot of main (item 32 in PROJECT_LOG.md), same
docx-free pattern as the previous deploy commits.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Squashed deploy snapshot of main (item 31 in PROJECT_LOG.md), same
docx-free pattern as the previous deploy commit -- see that commit's
message for why the doc is excluded.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Deploy: 16-trial redesign, chest/counterbalancing fixes, pilot bug fixes
Squashed deploy snapshot of main (items 23-30 in PROJECT_LOG.md), built
without the tracked reviewer-instructions .docx: Hugging Face's git
endpoint rejects pushes containing binary files (Git LFS/Xet only), and
this history carried two .docx blobs. The doc isn't needed by the running
app -- it stays tracked on `main` and backed up via `origin`, just left
out of what's pushed here. See PROJECT_LOG.md on `main` for the full,
unsquashed commit history and rationale.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Split chest-pattern slide back into two, switch questionnaire to Qualtrics-style request-response, reword save message
- Split the merged chest-pattern how-to-play slide back into two separate slides
(HOW_TO_PLAY_IDENTITY, HOW_TO_PLAY_VARIES), each with its own illustration; reword
the color/pattern caution bullet and bold both "color" and "pattern".
- Replace questionnaire's hide-Continue-until-answered gating with a Qualtrics-style
"are you sure you want to continue without answering?" confirmation dialog — Continue
is now always visible/clickable on every slider/text/agreement page.
- Reword "Saving your treasure..." to "Saving your data...".
Session 3 polish: cover story wording, merged chest-pattern slide, quiz bolding fix, and coins-bridge/questionnaire reorder
- Cover story: bold adventurer/money/treasure chests only, rename explorer->adventurer,
reword meet-your-partner and turning-coins-into-money slides.
- Merge chest-identity/consistency/variability how-to-play slides into one "chest pattern"
slide with a combined visual (equal-chests + over-many-tries dot row); make the
dot-row caption width-aware so it doesn't clip.
- Reduce swap arrowhead rotation for a more symmetric look on the line.
- Fix quiz item bolding: unbold the leading "you" in the question statement (missed in an
earlier round) while re-bolding both "you" and "your partner" in its feedback line.
- Move the coin-totals screen to right after the main game (new bridge wording, no
"let experimenter" line there) and add a new short final screen with that line after
the post-game questionnaire completes.
Instruction polish, questionnaire back-navigation, and bug fixes
- Reword/rebold cover story and how-to-play screens per feedback: house
added to the chest+coins art, new cover_part1 header, drop "young"
entirely, bold "real money" instead of "your", avatar in how-to-play now
matches the participant's chosen explorer.
- Merge the chest-identity/consistency/variability slides into one combined
slide+visual, drop the separate rating slide, fix the try-counter
highlight centering and the swap arrowheads' angle.
- Quiz: swap emoji, minor wording/bolding fixes, fix an icon mapping.
- Speed up the chest-swap animation.
- Add a fast local-disk CSV refresh per trial, independent of the
GitLab-pushing checkpoints.
- Rebuild the post-game questionnaire as one paged FeedbackStage (matching
the intro flow's pattern) so every screen has a Back button; expand the
hypothetical battery to 3 targets (self/their partner/you) x win/avoid
losing for motivation and effort; dynamic "Your parent"/"Your child"
header and intro line.
- Finish screen: sho…
Illustrated instruction slides, randomized partner avatar, and quiz polish
- Split the cover story into 4 screens (intro, explorer picker, twist +
matching reveal, money/goal) and each how-to-play bullet into its own
screen, each with a purpose-built illustration (sprites.py).
- Add a randomized-per-participant partner avatar (4 muted looks), shown
at the matching reveal with a transparent background and used
consistently everywhere the partner appears in-game; logged in the
CSV/GitLab randomization log.
- Practice: keep the meadow visible behind the "press space to continue"
banner after the rating screen, instead of a full-screen takeover.
- Quiz: remove "you" bolding except for you-vs-partner contrasts, restyle
with playful colors/emoji, and add an illustration per question; add a
houses visual to the "You're all set!" screen.
- Wording: "relatively" -> "pretty reliable" in practice narration.
- Add a dev shortcut (?dev=1&start=questionnaire) to jump straight to the
post-game questionnaire for testing.
Co-Authored-By: Claude Sonnet 5 <no…
Instruction rewrite, parent/child role, post-game questionnaire, and bug fixes
- Reword confusing/redundant instructions; split HOW_TO_PLAY into 3 shorter
screens; clarify that chest identity (not side) matters and stays
consistent all game but isn't 100% deterministic per trial.
- Add parent/child role selection at ID entry (URL param, storage, and
CSV/GitLab logging); "young person" wording now only applies to child
participants.
- Add post-game questionnaire (strategy, motivation, effort, task rating,
belief check, hypothetical parent/child battery), ported from the sibling
PE task's pattern.
- Sound: replace the on/off toggle with a No sound/Chimes/Retro picker.
- Add persistent Fullscreen button so participants can re-enter fullscreen
after exiting it.
- Fix: chest lids could stay visually open after an error in the per-step
overlay-clear hook; a held arrow key on house entry could auto-select a
chest (now requires an explicit SPACE press); mashing SPACE during the
outcome screen could wipe the coin feedback before the minimum view time;
…
Remove the framework 'press any arrow key' toast on the practice end card
msg_display_time alone still showed it for up to 1.5s. Since the toast is created just after
our step hook, sweep and remove any .q-notification a few times once the practice end card
shows — leaving only our own bottom 'Press the space bar to continue.' prompt.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Practice end card: move the continue prompt to the bottom ('Press the space bar to continue.')
Coin trial tweaks:
- golden coins now show '10'
- box text is now two side-by-side boxed chips '+10 YOU' / '0 YOUR PARTNER' (dropped 'for',
smaller, next to each other instead of stacked)
Practice -> quiz:
- removed the auto-advance; after the preference choice it shows a clean end card
'Great, practice done! Press SPACE to continue to the quiz.' and SPACE advances
- the nicewebrl 'press any arrow key to continue' toast no longer lingers: env stages now
have a finite msg_display_time (1500ms) and the quiz screen clears any leftover toast
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- cover story reworded ('the world', 'so you're playing for two!', reordered bullet list,
'paid to both you and your partner'); you/your partner bolded throughout instructions+quiz
- practice feedback: YOU / YOUR PARTNER capitalised; tense made consistent (past for the
outcome, present for the general lesson)
- fixed the split-second glitch where coins/feedback lingered onto the next screen (rating):
they're now cleared client-side the instant SPACE is pressed
- quiz intro reworded to 'Let's see if everything's clear! ...'
- 'You're all set' screen now mentions the PAUSE button for breaks
- after practice (post-rating) it now auto-advances straight to the quiz instead of the
'press any arrow key to continue' screen (clean 'practice done' frame as a fallback)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Instructions: 'figure out' instead of 'learn' (avoid the word 'learn')
The swap animation was setting window.accept_keys=false and re-enabling it via a 640ms
setTimeout — but accept_keys is the SAME gate the outcome 'Press SPACE' timer uses, so the
two could race and leave keys stuck (couldn't press space/arrows after a practice round).
The swap is purely cosmetic, so it no longer touches accept_keys at all; it just slides and
self-clears. Also clear any in-progress swap overlay when the outcome appears (so a fast
pick during the slide can't leave it hanging over the result).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Practice feedback: render with the in-game PIL font (exact match) as one paragraph
The HTML feedback fell back to a modern font (browsers lack DejaVu Sans) and CSS stroke
didn't match the in-game outline. Now the feedback is rendered with the SAME PIL text
helper as the red directions (identical DejaVu font + dark outline), word-wrapped as ONE
paragraph, overlaid as a transparent image and blinked. Removes the forced two-line split.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- cover story: 'from our community database'; goal trimmed to 'open chests and learn which
ones are worth your while'
- partner reveal: partner # highlighted (bold/blue), only the check is green
- quiz: removed the duplicate 'open ONE of two chests' item; fixed the bug where a wrong
answer showed '✗ Incorrect. Correct — ...' (strip the Correct/Not-quite prefix always)
- practice step 2: 'no matter on which side of the table it sits'
- practice feedback: no drop shadow (crisp outline like the in-game red text), back at the
top where the instruction sits (forest-hut line hidden during the outcome so they don't clash)
- sounds: quieter/softer UI click; brighter two-note coin ding for wins; NO sound on chest swap
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- cover story: 'your age' (not 'around your age'), drop the running-total clause; goal reverts
to 'open chests and learn which ones are worth your while' (+ collect as many as you can)
- partner reveal: only the checkmark is green; text reverts to 'You were matched with your
partner (#NNNN from our community database)'
- practice now shows the 'Inside the forest hut / Try x/6' line like the real game, plus a
PRACTICE badge bottom-left; the red feedback moved down so it no longer covers that line
- practice step 2 adds 'no matter which side it appears on' (the chests had just swapped)
- practice feedback is now a single font size for both lines
- dropped the quiz question about the running total
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fix swap animation replaying on a wrong/blocked box press in practice
The chest-swap slide was re-firing every time a blocked (wrong) box was pressed, because
pressing it re-enters the same CHOICE trial and the step hook re-ran the swap detection.
Guard it to run at most once per CHOICE trial (per-user _swap_key), so a wrong press no
longer makes the chests appear to switch sides again.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Green checkmarks everywhere: partner-match + quiz feedback (reliable HTML)
- the 'Matched!' checkmark on the partner-reveal card is now green
- quiz feedback (green check / red cross) now uses ui.html instead of an HTML span inside
markdown, so the colours render reliably
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a chest side-swap animation (chests physically slide when sides switch)
When the two chests trade sides between trials, they now glide across (~0.6s) instead of
just appearing — reinforcing 'follow the chest, not the side'. Chests are baked into the
server-rendered image, so on a same-pair side-swap the server ships a chest-less room
backdrop (cached per house via setSwapBackdrop) plus one transparent layer per chest;
the client (playSwap) hides the baked image with the backdrop and slides the two chest
layers from their old sides to their new ones (with the swoosh sound, keys locked during
the glide). Fires on every genuine side-swap in the main task and the practice step where
the two chests trade places.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- practice narration grammar: 'In the dark stone/blue striped chest...' (was 'From...')
- money is $1 per 100 coins on the 10-coin scale (was wrongly '1000') — fixed in the cover
story, the quiz, and two mislabelled code comments
- quiz feedback: green checkmark for Correct, red cross for Incorrect
- sound toggle is now a solid (filled) button tucked into the very bottom-left corner so it
stays visible over the game art instead of blending in
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Practice polish: clearer wording, no overlap, visible loss coin, state the goal
- loss animation: the gold coin now stays solid while it glides pocket->chest and only
fades as it arrives (was fading out almost immediately / too transparent)
- practice step 2 wording: 'each unique chest is more likely to give a certain number of
coins' (dropped 'tends to give the same kind of result')
- practice no longer draws the 'Inside the forest hut / Try X' line, so the red feedback
at the top can't cover it
- instructions + a new quiz item now state the goal explicitly: coins ADD UP across the
whole game (no running total shown) and your goal is to collect as many as you can, for
both you and your partner, paid as real money at the end
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rewrite practice as a fixed 6-step guided tutorial (enforced choices)
Replaces the free-choice practice + rotating tips with a scripted tutorial that teaches
every social outcome type, in a fixed order (no per-participant randomisation):
1 mutual benefit, 2 consistency (same chest again), 3 mutual loss, 4 instrumental harm,
5 altruism, 6 zero.
- Four named, distinctly-textured practice chests (brown woven, blue striped, green dotted,
dark stone) via sprites.PRACTICE_STIM_DESIGN.
- Each step DIRECTS the player to open one chest and ENFORCES it (only that chest opens;
the named chest glows and alternates sides). New env fields trial_pairs + directed
generalise per-trial pairs and the directed-choice lock (main task: free choice).
- Outcome narration is now one coherent per-step sentence (merging who-earned + teaching),
shown red+blinking; consistent coin wording throughout.
- orders.PRACTICE_PLAN + experiment_structure.PRACTICE_SCRIPT (kept in sync via assert).
- smoke_test updated to press the directed side in practice.
Co-Authored-By: Claud…
Coins higher on the chest (lid/body opening) + red blinking practice feedback
- coin start position moved up (y285 -> y250) so the coins sit in the chest's lid/body
opening before they glide
- practice feedback (who-earned-what + tip) is now an all-RED client overlay at the top
that blinks ~3x to grab attention (rendered text removed; shown via showPracticeFeedback)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Restore the partner character in the overworld (keep only the caption removed)
Per clarification: the partner should still walk alongside the player; only the
'the figure beside you is your partner, who walks with you' caption stays gone.
Practice feedback to top; remove 'partner walks with you'; coloured coins on chest
- practice: who-earned-what + teaching tip moved to the top (no longer overlapping the
bottom YOU/PARTNER labels)
- removed the overworld 'partner walks with you' caption AND the partner character that
followed the player (the partner is an anonymous stranger who isn't there)
- coin animation: the two coins on the chest now show the actual coloured values (gold +10,
white 0, red -10) like the original, then glide to the pockets
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Coin animation rework + remove background music + remove screen-wiggle
- coins now appear on the chosen chest first (~0.5s), then glide to the people; the
travelling 'money' coins are GOLD, while the persistent feedback keeps its colours
(gold +, red -, pale 0). On a loss a gold coin glides pocket -> chest (and back), and a
red -10 stays as feedback.
- removed the background music loop (event SFX still play when sound is on)
- removed the magic-cups screen-wiggle/turntable on side-swaps (the text framing stays)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Split C (part 3): magic-cups shuffle/turntable visual on side-swaps
- when the chests swap sides, a quick perspective turntable 'shuffle' plays on the scene
+ a synthesised swoosh, selling the magic-cups framing
- triggered from the env when side_schedule flips between consecutive trials
- PROJECT_LOG: within-house redesign (Splits A-C) marked complete
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Split C (part 2): coin-float animation (option D) using float_order
- client-side animation over the outcome image: gain coin flies chosen-chest -> pocket
(+sparkle, ka-ching); loss flies pocket -> chest (thunk); 0 pops; a coin stays at each
pocket as the persistent feedback
- sequential you-first/partner-first driven by the block's float_order (~900ms apart)
- static coins removed from the render (the float draws them); cleared when leaving the
outcome; sounds now fire per coin from the animation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- main outcome: removed the top 'you earned' text and the mid floating coins; the single
feedback is now the coin above each avatar
- you + partner brought together and CENTRED at the bottom (cooperative, not versus); coins
appear above each (the landing spot for the upcoming float animation)
- practice: one-sentence who-earned-what at the top (clear of window/lamp) + teaching tip
- magic-cups framing for the side-switching: HOW_TO_PLAY line + a practice tip
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Decouple the experimental block order from house location, like the original task:
- the Nth house ENTERED gets the Nth pair in a fixed per-ID block-order sequence (env now
tracks current_block/blocks_entered; pairs/outcomes/side/attention/float indexed by block)
- house appearance + position stay physical; positions come from 1 of 5 fixed layouts
(number % 5, counterbalanced)
- new per-block float_order (6 you-first / 6 partner-first) for the upcoming coin animation
- DATA: blockIndex is now the experienced block (0..11); added physical_place/physical_house/
float_order per trial + house_by_block/place_by_block in summary; rando log gains
layout_id/block_order/float_order/attention_blocks. CODEBOOK updated.
- verified: orders self-tests, smoke (12x20 all rated), demo playthrough + export, clean boot
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- display name 'Treasure Hunt for Two' -> 'TreasureHuntForTwo' everywhere it's shown
- index(): if ?pid=X differs from the stored pid (same browser reused for a new kid), wipe
per-user storage (new seed -> new data file) and clear saved stage state, so two
participants on one computer never get merged into one file
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Partner cover wording (Option A) + synthesised sound system with toggle
- cover: 'matched with an anonymous stranger... playing for two' (keeps 'partner' term)
- sound: Web Audio synthesis (no asset files) - gentle background loop, ka-ching on gain,
thunk on loss, soft swoosh on 0, chest-open, footsteps, bubbly button clicks; 🔊/🔇
toggle (bottom-left), OFF by default, unlocked by the toggle click
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Polish: first screen, setup, quiz wording (less-is-more, plain checkmarks)
- first screen: single laptop icon (was a keyboard icon + keyboard emoji); reworded to
'play on a computer... click below to enter fullscreen'; removed the footer fullscreen
toggle (redundant with 'Continue in fullscreen')
- pid screen: drop the 'Set-up' heading
- quiz: header 'Quiz Question 5/7'; plain checkmarks (not emoji); strip duplicate 'Correct'
- cover reveal: plain checkmark
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add dev/pilot mode, data provenance (git commit), and Prolific capture
- ?dev=1&start=practice|quiz|main skips the front matter; ?trials=N shrinks trials/house;
dev sessions get a red DEV MODE banner and dev_mode=1 in the data (flagged by quality_flags)
- every session records git_commit (exact code version) in the data provenance
- capture ?PROLIFIC_PID/STUDY_ID/SESSION_ID; optional PROLIFIC_COMPLETION_URL -> return button
- export + CODEBOOK carry git_commit/dev_mode/prolific fields; README documents the shortcuts
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Attention check (21st trial in 2 random houses) + post-hoc quality flags
- new M_ATTENTION env mode: after the 20 trials, 2 deterministically-chosen houses show
'Press the LEFT arrow key to show you're paying attention'; any key advances (no trap),
the key + RT are recorded
- orders: 2 random attention houses per pid (none in practice)
- export: 'attention' rows (block, key, correct, rt) + summary attention_passed/total
- quality_flags.py: flags incomplete / fast-RT / side-bias / failed-attention participants
(surfaces for review, does not auto-exclude)
- CODEBOOK documents the attention rows + summary fields
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rename: Duo Treasure Hunt -> Treasure Hunt for Two
- outcome no longer auto-advances: keys locked for OUTCOME_HOLD_MS, then a 'Press SPACE'
prompt appears and Space advances. Arrows are swallowed during the outcome so they can't
reset the wait; Space is blocked until the wait elapses.
- practice teaching tip now shows during the amount-feedback (OUTCOME), not the choice
(choice screen is clean)
- HOW_TO_PLAY updated to describe the Press-SPACE behaviour
- also updated the GitLab data-repo README (separate, via API)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>