Spaces:
Running
Running
make student-management.html functional
Browse files125 unmodified lines12612712812913013113213313413512 unmodified lines1481491501471511521539 unmodified lines1631641651661671631641681691701711723 unmodified lines1761771781741791801814 unmodified lines1861871881891901911923 unmodified lines19619719819419920020120212 unmodified lines2152162172182192142202212222232242252262272172282292302313 unmodified lines235236237227238239240241125 unmodified lines <script src="config.js"></script> <script src="student-data.js"></script> <script> // Initialize student data initializeStudentsData(); const studentsData = getStudentsData();
// Tab switchingdocument.getElementById('add-tab').addEventListener('click', function() { document.getElementById('add-form').classList.remove('hidden');12 unmodified lines document.getElementById('add-tab').classList.add('text-gray-500'); document.getElementById('add-tab').classList.remove('text-blue-600', 'border-blue-600'); });
// Load students when class/form changes for removal document.getElementById('remove-class').addEventListener('change', loadStudentsForRemoval); document.getElementById('remove-form-select').addEventListener('change', loadStudentsForRemoval);9 unmodified lines if (classVal && formVal) { const key = `${classVal}-${formVal}`; const students = getStudents(classVal, formVal); if (students[key]) { students[key].forEach(student => { if (students.length > 0) { students.forEach(student => { const option = document.createElement('option'); option.value = student; option.textContent = student;3 unmodified lines } } }
// Add student document.getElementById('add-student-btn').addEventListener('click', function() { const className = document.getElementById('add-class').value;4 unmodified lines alert('Please enter student name'); return; }
// Add student to storage const success = addStudent(className, formVal, studentName); 3 unmodified lines } // Clear form and show successdocument.getElementById('student-name').value = ''; document.getElementById('student-name').value = ''; document.getElementById('add-success').classList.remove('hidden'); // Hide success after 3 seconds12 unmodified lines alert('Please select a student to remove'); return; }
// Remove student from storage removeStudent(className, formVal, studentName); const success = removeStudent(className, formVal, studentName);
if (!success) { alert('Failed to remove student. Please try again.'); return; }
// Reload students dropdownloadStudentsForRemoval(); loadStudentsForRemoval(); // Show success document.getElementById('remove-success').classList.remove('hidden');3 unmodified lines document.getElementById('remove-success').classList.add('hidden'); }, 3000); }); // Load student data// Load student data const students = getStudentsData();// Form 1 'BUDI-1': [student-management.html+19-8