Hard rules, never broken silently
5 kinds of rule are hard, and the builder keeps each one: a class stays within its cap; two students in a keep-apart pair go in different classes; students who must be together (twins placed together, or any pair you mark) go in the same class; a teacher request (must be with, or must not be with, a named teacher) is kept; and a student you have locked stays where you put them. None is ever broken silently: when the rules cannot all hold, any rule the builder cannot keep is named with the reason. A grade can also carry grade levels for a combined class: a student is only placed in a class that takes their grade.
What balanced means
Every class is compared with the grade as a whole. If 48 percent of the grade are girls, a class of 20 should have about 10 girls; if 6 students across the grade have the behaviour support flag, 3 classes should have about 2 each. The builder measures class sizes, gender, reading bands 1 to 4, math bands 1 to 4, behaviour support, English learners, the support tag and the mix of current classes, and scores how far each class is from its share. The score is what it lowers; the per class counts are what you see.
Friend requests
Each student can name up to 3 friends in order. The first aim is that every student who asked has at least one of them in their class; the second is that the first choice is preferred to the third. A student with no requests is never penalised. Friend requests are soft: they are weighed against balance, and never against a hard rule.
When two rules contradict
Some rule sets cannot all hold. A pair marked both together and apart, a group that must be together but is larger than every cap, a student who must be with two different teachers, or more students than the caps add up to. The builder checks for these before it starts, names each conflict, and leaves the conflicting rule out of the build rather than breaking it silently. Fix the rule and build again.
How the classes are built
Students who must be together are joined into one unit first. Locked students and teacher requests are placed. The rest are placed one unit at a time, the most constrained first, each into the class where it adds the least imbalance. Then a search moves and swaps students thousands of times, keeping any change that lowers the score and, early on, some that raise it so it can escape a dead end, and it keeps the best split it has seen. Every move it tries keeps every hard rule. The search is seeded, so the same grade gives the same classes every time. It runs in a background worker on the page; 150 students take well under a second on a laptop.
Why a request was not met
Every request the builder reports as not met carries one of these reasons, on screen and on the printed sheet:
- Kept apart
- Each friend asked for is kept apart from the student, or sits with someone they are kept apart from, so the request cannot be met without breaking a hard rule.
- Teacher or grade rule
- The friend's class is one the student must not be in, one of them must be with a named teacher and the other cannot follow, or the two are in grade levels no single class takes.
- Class full
- Moving the student to the friend's class, or the friend to theirs, would go over a class cap, and no swap fixes it without breaking a rule.
- Balance
- The move is possible, but it would unbalance the classes more than the request is worth. The reason names the measure that would suffer most.
- Locked
- The student or the friend is locked in a class by hand, and the other cannot join them there.
Reviewing by hand
The review grid shows each class as a column with its balance underneath. Drag a student to another class, or choose a class from the list, or use the arrow keys, and every warning updates while you move: a broken keep-apart pair, a split twin pair, a class over its cap, a student with none of their friends. Lock the placements you are sure of, then rebalance the rest: the builder starts from your current lists and moves as few students as it can.
Pasting a grade
Copy from any spreadsheet. With a header row, columns are matched by name: student or first and last name, current class, gender, reading, math, behaviour, English learner, support, notes, friend 1 to 3, keep apart and together. Without a header, the first column is the name and the second the current class. Two word and three word names are kept whole, and "Chen, Mia" in one cell is read as Mia Chen.
Where the grade is kept
In this browser, and nowhere else. There is no server: the balancing runs on the page and the grade is saved in the browser's own storage. A backup file moves it to another computer. See the privacy page.