Overview
A server-side SQLite/D1 record stores one current simulator snapshot per room. It contains model inputs, a clock anchor, playback state and student display choices. Students render locally with the same deterministic engine; this is state synchronization rather than streamed video or a remote desktop.
Students poll about once a second. Teachers send changed state after a short debounce and refresh a heartbeat about every two seconds. A server timestamp estimates transit age; animation uses a local monotonic clock between updates. Device scheduling and network delay mean this is approximate synchronization, not frame-exact instrumentation.
Authority and display
The join code grants read access only. Creation returns a separate random 256-bit teacher capability; only its SHA-256 hash is stored. Updates and ending a room require that capability and a same-origin request. Students cannot write using the join code. Each update has an increasing revision to reject older writes.
Start a live session sits beside Student screens and opens its panel. The panel groups the session code/link/preview/end actions with a full-width Student traces picker, followed by Readouts and Views. Mirror my screen resolves to the teacher’s current trace selection. Choose traces copies that effective selection; any individual or bulk edit also sets followTeacher to false and changes only display.traces. Mirroring can be restored without altering the teacher’s traces or the physiology. Case mode offers only the supported ECG, pressure and pleth channels; selected traces remain subject to the case’s progressive data reveal. Supporting explanations open on hover or focus, and by tap on touch screens. The teacher chooses visible traces, the table, overlay and ECG access, plus independent vital-readout visibility for rhythm, BP, LVEDP, wedge and forward output. Rhythm is hidden by default, including the automatic 12-lead interpretation and rhythm status banner. Numeric readout switches affect the main vital cards, compact toolbar and revealed case measurements, while traces and table visibility are separate. These switches do not alter physiological calculations. Existing room snapshots without these settings retain numeric readouts and default to hidden rhythm. Student UI omits clinical/intervention controls and the heading diagnosis. The shared overlaySettings stores open/closed state, any or all registered signal IDs, common/independent scale and gradient selection. Students apply these settings even when their main trace set is customized. The overlay access switch can hide the entire panel without discarding its settings. Overlay controls are read-only for students; valve-gradient labels describe the chamber pair and phase without naming the diagnosis. Older snapshots without overlaySettings default to a closed, empty overlay on the common pressure scale. Local inspectors and view-only studies are not broadcast back to the teacher; pointer movement and arbitrary page scroll positions are not mirrored.
Failure and session lifetime
Shared records expire after six hours, and expired rows are removed in bounded batches as new sessions start. Ending a session deletes its record. Learner names and attendance are not collected.
A missing heartbeat or failed connection freezes the last received timeline after 15 seconds. Reconnection resumes from the latest state. A paused teacher still sends heartbeats. An inactive teacher tab sends a frozen anchor, since browsers throttle background animation.
The host capability is retained in session storage for that tab’s reload recovery, never in the viewer URL. The database is authoritative; browser storage is only a host credential, not the shared state.
Disclosure boundaries
Only the presently revealed case snapshot is shared. Future case stages, debriefs and protected catalogue are not included. The model still needs internal morphology and parameters to draw signals; diagnosis concealment is a presentation choice, not an examination-security boundary.
Anyone with a viewer link can read that session until it expires or ends. Teachers should share it only with their class. Students can leave for a separate sandbox without changing the teacher session. No patient data should be entered. The display panel shows the intended broadcast, not delivery acknowledgement or attendance.
References & further reading