Files
IOT_SIM/shared/grading.ts
T
xuyueandClaude Opus 5.5 14a82a3e24 AI 评阅:DeepSeek Flash 给老师评分项出建议分和评语,老师采纳后生效
- 学生提交时浏览器给每个窗体截图(运行时同一套 FormWindow 在屏幕外渲染),随提交保存
- 自动评分后进入 AI 评阅队列:按书上评价表给老师评分项打建议分、写评语(JSON 输出,服务器再校验、限制分数);
  发出的内容不含姓名学号;学生代码里像指令的文字一律当作品内容;学生又交了新的只评最新的
- 提示词按教材命名习惯校准("缩写_含义"、书上规定的控件名、界面上不用的标签保留默认名不扣分):
  教材参考答案 28/30,默认控件名且没有注释 15/30
- 评阅页:界面截图标签页、AI 建议卡片(采纳、重新评阅)、全部采纳(不覆盖老师已评的分)、评阅后又提交的提醒;
  成绩表显示"AI 建议,待确认";学生在老师确认前看不到 AI 的建议
- 规范提示移到 shared,服务端组装提示词时也用
- 配置 DEEPSEEK_API_KEY、AI_MODEL;部署说明提醒 NPM 调大请求体上限

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:37:50 +08:00

82 lines
2.4 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
}
// ---------- 作业 ----------
/** 学生的起点: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
}