A tiny, single-file web app that lets you practice a classroom de-escalation scenario and see the consequences of different teacher responses in seconds. Designed for hackathon demos: no installs, runs in any modern browser, and looks great full-screen on a headset (“VR-ish”) or laptop.
- Scenario: Elementary school field trip; student didn’t see an exhibit, peers tease, emotions rise.
- Your choices:
- Yell at the frustrated student
- Separate the student from the class (private, supportive talk)
- Ignore the situation
- Immediate outcomes: The log updates, the NPC’s state (emoji + chip) changes, and a status tag summarizes the result (De-escalation / Escalation / Avoidance).
Everything is hard-coded for reliability during judging. No network calls. One HTML file with minimal CSS + vanilla JS.
Teachers rarely get low-risk reps to practice de-escalation. This micro-sim gives a quick, repeatable loop to compare bad vs good responses and rehearse the language that calms things down.
- Clone or download the repo (or just the single
index.htmlif that’s how you’re packaging it). - Open
index.htmlby double-clicking it (Chrome/Edge/Firefox/Safari). - Press
F11(Windows) orCtrl⌘F(macOS on Chrome) to go full-screen for a “VR-ish” feel. - Click one of the three options on the right. Use Restart to try another path.
Tip: On a headset (Quest Browser), simply open the page and toggle full-screen. The UI is tuned for readability at distance.
- State: Two small JS objects power the app:
initialTranscript: the pre-scripted opening dialogue (students A/B/C).outcomes: the three branches (teacher line, aftermath lines, status tags, and NPC emotion).
- Renderer: Each line is appended to the left-panel log. The NPC card (emoji + “Agitated/Calmer/Distressed” chip) updates to reflect the outcome.
- Reset:
Restartclears the log and replays the opening transcript.
No frameworks, build steps, or external dependencies.
.
├── index.html # Single-file app (HTML + CSS + JS)
└── README.md # You are here
- Hook (why): “When one student melts down, the whole class derails. Practice beats theory.”
- Bad path: Choose Yell → watch Escalation status + NPC turns “Upset.”
- Good path: Restart → choose Separate → De-escalation + calmer NPC.
- Takeaway: “This is a bite-size sim teachers can run on any device, between periods, no install.”
(Optional) Keep a short screen-capture video handy as a fallback if Wi-Fi or hardware acts up.
Open index.html and scroll to the script section:
const initialTranscript = [
{ who: "Student A (frustrated)", text: "It's not fair! ..." },
{ who: "Student B (teasing)", text: "Maybe you were too slow! ..." },
// ...
];
const outcomes = {
yell: {
teacher: "Ok, that's enough! ...",
aftermath: [
{ who: "Student A (reacts)", text: "That's not fair! ..." },
{ who: "Narration", text: "After being yelled at, ..." }
],
tags: [{ cls: "bad", text: "Escalation" }, { cls: "", text: "Emotional safety ↓" }],
status: { text: "Outcome: Escalation ...", kind: "bad" },
npc: { emoji: "😠", feelClass: "bad", feelText: "Upset", line: "\"Please stop yelling…\"", aside: "Heart rate ↑, fight/flight" }
},
// separate, ignore ...
};- Add/edit lines to change dialogue.
- Update
npcto change emoji and the state chip text. - Status tags use classes
ok,warn,badfor color.
- Single file → dead simple to run anywhere.
- Deterministic → no loading spinners, no API keys, no surprises.
- Readable at distance → larger base font, high contrast, gentle motion only.
- Test once on the headset/laptop in full-screen.
- Keep a local copy (no CDNs) to avoid captive portals/Wi-Fi issues.
- Have a 45-second MP4 of a complete run as a last-resort fallback.
These are not required for judging, but easy follow-ups:
- Keyboard shortcuts:
1/2/3to choose,Rrestart,Ffull-screen. - Reflection card: one-liner explaining why a choice helped/hurt.
- Agitation heatbar: tiny meter that rises/falls per choice.
- Author mode: inline JSON editor + Apply to live-reload the script.
- Local analytics: count paths and time-to-calm; export as CSV.
- Service worker: offline cache of this single file.
MIT — do whatever helps teachers and students. Attribution appreciated.