已完成“成绩管理与学业档案”模块:

教师批量录入平时、期中、期末成绩。
自动计算总评、绩点和及格状态。
支持缺考、缓考、免修。
教师提交 → 学院审核/退回 → 校级发布。
学生只能查看正式发布成绩。
自动统计平均分、完成度、及格率和加权 GPA。
SQLite 本地增量升级和 MySQL 正式迁移均已完成。
分级权限在前后端同时校验。
This commit is contained in:
2026-07-24 15:33:47 +08:00 Unverified
parent 151a22554f
commit af52e27a3a
18 changed files with 3686 additions and 22 deletions
+91
View File
@@ -222,6 +222,94 @@ try {
throw 'Course-selection roster did not include the selected student.'
}
$gradeTasks = Invoke-RestMethod `
-Uri 'http://localhost:5255/api/grades/sheets' `
-Headers $headers
$gradeTask = @($gradeTasks) |
Where-Object { $null -ne $_.sheet } |
Select-Object -First 1
if ($null -eq $gradeTask) {
throw 'Development grade sheet was not seeded.'
}
$gradeDetail = Invoke-RestMethod `
-Uri "http://localhost:5255/api/grades/sheets/$($gradeTask.sheet.id)" `
-Headers $headers
if (@($gradeDetail.sheet.records).Count -lt 1) {
throw 'Development grade sheet has no student records.'
}
$teacherLoginBody = @{
userName = 'teacher'
password = 'Teacher@123456'
} | ConvertTo-Json
$teacherLogin = Invoke-RestMethod `
-Method Post `
-Uri 'http://localhost:5255/api/auth/login' `
-ContentType 'application/json' `
-Body $teacherLoginBody
$teacherHeaders = @{ Authorization = "Bearer $($teacherLogin.token)" }
$teacherGradeTasks = Invoke-RestMethod `
-Uri 'http://localhost:5255/api/grades/sheets' `
-Headers $teacherHeaders
$teacherGradeTask = @($teacherGradeTasks) |
Where-Object { $_.id -eq $gradeTask.id } |
Select-Object -First 1
if ($null -eq $teacherGradeTask) {
throw 'Assigned teacher cannot access the grade sheet.'
}
if ($teacherGradeTask.sheet.status -eq 'Draft' -or
$teacherGradeTask.sheet.status -eq 'Returned') {
Invoke-RestMethod `
-Method Post `
-Uri "http://localhost:5255/api/grades/sheets/$($teacherGradeTask.sheet.id)/submit" `
-Headers $teacherHeaders |
Out-Null
}
$collegeLoginBody = @{
userName = 'college'
password = 'College@123456'
} | ConvertTo-Json
$collegeLogin = Invoke-RestMethod `
-Method Post `
-Uri 'http://localhost:5255/api/auth/login' `
-ContentType 'application/json' `
-Body $collegeLoginBody
$collegeHeaders = @{ Authorization = "Bearer $($collegeLogin.token)" }
$collegeGradeTasks = Invoke-RestMethod `
-Uri 'http://localhost:5255/api/grades/sheets' `
-Headers $collegeHeaders
$collegeGradeTask = @($collegeGradeTasks) |
Where-Object { $_.id -eq $gradeTask.id } |
Select-Object -First 1
if ($collegeGradeTask.sheet.status -eq 'Submitted') {
Invoke-RestMethod `
-Method Post `
-Uri "http://localhost:5255/api/grades/sheets/$($collegeGradeTask.sheet.id)/approve" `
-Headers $collegeHeaders |
Out-Null
}
$adminGradeTasks = Invoke-RestMethod `
-Uri 'http://localhost:5255/api/grades/sheets' `
-Headers $headers
$adminGradeTask = @($adminGradeTasks) |
Where-Object { $_.id -eq $gradeTask.id } |
Select-Object -First 1
if ($adminGradeTask.sheet.status -eq 'Approved') {
Invoke-RestMethod `
-Method Post `
-Uri "http://localhost:5255/api/grades/sheets/$($adminGradeTask.sheet.id)/publish" `
-Headers $headers |
Out-Null
}
$studentTranscript = Invoke-RestMethod `
-Uri 'http://localhost:5255/api/grades/student/transcript' `
-Headers $studentHeaders
if (@($studentTranscript.records).Count -lt 1) {
throw 'Published grade is not visible in the student transcript.'
}
$frontend = Invoke-WebRequest -Uri 'http://localhost:5255/' -TimeoutSec 5
$spaFallback = Invoke-WebRequest -Uri 'http://localhost:5255/base-data' -TimeoutSec 5
$unknownApiParameters = @{
@@ -250,6 +338,9 @@ try {
SelectionOfferings = @($selectionOfferings).Count
StudentEnrollments = $activeEnrollments.Count
RosterStudents = $selectionRoster.enrolledCount
GradeSheets = @($gradeTasks).Count
GradeRecords = @($gradeDetail.sheet.records).Count
TranscriptRecords = @($studentTranscript.records).Count
AccessUpdate = $true
ScopeChecks = $scopeChecks -join ', '
StaticIndex = $frontend.Content.Contains('明序教务管理系统')