/** * 班级操行分管理系统 - 作业管理页JS * * 开发者: Canglan * 版权归属: Sea Network Technology Studio * * 版权所有 © Sea Network Technology Studio */ (function() { 'use strict'; const hwRole = window.PAGE_CONFIG.role; // 初始化扣分配置 const hwMaxPoints = hwRole === '班主任' ? 100 : 5; const hwNotSubmit = window.DEDUCTION_HOMEWORK_NOT_SUBMIT || 2; const hwLate = window.DEDUCTION_HOMEWORK_LATE || 1; // 更新页面中的配置值显示 document.querySelectorAll('.hw-not-submit').forEach(el => el.textContent = hwNotSubmit); document.querySelectorAll('.hw-late').forEach(el => el.textContent = hwLate); document.querySelectorAll('.hw-max').forEach(el => el.textContent = hwMaxPoints); // 更新输入框的 min/max document.getElementById('pointsChange').setAttribute('min', -hwMaxPoints); document.getElementById('pointsChange').setAttribute('max', hwMaxPoints); // 加载科目列表(学习委员) async function loadSubjectsForHomework() { if (hwRole !== '学习委员') return; const subjectSelect = document.getElementById('hwSubjectSelect'); if (!subjectSelect) return; const res = await apiGet('/api/subject/list'); if (res && res.success && res.data && res.data.subjects) { let html = ''; res.data.subjects.forEach(s => { html += ``; }); subjectSelect.innerHTML = html; } } async function loadStudents() { const res = await apiGet('/api/admin/students', {page_size: 1000}); if (res && res.success) { let html = ''; res.data.students.forEach(student => { html += `