diff --git a/examples/README.md b/examples/README.md index 0297343..0312a72 100644 --- a/examples/README.md +++ b/examples/README.md @@ -646,52 +646,3 @@ and the matcher reproduces that order by assigning each shape to a slot, then su out of N. Shows that "sequential" and "unconstrained" are one plugin with `targets` turned from length-1 to length-N. Run it the same two-tab way. -## `reference-game-hawkins.html` and `reference-game-cwg.html` - -Two **faithful replication** builds of the reference game, distinct from the two demos above: where -`reference-game.html` / `reference-game-match.html` are lightweight teaching demos (synthetic shapes, -short schedules), these two are **study artifacts** parameterised to reproduce a specific published -paper, sharing the canonical 12-tangram stimulus set via [`tangrams.js`](tangrams.js). The tangrams in -[`assets/tangrams/`](assets/tangrams/) are the exact set from -[hawkrobe/tangrams](https://github.com/hawkrobe/tangrams) (Hawkins, Frank & Goodman 2020), themselves -reproduced from Clark & Wilkes-Gibbs (1986) — so both builds are directly comparable to both papers. - -| | `reference-game-hawkins.html` | `reference-game-cwg.html` | -| --- | --- | --- | -| Replicates | Hawkins, Frank & Goodman (2020), *Cognitive Science* 44 | Clark & Wilkes-Gibbs (1986), *Cognition* 22:1–39 | -| Condition | Sequential — **single** target, one click | Full-board — all **12** tangrams as an ordered target | -| Schedule | 6 blocks × 12 = **72 trials** (`sequentialSchedule`) | **6 trials**, fresh full-board order each (`fullBoardSchedule`) | -| Fidelity note | Near-exact (the paper was already web + text chat), including Exp. 2's matcher-click gate | Text chat **substitutes** for the original **spoken** dialogue — the one deliberate deviation, noted in-file | - -Both fix director/matcher for the whole game, reveal the target to the director only ("cued"), and use -**unrestricted two-way chat** (`chat_role: "both"`, no count/length limits) — faithful to both papers, -and load-bearing for the reference-shortening effect. `tangrams.js` builds each schedule -**deterministically** from a seed, and both files seed from the shared session id (`?mp_session=`): -each dyad therefore gets its own trial order while its two partners still agree on it without -exchanging anything — a single fixed order across dyads would confound item order with repetition -block, which is the axis both papers measure. Both files also **preload** the 12 tangram PNGs before -pairing, since `rt` is a reported DV and `stimuli` is an object parameter that jsPsych's automatic -media preloading can't see into. The faithful schedules are long for manual piloting — lower `BLOCKS` -(Hawkins) / `TRIALS` (C&WG) at the top of each file for a quick smoke test, then restore. - -Both configs were verified parameter-by-parameter against the papers **and** the original -[hawkrobe/tangrams](https://github.com/hawkrobe/tangrams) experiment code (which pins the details the -prose leaves ambiguous — e.g. the code confirms director and matcher grids are *independently* -scrambled, `notMatchingLocs`, and that the schedule is 72 rounds / 6 per tangram for the sequential -build and `numRounds = 6` full boards for the unconstrained build). Both have been play-tested two-tab -at full faithful schedule length, collecting both participants' data. - -The Hawkins build sets `require_message_before_response: true`, reproducing Exp. 2's gate on the -matcher's click (`game.client.js`: `if (globalGame.messageSent)`) so a referring expression exists on -every trial. The C&WG build leaves it off, matching its free-form protocol. - -> **`round_timeout` is not from either paper.** Both builds set one (60s Hawkins, 180s C&WG) purely so -> a partner who disconnects or walks away cannot hang the trial forever — neither original was timed. -> Rounds it ends are logged as `ended_by: "timeout"` with a null assignment, so they are easy to -> exclude; raise the values if piloting shows genuine trials running long, especially C&WG's first -> full-board trials, which are the longest in the study. - -Like the demos they run on `adapter-multiplayer-local` for two-tab piloting; the header comment marks -the **one-line swap to `adapter-multiplayer-firebase`** (plus a real waiting room) for the paid -Prolific run. Run them the same two-tab way (build packages, serve the repo, copy the `?mp_session=…` -URL into a second tab). diff --git a/examples/assets/tangrams/tangram_A.png b/examples/assets/tangrams/tangram_A.png deleted file mode 100644 index 951c12a..0000000 Binary files a/examples/assets/tangrams/tangram_A.png and /dev/null differ diff --git a/examples/assets/tangrams/tangram_B.png b/examples/assets/tangrams/tangram_B.png deleted file mode 100644 index 49e6578..0000000 Binary files a/examples/assets/tangrams/tangram_B.png and /dev/null differ diff --git a/examples/assets/tangrams/tangram_C.png b/examples/assets/tangrams/tangram_C.png deleted file mode 100644 index 114e18c..0000000 Binary files a/examples/assets/tangrams/tangram_C.png and /dev/null differ diff --git a/examples/assets/tangrams/tangram_D.png b/examples/assets/tangrams/tangram_D.png deleted file mode 100644 index 34d89b3..0000000 Binary files a/examples/assets/tangrams/tangram_D.png and /dev/null differ diff --git a/examples/assets/tangrams/tangram_E.png b/examples/assets/tangrams/tangram_E.png deleted file mode 100644 index c11e77c..0000000 Binary files a/examples/assets/tangrams/tangram_E.png and /dev/null differ diff --git a/examples/assets/tangrams/tangram_F.png b/examples/assets/tangrams/tangram_F.png deleted file mode 100644 index 7138a3c..0000000 Binary files a/examples/assets/tangrams/tangram_F.png and /dev/null differ diff --git a/examples/assets/tangrams/tangram_G.png b/examples/assets/tangrams/tangram_G.png deleted file mode 100644 index fb9fba8..0000000 Binary files a/examples/assets/tangrams/tangram_G.png and /dev/null differ diff --git a/examples/assets/tangrams/tangram_H.png b/examples/assets/tangrams/tangram_H.png deleted file mode 100644 index 2c55c72..0000000 Binary files a/examples/assets/tangrams/tangram_H.png and /dev/null differ diff --git a/examples/assets/tangrams/tangram_I.png b/examples/assets/tangrams/tangram_I.png deleted file mode 100644 index 45acac0..0000000 Binary files a/examples/assets/tangrams/tangram_I.png and /dev/null differ diff --git a/examples/assets/tangrams/tangram_J.png b/examples/assets/tangrams/tangram_J.png deleted file mode 100644 index 93ab788..0000000 Binary files a/examples/assets/tangrams/tangram_J.png and /dev/null differ diff --git a/examples/assets/tangrams/tangram_K.png b/examples/assets/tangrams/tangram_K.png deleted file mode 100644 index 844801d..0000000 Binary files a/examples/assets/tangrams/tangram_K.png and /dev/null differ diff --git a/examples/assets/tangrams/tangram_L.png b/examples/assets/tangrams/tangram_L.png deleted file mode 100644 index 2a9496b..0000000 Binary files a/examples/assets/tangrams/tangram_L.png and /dev/null differ diff --git a/examples/reference-game-cwg.html b/examples/reference-game-cwg.html deleted file mode 100644 index 6653eae..0000000 --- a/examples/reference-game-cwg.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - Reference Game — Clark & Wilkes-Gibbs 1986 replication (full-board) — jsPsych multiplayer - - - - - - - - - - - - - - - - - diff --git a/examples/reference-game-hawkins.html b/examples/reference-game-hawkins.html deleted file mode 100644 index c076124..0000000 --- a/examples/reference-game-hawkins.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - Reference Game — Hawkins et al. 2020 replication (sequential) — jsPsych multiplayer - - - - - - - - - - - - - - - - - diff --git a/examples/tangrams.js b/examples/tangrams.js deleted file mode 100644 index 54b3402..0000000 --- a/examples/tangrams.js +++ /dev/null @@ -1,72 +0,0 @@ -// ================================================================================================= -// Canonical tangram stimuli + faithful round schedules, shared by the two reference-game replications -// (reference-game-hawkins.html and reference-game-cwg.html). -// -// The 12 tangrams are the EXACT set from Hawkins, Frank & Goodman (2020), "Characterizing the Dynamics -// of Learning in Repeated Reference Games" (github.com/hawkrobe/tangrams, tangram_A…L.png), which are -// themselves reproduced from Clark & Wilkes-Gibbs (1986). Using this one set keeps both replications -// directly comparable to both papers. The shapes are intentionally UNNAMED (ids A–L only): coining a -// name for each hard-to-describe shape is the whole point of the task. -// ================================================================================================= -(function (global) { - const LETTERS = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"]; - - // Plugin stimulus objects: { id, src }. `src` is relative to the examples/ dir (works when served). - const STIMULI = LETTERS.map((L) => ({ id: L, src: `assets/tangrams/tangram_${L}.png` })); - - // Small seeded PRNG (mulberry32). A schedule must be RANDOM-LOOKING yet DETERMINISTIC so that both - // tabs/partners, loading the same seed, agree on the target sequence without exchanging it — and so - // any given run is reproducible from its seed alone. Both examples pass the shared session id - // (`?mp_session=`), so each dyad gets its own order while its two partners still agree; the default - // seeds below are a same-order-every-time fallback for opening a file with no session in the URL. - function mulberry32(seedStr) { - let h = 1779033703 ^ seedStr.length; - for (let i = 0; i < seedStr.length; i++) { - h = Math.imul(h ^ seedStr.charCodeAt(i), 3432918353); - h = (h << 13) | (h >>> 19); - } - let a = h >>> 0; - return function () { - a |= 0; - a = (a + 0x6d2b79f5) | 0; - let t = Math.imul(a ^ (a >>> 15), 1 | a); - t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; - return ((t ^ (t >>> 14)) >>> 0) / 4294967296; - }; - } - function shuffled(arr, rng) { - const a = arr.slice(); - for (let i = a.length - 1; i > 0; i--) { - const j = Math.floor(rng() * (i + 1)); - [a[i], a[j]] = [a[j], a[i]]; - } - return a; - } - - // Hawkins "sequential" schedule: `blocks` repetition blocks × 12 trials (72 total at blocks=6). Each - // tangram is the SINGLE target exactly once per block; the within-block order is reshuffled each - // block. Returns blocks*12 rounds of { round, targets: [id] } with unique, contiguous round indices. - function sequentialSchedule(blocks, seed) { - const rng = mulberry32(seed || "hawkins-sequential"); - const ids = STIMULI.map((s) => s.id); - const rounds = []; - let r = 0; - for (let b = 0; b < blocks; b++) { - for (const id of shuffled(ids, rng)) rounds.push({ round: r++, targets: [id] }); - } - return rounds; - } - - // Clark & Wilkes-Gibbs "full-board" schedule: `trials` trials (6 in the original), each a fresh - // random ORDER of all 12 tangrams that the matcher must reproduce. Returns `trials` rounds of - // { round, targets: [all 12 ids, ordered] }. - function fullBoardSchedule(trials, seed) { - const rng = mulberry32(seed || "cwg-fullboard"); - const ids = STIMULI.map((s) => s.id); - const rounds = []; - for (let r = 0; r < trials; r++) rounds.push({ round: r, targets: shuffled(ids, rng) }); - return rounds; - } - - global.Tangrams = { STIMULI, sequentialSchedule, fullBoardSchedule }; -})(typeof globalThis !== "undefined" ? globalThis : this);