Files
IOT_SIM/shared/grading.ts
T
xuyueandClaude Opus 5.5 f256b313f7 实验页"评价项"和自测:提交前自己检查,不计分
- 工具栏"评价项"打开侧栏,列出自动检查的功能项(作业显示布置时的规则和各项分值)
- "自己检查"在服务器上按评分规则运行学生现在的程序,逐项显示通过与否和原因;不计分、不留记录,
  自由练习和作业都能用;每人同时一次,结果保留到下一次,之后改过代码提示结果可能过时;
  和提交评分共用全站并发上限
- 实验的评价项接口学生也能用(老师布置作业的对话框改用它)
- 修正:运行区的窗体和"放大"按钮会盖住网页的抽屉和对话框

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:35:25 +08:00

91 lines
2.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 自动评分的结果:服务器给学生程序逐项检查后返回,学生提交后立即能看到。
export interface CheckResult {
/** 检查项名称,对应书上评价表的功能项,如"能实时显示入侵数据" */
title: string
passed: boolean
/** 不通过的原因:期望看到什么、实际是什么 */
message?: string
}
export interface GradeResult {
/** 编译没通过时所有项都不通过 */
compiled: boolean
results: CheckResult[]
/** 评分用时(毫秒) */
ms: number
}
/** 自测(提交前自己跑一遍评分,不计分、不留记录):每人同时一次,结果保留到下一次自测 */
export interface SelfCheck {
status: 'running' | 'done' | 'error'
/** 检查的是哪个实验或作业(结果只对同一个显示) */
target: string
result: GradeResult | null
startedAt: number
}
// ---------- 作业 ----------
/** 学生的起点:blank 空白工程(从界面做起),ui 界面已做好(只写代码) */
export type StartMode = 'blank' | 'ui'
/** 分值:自动评分项按规则顺序各自的分值;老师评分项(界面、注释、命名等)由老师打分 */
export interface Scoring {
auto: number[]
manual: { title: string; points: number }[]
}
export interface Assignment {
id: number
classId: number
className: string
sampleId: string
title: string
startMode: StartMode
/** 截止时间(毫秒时间戳),null 表示不限 */
deadline: number | null
createdAt: number
/** 自动评分项的名称,和 scoring.auto 一一对应 */
checkTitles: string[]
scoring: Scoring
}
export interface Submission {
id: number
status: 'pending' | 'done' | 'error'
result: GradeResult | null
/** 自动评分得分(通过的项的分值之和) */
autoScore: number | null
createdAt: number
/** 排队评分时前面还有几份 */
queueAhead?: number
}
/** 老师评阅:老师评分项各自的得分(null 表示还没打分,和 scoring.manual 一一对应)和评语 */
export interface Review {
scores: (number | null)[]
comment: string
updatedAt: number
}
/** 提交时浏览器截的窗体图(PNG 的 base64,不含 data: 前缀) */
export interface Screenshot {
form: string
png: string
}
/**
* AI 评阅:老师评分项的建议分(和 scoring.manual 一一对应)、理由和给学生的评语。
* 只是建议,老师采纳(或修改后保存)才成为老师评分。
* status:pending 排队中;done 已评;error 出错;skipped 学生又交了新的,这份不评了
*/
export interface AiReview {
status: 'pending' | 'done' | 'error' | 'skipped'
scores: { score: number; reason: string }[]
comment: string
error?: string
model?: string
at?: number
}