""" BreakPilot Studio - Notenbuch (Gradebook) Modul Funktionen: - Notenübersicht pro Klasse/Schüler - Noteneingabe für verschiedene Prüfungsarten - Durchschnittsberechnung - Trend-Analyse - Export nach Excel/PDF - Integration mit Zeugnissen """ class GradebookModule: """Modul fuer digitale Notenverwaltung.""" @staticmethod def get_css() -> str: """CSS fuer das Gradebook-Modul.""" return """ /* ============================================= GRADEBOOK MODULE - Notenbuch ============================================= */ /* Panel Layout */ .panel-gradebook { display: none; flex-direction: column; height: 100%; background: var(--bp-bg); overflow: hidden; } .panel-gradebook.active { display: flex; } /* Header */ .gradebook-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 32px; border-bottom: 1px solid var(--bp-border); background: var(--bp-surface); } .gradebook-title-section h1 { font-size: 24px; font-weight: 700; color: var(--bp-text); margin-bottom: 4px; } .gradebook-subtitle { font-size: 14px; color: var(--bp-text-muted); } .gradebook-actions { display: flex; gap: 12px; } /* Filter Bar */ .gradebook-filters { display: flex; gap: 16px; padding: 16px 32px; background: var(--bp-surface-elevated); border-bottom: 1px solid var(--bp-border); flex-wrap: wrap; align-items: center; } .filter-group { display: flex; flex-direction: column; gap: 4px; } .filter-group label { font-size: 12px; color: var(--bp-text-muted); font-weight: 500; } .filter-group select, .filter-group input { padding: 8px 12px; border: 1px solid var(--bp-border); border-radius: 8px; background: var(--bp-surface); color: var(--bp-text); font-size: 13px; min-width: 150px; } .filter-group select:focus, .filter-group input:focus { outline: none; border-color: var(--bp-primary); } /* Content Layout */ .gradebook-content { flex: 1; overflow: auto; padding: 24px 32px; } /* Grade Table */ .gradebook-table-container { background: var(--bp-surface); border-radius: 12px; border: 1px solid var(--bp-border); overflow: hidden; } .gradebook-table { width: 100%; border-collapse: collapse; font-size: 13px; } .gradebook-table thead { background: var(--bp-surface-elevated); position: sticky; top: 0; z-index: 10; } .gradebook-table th { padding: 12px 16px; text-align: left; font-weight: 600; color: var(--bp-text); border-bottom: 2px solid var(--bp-border); white-space: nowrap; } .gradebook-table th.grade-column { text-align: center; min-width: 80px; } .gradebook-table th.average-column { text-align: center; background: var(--bp-primary-soft); } .gradebook-table tbody tr { border-bottom: 1px solid var(--bp-border); transition: background 0.2s; } .gradebook-table tbody tr:hover { background: var(--bp-surface-elevated); } .gradebook-table td { padding: 12px 16px; color: var(--bp-text); } .gradebook-table td.grade-cell { text-align: center; } .gradebook-table td.average-cell { text-align: center; font-weight: 600; background: var(--bp-primary-soft); } /* Student Name Column */ .student-name { display: flex; align-items: center; gap: 12px; } .student-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bp-primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; } .student-info { display: flex; flex-direction: column; } .student-info .name { font-weight: 500; } .student-info .class { font-size: 11px; color: var(--bp-text-muted); } /* Grade Input */ .grade-input { width: 50px; padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; background: var(--bp-surface); color: var(--bp-text); text-align: center; font-size: 14px; font-weight: 500; transition: all 0.2s; } .grade-input:hover { border-color: var(--bp-border); } .grade-input:focus { outline: none; border-color: var(--bp-primary); background: var(--bp-surface-elevated); } /* Grade Colors */ .grade-1 { color: #22c55e; } .grade-2 { color: #84cc16; } .grade-3 { color: #eab308; } .grade-4 { color: #f97316; } .grade-5 { color: #ef4444; } .grade-6 { color: #dc2626; } .grade-badge { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; font-weight: 600; font-size: 14px; } .grade-badge.grade-1 { background: rgba(34, 197, 94, 0.15); } .grade-badge.grade-2 { background: rgba(132, 204, 22, 0.15); } .grade-badge.grade-3 { background: rgba(234, 179, 8, 0.15); } .grade-badge.grade-4 { background: rgba(249, 115, 22, 0.15); } .grade-badge.grade-5 { background: rgba(239, 68, 68, 0.15); } .grade-badge.grade-6 { background: rgba(220, 38, 38, 0.15); } /* Trend Indicator */ .trend-indicator { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; margin-left: 8px; } .trend-up { color: var(--bp-success); } .trend-down { color: var(--bp-danger); } .trend-stable { color: var(--bp-text-muted); } /* Statistics Panel */ .gradebook-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; } .stat-card { background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 12px; padding: 20px; } .stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; } .stat-card .stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; } .stat-card .stat-icon.green { background: rgba(34, 197, 94, 0.15); color: #22c55e; } .stat-card .stat-icon.yellow { background: rgba(234, 179, 8, 0.15); color: #eab308; } .stat-card .stat-icon.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; } .stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--bp-text); margin-bottom: 4px; } .stat-card .stat-label { font-size: 13px; color: var(--bp-text-muted); } /* Add Grade Modal */ .add-grade-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); display: none; align-items: center; justify-content: center; z-index: 1000; } .add-grade-modal.active { display: flex; } .add-grade-content { background: var(--bp-surface); border-radius: 16px; padding: 24px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; } .add-grade-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; } .add-grade-header h2 { font-size: 18px; font-weight: 600; } .add-grade-form { display: flex; flex-direction: column; gap: 16px; } .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .form-group { display: flex; flex-direction: column; gap: 6px; } .form-group label { font-size: 13px; font-weight: 500; color: var(--bp-text-muted); } .form-group input, .form-group select, .form-group textarea { padding: 10px 12px; border: 1px solid var(--bp-border); border-radius: 8px; background: var(--bp-surface-elevated); color: var(--bp-text); font-size: 14px; } .form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--bp-primary); } .form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; } /* Exam Types */ .exam-type-selector { display: flex; gap: 8px; flex-wrap: wrap; } .exam-type-btn { padding: 8px 16px; border: 1px solid var(--bp-border); border-radius: 20px; background: var(--bp-surface); color: var(--bp-text-muted); font-size: 13px; cursor: pointer; transition: all 0.2s; } .exam-type-btn:hover { border-color: var(--bp-primary); color: var(--bp-text); } .exam-type-btn.active { background: var(--bp-primary); border-color: var(--bp-primary); color: white; } /* Chart Container */ .gradebook-chart { background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 12px; padding: 20px; margin-bottom: 24px; } .gradebook-chart h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; } .chart-placeholder { height: 200px; background: var(--bp-surface-elevated); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--bp-text-muted); } /* Responsive */ @media (max-width: 768px) { .gradebook-filters { flex-direction: column; align-items: stretch; } .filter-group { width: 100%; } .filter-group select { width: 100%; } .form-row { grid-template-columns: 1fr; } .gradebook-stats { grid-template-columns: 1fr; } } /* Print Styles */ @media print { .gradebook-header, .gradebook-filters, .gradebook-actions, .add-grade-modal { display: none !important; } .gradebook-content { padding: 0; } .gradebook-table { font-size: 11px; } } """ @staticmethod def get_html() -> str: """HTML fuer das Gradebook-Panel.""" return """

Notenbuch

Notenübersicht und -verwaltung
📊
2.4
Klassendurchschnitt
24
Schüler bestanden
📝
8
Leistungsnachweise
⚠️
3
Gefährdete Schüler

Notenverteilung

Hier wird das Notenverteilungsdiagramm angezeigt
Schüler/in Klausur 1 Test 1 Klausur 2 Mündlich Test 2 Schnitt Trend

Note eintragen

""" @staticmethod def get_js() -> str: """JavaScript fuer das Gradebook-Modul.""" return """ // ============================================= // GRADEBOOK MODULE - JavaScript // ============================================= // Sample data (in production: from API) const gradebookData = { students: [ { id: 1, name: 'Anna Beispiel', class: '5a', grades: { k1: 2, t1: 1, k2: 2, m: 2, t2: 2 }, avg: 1.8 }, { id: 2, name: 'Ben Schmidt', class: '5a', grades: { k1: 3, t1: 3, k2: 3, m: 2, t2: 3 }, avg: 2.8 }, { id: 3, name: 'Clara Weber', class: '5a', grades: { k1: 1, t1: 2, k2: 1, m: 1, t2: 1 }, avg: 1.2 }, { id: 4, name: 'David Müller', class: '5a', grades: { k1: 4, t1: 4, k2: 5, m: 3, t2: 4 }, avg: 4.0 }, { id: 5, name: 'Emma Fischer', class: '5a', grades: { k1: 2, t1: 2, k2: 2, m: 2, t2: 2 }, avg: 2.0 }, { id: 6, name: 'Felix Wagner', class: '5a', grades: { k1: 3, t1: 2, k2: 3, m: 3, t2: 2 }, avg: 2.6 }, { id: 7, name: 'Greta Hoffmann', class: '5a', grades: { k1: 1, t1: 1, k2: 1, m: 2, t2: 1 }, avg: 1.2 }, { id: 8, name: 'Hans Bauer', class: '5a', grades: { k1: 5, t1: 4, k2: 5, m: 4, t2: 5 }, avg: 4.6 }, ] }; // Initialize Gradebook function initGradebook() { loadGradebook(); initExamTypeSelector(); setTodayDate(); populateStudentSelect(); } // Load Gradebook Data function loadGradebook() { const tbody = document.getElementById('gradebook-tbody'); if (!tbody) return; tbody.innerHTML = ''; gradebookData.students.forEach(student => { const row = createStudentRow(student); tbody.appendChild(row); }); updateStatistics(); } // Create Student Row function createStudentRow(student) { const row = document.createElement('tr'); // Get initials const initials = student.name.split(' ').map(n => n[0]).join(''); // Calculate trend const grades = Object.values(student.grades); const recent = grades.slice(-2); const trend = recent.length >= 2 ? (recent[1] < recent[0] ? 'up' : recent[1] > recent[0] ? 'down' : 'stable') : 'stable'; const trendIcon = trend === 'up' ? '↑' : trend === 'down' ? '↓' : '→'; const trendClass = trend === 'up' ? 'trend-up' : trend === 'down' ? 'trend-down' : 'trend-stable'; row.innerHTML = `
${initials}
${student.name} ${student.class}
${student.grades.k1} ${student.grades.t1} ${student.grades.k2} ${student.grades.m} ${student.grades.t2} ${student.avg.toFixed(1)} ${trendIcon} `; return row; } // Update Statistics function updateStatistics() { const students = gradebookData.students; const averages = students.map(s => s.avg); const classAvg = (averages.reduce((a, b) => a + b, 0) / averages.length).toFixed(1); const passed = students.filter(s => s.avg <= 4.0).length; const warning = students.filter(s => s.avg > 4.0).length; document.getElementById('stat-average').textContent = classAvg; document.getElementById('stat-passed').textContent = passed; document.getElementById('stat-warning').textContent = warning; } // Exam Type Selector function initExamTypeSelector() { const buttons = document.querySelectorAll('.exam-type-btn'); buttons.forEach(btn => { btn.addEventListener('click', () => { buttons.forEach(b => b.classList.remove('active')); btn.classList.add('active'); }); }); } // Set Today's Date function setTodayDate() { const dateInput = document.getElementById('grade-date'); if (dateInput) { dateInput.value = new Date().toISOString().split('T')[0]; } } // Populate Student Select function populateStudentSelect() { const select = document.getElementById('grade-student'); if (!select) return; select.innerHTML = ''; gradebookData.students.forEach(student => { const option = document.createElement('option'); option.value = student.id; option.textContent = `${student.name} (${student.class})`; select.appendChild(option); }); } // Open Add Grade Modal function openAddGradeModal() { const modal = document.getElementById('add-grade-modal'); if (modal) { modal.classList.add('active'); setTodayDate(); } } // Close Add Grade Modal function closeAddGradeModal() { const modal = document.getElementById('add-grade-modal'); if (modal) { modal.classList.remove('active'); } } // Save Grade function saveGrade(event) { event.preventDefault(); const studentId = document.getElementById('grade-student').value; const subject = document.getElementById('grade-subject').value; const grade = document.getElementById('grade-value').value; const date = document.getElementById('grade-date').value; const weight = document.getElementById('grade-weight').value; const comment = document.getElementById('grade-comment').value; const examType = document.querySelector('.exam-type-btn.active')?.dataset.type || 'klausur'; // In production: API call console.log('Saving grade:', { studentId, subject, grade, date, weight, comment, examType }); // Show success message alert('Note wurde gespeichert!'); closeAddGradeModal(); // Reload table loadGradebook(); } // Export Gradebook function exportGradebook() { const format = prompt('Export-Format wählen (excel/pdf/csv):', 'excel'); if (format) { // In production: API call to generate export console.log('Exporting gradebook as:', format); alert(`Export als ${format.toUpperCase()} wird erstellt...`); } } // Initialize on panel activation document.addEventListener('DOMContentLoaded', () => { // Check if gradebook panel is active const panel = document.getElementById('panel-gradebook'); if (panel && panel.classList.contains('active')) { initGradebook(); } }); // Also initialize when panel becomes active const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.type === 'attributes' && mutation.attributeName === 'class') { const panel = document.getElementById('panel-gradebook'); if (panel && panel.classList.contains('active')) { initGradebook(); } } }); }); const gradebookPanel = document.getElementById('panel-gradebook'); if (gradebookPanel) { observer.observe(gradebookPanel, { attributes: true }); } """