Spaces:
Running
Running
Commit History
-
Add dyad_mode, and make condition assignment survive a restart
SONA participants bring their own ids and can quit and restart at will. If a restart reassigns them, the counterbalancing is destroyed silently. The PsychoPy tasks solved this with the Pavlovia shelf: a persistent orderMap keyed by subject id, looked up before assigning anything new. Do it with determinism instead of shared state -- assignment is a pure function of the pid, so a reload, a refresh or a Space cold start all land on the same arm. Nothing is claimed, so there is no race between simultaneous arrivals and no counter to lose. This is the same reason _seed_from_pid had to stop using hash(). Two sources: allocation.csv for the planned study, where the split is exactly balanced because it was dealt in advance, and a hash of the id for ids that were never in the table, where balance is approximate as it is for any per-arrival randomisation. Ids outside the table do NOT pick up a night block from their hash unless the link asks, so a pilot link cannot silently acquire one. dyad_…1f942d5 -
Make the randomisation reproducible, and stop losing trials in the export
_seed_from_pid used Python's hash(), which is salted per process. The same pid therefore produced a different trial order, work side and partner avatar on every server restart, and a Spaces cold start mid-session reshuffled the remaining blocks. Switched to crc32. The regression test spawns fresh interpreters, because nothing in-process can catch this. Counterbalance the night blocks. build_experiment() listed Night 1 before Night 2 unconditionally, so every 'both' participant met Night 1 first and any Night1-vs-Night2 difference was confounded with fatigue and practice. The stage list is fixed at import time and cannot be reordered per session, so both lanes are built and the unused one is skipped, driven by ?night_order=. Pre-register the allocation (make_allocation.py, allocation.csv). A seed gives random assignment, not balanced assignment; a table fixes the split exactly and can be inspected before collection starts. Arms are balanced WITHIN group, since group is recruited rathe…4a98c12