Atlas: Infrastruktur + Team-Konventionen + Sprachregel Lernarbeit
- Design-System (assets/css/design-system.css) mit 21 Komponenten, iPad-Responsive-Breakpoints, Touch-Ziele 36px, Music-Player, Glossar-Tooltips - Templates (sims/template.html + student/teacher-Dashboard) - Docs: module-interface.md (inkl. 4a Sprachregel, 4b Leichte Sprache, 4c iPad), content-architecture.md, crash-recovery.md, music-registry.md - Admin-Infrastruktur: admin-modules.html + api/admin-modules.php (Titel, Emoji, Bild, Status, Dauer, Alter pro Modul) - Inbox-System: _inbox/README.md + _status.md fuer Atlas + Briefings an Klima, Glossar, Lehrplan, Fluss - Zentrale SFX-Pipeline (scripts/generate-sounds.py) - DALL-E-Bilder: 8 Badges + 5 Glossar-Repraesentationsbilder (Querformat) - Logo + Inter-Font lokal - PHP-APIs: admin, glossar, levels, licenses, progress, waypoints, assignments, profile, tickets - Spielsprache entfernt (admin-modules, admin-levels, schueler) - Landing-Page-Bearbeitungen (Boote sichtbarer, Button-Hintergrund) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,13 +11,13 @@ $db = Database::get();
|
||||
if ($method === 'GET') {
|
||||
$teacherId = Session::requireTeacher();
|
||||
$classes = $db->fetchAll(
|
||||
'SELECT id, name, school_year, join_code, created_at FROM classes WHERE teacher_id = ? ORDER BY created_at DESC',
|
||||
'SELECT id, name, school_year, join_code, created_at FROM classes WHERE teacher_id = ? AND deleted_at IS NULL ORDER BY created_at DESC',
|
||||
[$teacherId]
|
||||
);
|
||||
// Schueleranzahl pro Klasse
|
||||
foreach ($classes as &$c) {
|
||||
$c['student_count'] = (int)$db->fetchOne(
|
||||
'SELECT COUNT(*) as cnt FROM students WHERE class_id = ?', [$c['id']]
|
||||
'SELECT COUNT(*) as cnt FROM students WHERE class_id = ? AND deleted_at IS NULL', [$c['id']]
|
||||
)['cnt'];
|
||||
}
|
||||
Response::ok($classes);
|
||||
@@ -64,13 +64,14 @@ if ($method === 'POST') {
|
||||
Response::ok();
|
||||
}
|
||||
|
||||
// === KLASSE LOESCHEN ===
|
||||
// === KLASSE LOESCHEN (Soft-Delete, Schüler*innen werden Autodidakten) ===
|
||||
if ($action === 'delete') {
|
||||
$classId = (int)($body['classId'] ?? 0);
|
||||
$class = $db->fetchOne('SELECT id FROM classes WHERE id = ? AND teacher_id = ?', [$classId, $teacherId]);
|
||||
if (!$class) Response::error('Klasse nicht gefunden', 404);
|
||||
|
||||
$db->execute('DELETE FROM classes WHERE id = ?', [$classId]);
|
||||
// Schüler*innen werden zu Autodidakten (class_id bleibt für Referenz, aber Klasse ist gelöscht)
|
||||
$db->execute('UPDATE classes SET deleted_at = NOW() WHERE id = ?', [$classId]);
|
||||
Response::ok();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user