diff --git a/VERSION b/VERSION index 599028f..109a20f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.21 +0.2.22 diff --git a/db/005_assignments.sql b/db/005_assignments.sql new file mode 100644 index 0000000..9cff863 --- /dev/null +++ b/db/005_assignments.sql @@ -0,0 +1,16 @@ +-- Toewijzingen: een leerkracht koppelt één van haar eigen borden (via het +-- stabiele board-id uit users.data) aan een klas of een individuele leerling. +-- Puur additief, leeg bij aanmaak. Precies één van class_id/pupil_id gezet: +-- een klas-toewijzing (standaard voor iedereen in de klas) of een leerling- +-- toewijzing (uitzondering, voor een leerling op een ander niveau). +CREATE TABLE IF NOT EXISTS assignments ( + id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, + class_id BIGINT REFERENCES classes(id) ON DELETE CASCADE, + pupil_id BIGINT REFERENCES users(id) ON DELETE CASCADE, + teacher_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE, + board_id TEXT NOT NULL, + updated_at TIMESTAMPTZ NOT NULL DEFAULT now(), + CHECK (num_nonnulls(class_id, pupil_id) = 1) +); +CREATE UNIQUE INDEX IF NOT EXISTS idx_assignments_class ON assignments(class_id) WHERE class_id IS NOT NULL; +CREATE UNIQUE INDEX IF NOT EXISTS idx_assignments_pupil ON assignments(pupil_id) WHERE pupil_id IS NOT NULL; diff --git a/public/css/teach.css b/public/css/teach.css index 0573b8f..e683997 100644 --- a/public/css/teach.css +++ b/public/css/teach.css @@ -84,6 +84,22 @@ body.pen #boardInk{pointer-events:auto; cursor:crosshair;} body.pen.pen-text #boardInk{cursor:text;} body.pen.pen-hand #boardInk{pointer-events:none;} /* hand tool: interact with everything */ + /* ---------- Leerling-omgeving ---------- */ + /* geen whiteboard/tekengereedschap voor leerlingen - alleen wat de leerkracht + heeft toegewezen, als vaste (niet-sleepbare) kaarten in speelmodus */ + #pupilView{display:none;} + body.pupil-mode #board,body.pupil-mode #fab,body.pupil-mode #fabBoardsBtn, + body.pupil-mode #boardStrip,body.pupil-mode #boardsPanel,body.pupil-mode #fabmenu, + body.pupil-mode #hud,body.pupil-mode #btnFolders,body.pupil-mode #btnSave{display:none !important;} + body.pupil-mode #pupilView{ + display:flex; flex-wrap:wrap; gap:18px; align-content:flex-start; + position:absolute; inset:58px 0 0 0; overflow:auto; padding:18px; box-sizing:border-box; + } + #pupilView .pupil-card{ + position:static; max-width:100%; box-shadow:0 6px 20px rgba(30,50,90,.12); + } + .pupil-card .widget-body{width:100%; height:100%;} + .pupil-empty{margin:auto; color:var(--muted); font-size:16px; font-weight:600;} /* floating add-button (FAB) */ #fab{ position:fixed; right:24px; bottom:24px; z-index:5600; width:60px; height:60px; diff --git a/public/index.html b/public/index.html index db59f51..680fbe4 100644 --- a/public/index.html +++ b/public/index.html @@ -31,6 +31,7 @@
+ @@ -166,6 +167,7 @@ +