Flags (alerts)
Immediate flags are the alert situations defined by the guide — a student
is considered flagged as soon as they trigger one (flagged=true). Flags
accumulate over the lesson and are displayed: badge ⚠(warn) / 🚨 (critical)
in the table, text in the student panel.
The 5 triggers
| Flag | Condition | Severity |
|---|---|---|
| A5+B4/B5 → Withdrawal | head down + idle/off-task interaction | 🔴 critical |
| A4+B4+C3/C4 → Withdrawal | prolonged stare + idle + slouched/head-down posture | 🔴 critical |
| G2 no response | no response to the teacher's cue | đź”´ critical |
| Fatigue (D1) | ≥ 3 yawns over the lesson | 🟠warn |
| Social distraction (F3) | A2/A3 + F3 cumulative > 3 min over the lesson |
đźź warn |
Where they come from
- Per window (
scoring.window_flags): the first 3 (A5+B4/B5, A4+B4+C3/C4, G2). - Per lesson (
_student_session): fatigue and social distraction computed over the whole lesson, then merged.
flags = set()
for fl in part["window_flags"]: flags.update(fl.split("|"))
if yawns >= 3: flags.add(FLAG_FATIGUE)
if social_distraction_windows * 15 > 180: flags.add(FLAG_SOCIAL_DISTRACTION)
Display
| In the app | Warn (⚠) | Critical (🚨) |
|---|---|---|
| Students table | orange circle | red circle |
| Student panel | “Advisory flag — teacher action suggested” | “Priority flag — immediate attention” |
The class students_flagged = number of flagged students (the “Flagged”
metric of the metrics row).