Spaces:
Running
Running
make student-management.html functional
Browse files125 unmodified lines12612712812913013112 unmodified lines1441451461471481491509 unmodified lines1601611621631641651661673 unmodified lines1711721731741751761774 unmodified lines1821831841851861873 unmodified lines19119219319419519619712 unmodified lines2102112122132142152162172182192203 unmodified lines224225226227228229230125 unmodified lines<script src="config.js"></script><script src="student-data.js"></script><script>// Tab switchingdocument.getElementById('add-tab').addEventListener('click', function() {document.getElementById('add-form').classList.remove('hidden');12 unmodified linesdocument.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 removaldocument.getElementById('remove-class').addEventListener('change', loadStudentsForRemoval);document.getElementById('remove-form-select').addEventListener('change', loadStudentsForRemoval);9 unmodified linesif (classVal && formVal) {const key = `${classVal}-${formVal}`;if (students[key]) {students[key].forEach(student => {const option = document.createElement('option');option.value = student;option.textContent = student;3 unmodified lines}}}// Add studentdocument.getElementById('add-student-btn').addEventListener('click', function() {const className = document.getElementById('add-class').value;4 unmodified linesalert('Please enter student name');return;}// Add student to storageconst success = addStudent(className, formVal, studentName);3 unmodified lines}// Clear form and show successdocument.getElementById('student-name').value = '';document.getElementById('add-success').classList.remove('hidden');// Hide success after 3 seconds12 unmodified linesalert('Please select a student to remove');return;}// Remove student from storageremoveStudent(className, formVal, studentName);// Reload students dropdownloadStudentsForRemoval();// Show successdocument.getElementById('remove-success').classList.remove('hidden');3 unmodified linesdocument.getElementById('remove-success').classList.add('hidden');}, 3000);});// Load student dataconst students = getStudentsData();// Form 1'BUDI-1': [125 unmodified lines12612712812913013113213313413512 unmodified lines1481491501511521539 unmodified lines1631641651661671681691701711723 unmodified lines1761771781791801814 unmodified lines1861871881891901911923 unmodified lines19619719819920020120212 unmodified lines2152162172182192202212222232242252262272282292302313 unmodified lines235236237238239240241125 unmodified lines<script src="config.js"></script><script src="student-data.js"></script><script>// Initialize student datainitializeStudentsData();const studentsData = getStudentsData();// Tab switchingdocument.getElementById('add-tab').addEventListener('click', function() {document.getElementById('add-form').classList.remove('hidden');12 unmodified linesdocument.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 removaldocument.getElementById('remove-class').addEventListener('change', loadStudentsForRemoval);document.getElementById('remove-form-select').addEventListener('change', loadStudentsForRemoval);9 unmodified linesif (classVal && formVal) {const key = `${classVal}-${formVal}`;const students = getStudents(classVal, formVal);if (students.length > 0) {students.forEach(student => {const option = document.createElement('option');option.value = student;option.textContent = student;3 unmodified lines}}}// Add studentdocument.getElementById('add-student-btn').addEventListener('click', function() {const className = document.getElementById('add-class').value;4 unmodified linesalert('Please enter student name');return;}// Add student to storageconst success = addStudent(className, formVal, studentName);3 unmodified lines}// Clear form and show successdocument.getElementById('student-name').value = '';document.getElementById('add-success').classList.remove('hidden');// Hide success after 3 seconds12 unmodified linesalert('Please select a student to remove');return;}// Remove student from storageconst success = removeStudent(className, formVal, studentName);if (!success) {alert('Failed to remove student. Please try again.');return;}// Reload students dropdownloadStudentsForRemoval();// Show successdocument.getElementById('remove-success').classList.remove('hidden');3 unmodified linesdocument.getElementById('remove-success').classList.add('hidden');}, 3000);});// Load student dataconst students = getStudentsData();// Form 1'BUDI-1': [
student-management.html+19-8