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:
@@ -18,7 +18,7 @@ if ($method === 'GET') {
|
||||
if (!$class) Response::error('Klasse nicht gefunden', 404);
|
||||
|
||||
$students = $db->fetchAll(
|
||||
'SELECT id, username, display_name, is_anonymous, created_at, last_login FROM students WHERE class_id = ? ORDER BY username',
|
||||
'SELECT id, username, display_name, first_name, last_name, email, emoji_avatar, is_anonymous, easy_language, created_at, last_login FROM students WHERE class_id = ? AND deleted_at IS NULL ORDER BY username',
|
||||
[$classId]
|
||||
);
|
||||
|
||||
@@ -48,10 +48,14 @@ if ($method === 'POST') {
|
||||
$username = mb_substr(trim($body['username'] ?? ''), 0, 64);
|
||||
$password = $body['password'] ?? '';
|
||||
$displayName = mb_substr(trim($body['displayName'] ?? ''), 0, 128);
|
||||
$isAnonymous = (bool)($body['isAnonymous'] ?? true);
|
||||
$firstName = mb_substr(trim($body['firstName'] ?? ''), 0, 64);
|
||||
$lastName = mb_substr(trim($body['lastName'] ?? ''), 0, 64);
|
||||
$email = trim($body['email'] ?? '');
|
||||
$isAnonymous = (bool)($body['isAnonymous'] ?? (!$firstName && !$lastName));
|
||||
|
||||
if (!$classId || !$username || !$password) Response::error('classId, username und password erforderlich');
|
||||
if (strlen($password) < 4) Response::error('Passwort muss mindestens 4 Zeichen lang sein');
|
||||
if ($email && !filter_var($email, FILTER_VALIDATE_EMAIL)) Response::error('Ungültige E-Mail-Adresse');
|
||||
|
||||
// Klasse pruefen
|
||||
$class = $db->fetchOne('SELECT id FROM classes WHERE id = ? AND teacher_id = ?', [$classId, $teacherId]);
|
||||
@@ -63,8 +67,8 @@ if ($method === 'POST') {
|
||||
|
||||
$hash = password_hash($password, PASSWORD_DEFAULT);
|
||||
$db->execute(
|
||||
'INSERT INTO students (class_id, username, password, display_name, is_anonymous) VALUES (?, ?, ?, ?, ?)',
|
||||
[$classId, $username, $hash, $displayName ?: null, $isAnonymous ? 1 : 0]
|
||||
'INSERT INTO students (class_id, username, password, display_name, first_name, last_name, email, is_anonymous) VALUES (?, ?, ?, ?, ?, ?, ?, ?)',
|
||||
[$classId, $username, $hash, $displayName ?: null, $firstName ?: null, $lastName ?: null, $email ?: null, $isAnonymous ? 1 : 0]
|
||||
);
|
||||
Response::ok(['id' => (int)$db->lastInsertId()]);
|
||||
}
|
||||
@@ -110,12 +114,35 @@ if ($method === 'POST') {
|
||||
);
|
||||
if (!$student) Response::error('Schüler nicht gefunden', 404);
|
||||
|
||||
$firstName = mb_substr(trim($body['firstName'] ?? ''), 0, 64);
|
||||
$lastName = mb_substr(trim($body['lastName'] ?? ''), 0, 64);
|
||||
$email = trim($body['email'] ?? '');
|
||||
$emojiAvatar = mb_substr(trim($body['emojiAvatar'] ?? ''), 0, 8);
|
||||
|
||||
if ($displayName) {
|
||||
$db->execute('UPDATE students SET display_name = ? WHERE id = ?', [$displayName, $studentId]);
|
||||
}
|
||||
if ($firstName !== '') {
|
||||
$db->execute('UPDATE students SET first_name = ? WHERE id = ?', [$firstName, $studentId]);
|
||||
}
|
||||
if ($lastName !== '') {
|
||||
$db->execute('UPDATE students SET last_name = ? WHERE id = ?', [$lastName, $studentId]);
|
||||
}
|
||||
if ($email !== '') {
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) Response::error('Ungültige E-Mail-Adresse');
|
||||
$db->execute('UPDATE students SET email = ? WHERE id = ?', [$email, $studentId]);
|
||||
}
|
||||
if ($emojiAvatar !== '') {
|
||||
$db->execute('UPDATE students SET emoji_avatar = ? WHERE id = ?', [$emojiAvatar, $studentId]);
|
||||
}
|
||||
if ($newPassword && strlen($newPassword) >= 4) {
|
||||
$db->execute('UPDATE students SET password = ? WHERE id = ?', [password_hash($newPassword, PASSWORD_DEFAULT), $studentId]);
|
||||
}
|
||||
// Leichte Sprache (nur setzen wenn Feld mitgeschickt)
|
||||
if (array_key_exists('easyLanguage', $body)) {
|
||||
$flag = !empty($body['easyLanguage']) ? 1 : 0;
|
||||
$db->execute('UPDATE students SET easy_language = ? WHERE id = ?', [$flag, $studentId]);
|
||||
}
|
||||
Response::ok();
|
||||
}
|
||||
|
||||
@@ -128,7 +155,7 @@ if ($method === 'POST') {
|
||||
);
|
||||
if (!$student) Response::error('Schüler nicht gefunden', 404);
|
||||
|
||||
$db->execute('DELETE FROM students WHERE id = ?', [$studentId]);
|
||||
$db->execute('UPDATE students SET deleted_at = NOW() WHERE id = ?', [$studentId]);
|
||||
Response::ok();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user