New platform/api/ service owns students, cohorts, curriculum, progress, scenario attempts, and student/admin sessions. No k3s, no --privileged, no terminal runtime — starts instantly, unlike the old identity service which booted an unused k3s cluster just to serve roster/progress APIs. Provisioner calls (student and admin) are consolidated here too, in provisioner-client.js, so it's the only service that talks to the Provisioner directly.
25 lines
1.2 KiB
SQL
25 lines
1.2 KiB
SQL
-- exam_sessions — historical import of the old SQLite `sessions` table (exam mode records).
|
|
-- Scope note (see docs/PHASE2B_ADMIN_AND_PLATFORM_DATA.md "Known limitations"): exam mode's
|
|
-- LIVE session bookkeeping (start/submit/shuffle/abandon) remains Lab-image-local for Phase
|
|
-- 2B — it's tightly coupled to a single Lab's live cluster state the same way scenario
|
|
-- validation is, and productionizing it would need the same relay pattern progress got in
|
|
-- Phase 2A, which is scoped out here (not in the Phase 2B acceptance test). This table exists
|
|
-- so historical exam records survive the SQLite migration and are visible to instructors, not
|
|
-- because new exam sessions get written here yet.
|
|
|
|
CREATE TABLE IF NOT EXISTS exam_sessions (
|
|
session_id TEXT PRIMARY KEY,
|
|
student_id TEXT REFERENCES students(student_id),
|
|
bundle_id TEXT NOT NULL,
|
|
started_at TIMESTAMPTZ NOT NULL,
|
|
submitted_at TIMESTAMPTZ,
|
|
status TEXT NOT NULL DEFAULT 'active',
|
|
exam_minutes INTEGER NOT NULL DEFAULT 120,
|
|
duration_secs INTEGER,
|
|
snapshot JSONB,
|
|
scenario_ids JSONB,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_exam_sessions_student ON exam_sessions(student_id);
|