Class Seating Planner
What it is
A seating-plan builder for teachers that runs as a single web page. You draw the classroom out of draggable desks, tag each pupil with the things that matter, and it assigns everyone a seat that respects the rules. Plans save in the browser and export to a file you can reload later.
Why I built it
Seating a class is a constraint puzzle that gets re-solved every term, usually on paper with a lot of crossing out. The rules are easy to say and horrible to hold in your head all at once. Keep those two apart. She needs the front. Spread the attainment bands, except this pair genuinely work better together. By about the fourth rule you can’t move one child without breaking two others.
Computers are very good at this exact shape of problem. I wanted the whole loop in one place: draw the room, state the rules, let it shuffle.
How it works
One hand-written HTML file, no framework and no build step. Desks are squares on a snap grid, and any edge of a desk can be toggled into a seat. That single primitive turns out to cover rows, paired desks and group tables without needing a separate concept for each.
Desks sharing a border merge into clusters using a small union-find. Two children only count as neighbours if their seats meet on the same desk, or across two desks that touch, so the row behind you deliberately isn’t “next to” you. Deciding that rule took considerably longer than writing it.
Assignment is simulated annealing. Tens of thousands of random seat swaps under a cooling schedule, three restarts, then greedy sweeps until nothing improves. Every rule is a weight in one penalty function, and the weights are spaced far enough apart to form a strict hierarchy: locked seats never move, keep-apart and work-with beat the front/back/centre requests, and all of those beat whichever assignment mode you picked. A thirty-seat room solves in about fifteen milliseconds. Anything that couldn’t be satisfied gets listed in plain English afterwards rather than quietly fudged.
What I’d change
There’s no undo. Deleting twenty desks is one keypress and a confirm dialog, which is braver than I’d like.
The solver weights are hand-tuned numbers that happen to behave themselves. I’d rather they were derived from something than chosen by me.
Pupils are initials only. That’s deliberate, since nothing sensitive should be sitting in a browser tab, but importing a class list from a spreadsheet would save everyone the first five minutes.
How to use it
Paste the class in as initials, separated by commas or line breaks. Tag whoever needs it: attainment (WTS/EXS/GDS), gender, front/back/centre/alone, plus not-near and work-with pairs.
Then lay the room out. The Rows and Groups presets cover most classrooms; otherwise double-click to drop a desk and click its edges to create seats. Pick a mode, press Assign, and read the seating check to see whether anything couldn’t be met.
Drag anyone you disagree with, lock the pupils who must stay put, and run it again. Locked children don’t move. Export writes the plan to a file you can reload next term, and Print gives you a landscape copy for the wall.
HTMLCSSJavaScriptlocalStorage