提交 943cd4a7 authored 作者: yujiejie's avatar yujiejie

821步骤十一完成

上级 807688ef
......@@ -148,8 +148,6 @@ var mentorState = {
review: {
round: 1,
status: '已驳回',
artifactStatus: '通过',
reportStatus: '驳回',
comment: '服务未能成功启动,日志显示 CUDA 显存不足导致模型加载中断。请检查实例配置,调整 gpu-memory-utilization 参数或更换更高显存实例后重新部署并提交。',
reviewedAt: '2026-07-20 17:40',
notifiedAt: '2026-07-20 17:40'
......@@ -1760,8 +1758,7 @@ var mentorDeployReviewState = {
tests: {}, // [taskKey][sid] -> { models, chat | genSubmit | genStatus }
scores: {}, // [taskKey][sid] -> { api, deployment, logs, report, reflection }
comments: {}, // [taskKey][sid] -> string
decision: {}, // [taskKey][sid] -> '通过' | '待补充' | '驳回'(草稿,步骤 11 启用)
partStatus: {} // 分项验收结论草稿:partStatus[sid] = { artifact: '通过'|'驳回'|'待补充', report: '...' }(保留至步骤 11 删除)
conclusion: {} // 整体验收结论草稿:conclusion[sid] = '通过' | '驳回' | '待补充'
};
// 返回验收台状态中指定容器在当前任务维度的「学生 map」,自动初始化中间层级
......@@ -2521,83 +2518,57 @@ function setMentorDeployReviewComment(value) {
map[sid] = value;
}
// ===== 导师部署验收台:分项验收结论(产物 / 报告分别给结论)=====
// ===== 导师部署验收台:整体结论(通过 / 驳回 / 待补充)+ 评语 =====
// 结论草稿基于 mentorDeployReviewState.conclusion[sid] 存储,提交后写回 sub.review.status
function getMentorDeployPartReviewStatus(studentId, part) {
var sid = Number(studentId);
function getMentorDeployReviewConclusion(sid) {
if (mentorDeployReviewState.conclusion && mentorDeployReviewState.conclusion[sid]) {
return mentorDeployReviewState.conclusion[sid];
}
var sub = getMentorDeploySubmission(sid);
var review = (sub && sub.review) || {};
var draft = mentorDeployReviewState.partStatus[sid] || {};
var key = part === 'report' ? 'reportStatus' : 'artifactStatus';
if (draft[part]) return draft[part];
if (review[key]) return review[key];
var status = review.status || '';
if (status === '已通过') return '通过';
if (status === '已驳回') return '驳回';
if (status === '待补充') return '待补充';
return '';
}
function setMentorDeployPartReviewStatus(part, value) {
function setMentorDeployReviewConclusion(value) {
var sid = Number(mentorState.deployReviewStudentId);
if (!mentorDeployReviewState.partStatus[sid]) mentorDeployReviewState.partStatus[sid] = {};
var draft = mentorDeployReviewState.partStatus[sid];
if (draft[part] === value) {
delete draft[part];
if (!mentorDeployReviewState.conclusion) mentorDeployReviewState.conclusion = {};
if (mentorDeployReviewState.conclusion[sid] === value) {
delete mentorDeployReviewState.conclusion[sid];
} else {
draft[part] = value;
mentorDeployReviewState.conclusion[sid] = value;
}
renderContent();
}
function getMentorDeployOverallStatus(artifactStatus, reportStatus) {
if (artifactStatus === '驳回' || reportStatus === '驳回') return '已驳回';
if (artifactStatus === '待补充' || reportStatus === '待补充') return '待补充';
if (artifactStatus === '通过' && reportStatus === '通过') return '已通过';
return '';
}
function buildMentorDeployPartConclusionRow(part, label, current) {
function buildMentorDeployConclusionPanel(sid) {
var comment = getMentorDeployReviewComment(sid);
var current = getMentorDeployReviewConclusion(sid);
var opts = ['通过', '驳回', '待补充'];
var map = { '通过': 'bg-emerald-100 text-emerald-700 border-emerald-200', '驳回': 'bg-rose-100 text-rose-700 border-rose-200', '待补充': 'bg-violet-100 text-violet-700 border-violet-200' };
var btns = opts.map(function(opt) {
var active = opt === current;
return '<button type="button" class="flex-1 px-2 py-1.5 text-xs font-medium rounded-lg border transition-all ' +
(active ? map[opt] : 'bg-[#F7F8FA] text-[#86909C] border-[#E5E6EB] hover:border-[#165DFF]') +
'" onclick="setMentorDeployPartReviewStatus(\'' + part + '\', \'' + opt + '\')">' + opt + '</button>';
'" onclick="setMentorDeployReviewConclusion(\'' + opt + '\')">' + opt + '</button>';
}).join('');
return '<div class="mb-3">' +
'<div class="text-xs font-medium text-[#4E5969] mb-1.5">' + label + '</div>' +
'<div class="flex gap-2">' + btns + '</div>' +
'</div>';
}
function getMentorDeployPartStatusLabel(s) {
if (!s) return '未给出';
return s;
}
function getMentorDeployPartStatusBadge(s) {
if (s === '通过') return 'bg-emerald-100 text-emerald-700';
if (s === '驳回') return 'bg-rose-100 text-rose-700';
if (s === '待补充') return 'bg-violet-100 text-violet-700';
return 'bg-[#F2F3F5] text-[#86909C]';
}
function buildMentorDeployConclusionPanel(sid) {
var comment = getMentorDeployReviewComment(sid);
var artifactStatus = getMentorDeployPartReviewStatus(sid, 'artifact');
var reportStatus = getMentorDeployPartReviewStatus(sid, 'report');
var overallStatus = getMentorDeployOverallStatus(artifactStatus, reportStatus);
var hasDecision = !!(artifactStatus || reportStatus);
return '<div class="bg-white rounded-lg border border-[#E5E6EB] p-4">' +
'<div class="flex items-center justify-between mb-3"><h3 class="font-semibold text-[#1D2129]">验收结论</h3><span class="text-xs px-2 py-1 rounded bg-[#F2F3F5] text-[#86909C]">分项给出结论</span></div>' +
buildMentorDeployPartConclusionRow('artifact', '部署产物验收', artifactStatus) +
buildMentorDeployPartConclusionRow('report', '实操报告验收', reportStatus) +
(hasDecision ? '<div class="mb-3 p-2 rounded bg-[#F7F8FA] text-xs text-[#4E5969] flex items-center justify-between"><span>综合结论</span><span class="px-2 py-0.5 rounded text-xs font-medium ' + getMentorDeployPartStatusBadge(overallStatus) + '">' + (overallStatus || '部分结论未给出') + '</span></div>' : '') +
'<div class="flex items-center justify-between mb-3"><h3 class="font-semibold text-[#1D2129]">验收结论</h3><span class="text-xs px-2 py-1 rounded bg-[#F2F3F5] text-[#86909C]">整体结论</span></div>' +
'<div class="mb-4">' +
'<div class="text-xs font-medium text-[#4E5969] mb-1.5">整体结论(通过 / 驳回 / 待补充)</div>' +
'<div class="flex gap-2">' + btns + '</div>' +
'</div>' +
'<div class="mb-4">' +
'<label class="text-xs font-medium text-[#4E5969] block mb-1">导师评语</label>' +
'<textarea id="deployReviewComment" class="input-field text-sm min-h-[110px] resize-none" placeholder="请填写验收结论、发现的问题、修改建议、补充材料要求或后续学习建议…" oninput="setMentorDeployReviewComment(this.value)">' + mentorDeployReviewEsc(comment) + '</textarea>' +
'<p class="text-xs text-[#86909C] mt-1">有驳回或要求补充材料时评语必填。</p>' +
'</div>' +
'<button class="w-full py-2.5 text-sm font-medium rounded-lg bg-[#165DFF] hover:bg-[#4080FF] text-white transition-all" onclick="submitMentorDeployReview()">提交验收结论并通知学生</button>' +
'<p class="text-xs text-[#86909C] mt-2 leading-relaxed">提交前请先为产物和报告分别给出结论(通过 / 驳回 / 待补充),然后填写评语。</p>' +
'<p class="text-xs text-[#86909C] mt-2 leading-relaxed">请先选择整体结论,然后填写评语,最后点击提交。</p>' +
'</div>';
}
......@@ -2609,19 +2580,14 @@ function buildMentorDeployLockedReviewPanel(sid) {
var tests = review.tests || {};
var taskType = getMentorDeployTaskKey(sid);
var testSummaryHtml = buildMentorDeployReviewTestsSummary(tests, taskType);
var artifactStatus = review.artifactStatus || '';
var reportStatus = review.reportStatus || '';
var status = review.status || '';
return '<div class="bg-white rounded-lg border border-[#E5E6EB] p-4 mb-4">' +
'<div class="flex items-center justify-between mb-3">' +
'<h3 class="font-semibold text-[#1D2129]">本轮验收记录</h3>' +
'<span class="text-xs px-2 py-1 rounded bg-[#F2F3F5] text-[#86909C]">第 ' + round + ' 轮 · 只读</span>' +
'</div>' +
'<div class="rounded-lg bg-[#F7F8FA] p-4 mb-3">' +
'<div class="flex items-center justify-between"><div class="text-xs text-[#86909C]">综合状态</div><span class="text-sm font-medium px-2.5 py-1 rounded ' + getMentorDeployStatusBadge(review.status || '待验收') + '">' + mentorDeployReviewEsc(review.status || '待验收') + '</span></div>' +
'<div class="grid grid-cols-2 gap-2 mt-3">' +
'<div class="p-2 rounded bg-white"><div class="text-xs text-[#86909C]">部署产物</div><span class="text-xs px-2 py-0.5 rounded mt-1 inline-block ' + getMentorDeployPartStatusBadge(artifactStatus) + '">' + (artifactStatus || '—') + '</span></div>' +
'<div class="p-2 rounded bg-white"><div class="text-xs text-[#86909C]">实操报告</div><span class="text-xs px-2 py-0.5 rounded mt-1 inline-block ' + getMentorDeployPartStatusBadge(reportStatus) + '">' + (reportStatus || '—') + '</span></div>' +
'</div>' +
'<div class="flex items-center justify-between"><div class="text-xs text-[#86909C]">验收结论</div><span class="text-sm font-medium px-2.5 py-1 rounded ' + getMentorDeployStatusBadge(status || '待验收') + '">' + mentorDeployReviewEsc(status || '待验收') + '</span></div>' +
'<div class="grid grid-cols-2 gap-2 mt-3 text-xs">' +
'<div class="text-[#86909C]">提交时间:<span class="text-[#4E5969]">' + mentorDeployReviewEsc(review.reviewedAt || '—') + '</span></div>' +
'<div class="text-[#86909C]">通知时间:<span class="text-[#4E5969]">' + mentorDeployReviewEsc(review.notifiedAt || '—') + '</span></div>' +
......@@ -2680,7 +2646,7 @@ function buildMentorDeployReviewHistoryHtml(sid) {
var rows = history.map(function(h) {
return '<div class="p-3 rounded bg-[#F7F8FA] mb-2">' +
'<div class="flex items-center justify-between"><span class="text-xs text-[#86909C]">第 ' + (h.round || 1) + ' 轮</span><span class="text-xs px-2 py-0.5 rounded ' + getMentorDeployStatusBadge(h.status || '—') + '">' + mentorDeployReviewEsc(h.status || '—') + '</span></div>' +
'<div class="grid grid-cols-2 gap-2 mt-2 text-xs text-[#86909C]"><span>产物:<span class="text-[#4E5969]">' + (h.artifactStatus || '—') + '</span></span><span>报告:<span class="text-[#4E5969]">' + (h.reportStatus || '—') + '</span></span></div>' +
'<div class="text-xs text-[#86909C] mt-1">结论:<span class="text-[#4E5969]">' + mentorDeployReviewEsc(h.status || '—') + '</span>' + (h.score && h.score.total != null ? ' · 评分:<span class="text-[#4E5969]">' + h.score.total + '/100 分</span>' : '') + '</div>' +
'<div class="text-xs text-[#86909C] mt-1">' + mentorDeployReviewEsc(h.reviewedAt || '') + (h.notifiedAt ? ' · 通知 ' + mentorDeployReviewEsc(h.notifiedAt) : '') + '</div>' +
'</div>';
}).join('');
......@@ -2727,36 +2693,35 @@ function submitMentorDeployReview() {
}
var comment = getMentorDeployReviewComment(sid).trim();
var scores = getMentorDeployReviewScores(sid);
var artifactStatus = getMentorDeployPartReviewStatus(sid, 'artifact');
var reportStatus = getMentorDeployPartReviewStatus(sid, 'report');
var overallStatus = getMentorDeployOverallStatus(artifactStatus, reportStatus);
var conclusion = getMentorDeployReviewConclusion(sid);
var overallStatus = conclusion === '通过' ? '已通过' : (conclusion === '驳回' ? '已驳回' : conclusion); // 待补充 → 待补充
var titleMap = { '已通过': '已通过验收', '已驳回': '已驳回', '待补充': '已要求补充材料' };
var title = titleMap[overallStatus] || '已提交验收结论';
if (!artifactStatus && !reportStatus) {
showStudentFlowModal('请先给出分项结论', '请分别选择部署产物和实操报告的验收结论(通过 / 驳回 / 待补充)。');
if (!conclusion) {
showStudentFlowModal('请先选择整体结论', '请选择整体验收结论(通过 / 驳回 / 待补充)。');
return;
}
// 分项「通过」校验:材料必须已提交;产物通过还需关键 API 测试全部通过
if (artifactStatus === '通过') {
// 通过校验:产物与报告都必须已提交,且关键 API 测试全部通过
if (conclusion === '通过') {
if (!sub.artifactSubmitted) {
showStudentFlowModal('产物不能判定通过', '该学生尚未提交部署产物,请将产物结论改为「驳回」或「待补充」。');
showStudentFlowModal('无法判定通过', '该学生尚未提交部署产物,不能判定为「通过」,请改为「驳回」或「待补充」。');
return;
}
if (!sub.reportSubmitted) {
showStudentFlowModal('无法判定通过', '该学生尚未提交实操报告,不能判定为「通过」,请改为「驳回」或「待补充」。');
return;
}
var missing = getMentorDeployMissingApiTests(sid);
if (missing.length) {
showStudentFlowModal('产物通过前请先完成关键 API 测试', '通过前必须完成并全部通过以下关键验收项:' + missing.join('、') + '。');
showStudentFlowModal('通过前请先完成关键 API 测试', '通过前必须完成并全部通过以下关键验收项:' + missing.join('、') + '。');
return;
}
}
if (reportStatus === '通过' && !sub.reportSubmitted) {
showStudentFlowModal('报告不能判定通过', '该学生尚未提交实操报告,请将报告结论改为「驳回」或「待补充」。');
return;
}
// 有驳回 / 待补充时评语必填
if ((artifactStatus === '驳回' || artifactStatus === '待补充' || reportStatus === '驳回' || reportStatus === '待补充') && !comment) {
// 驳回 / 待补充时评语必填
if ((conclusion === '驳回' || conclusion === '待补充') && !comment) {
showStudentFlowModal('请填写导师评语', '有驳回或要求补充材料时,评语必须填写,说明存在的问题与修改建议。');
return;
}
......@@ -2765,8 +2730,6 @@ function submitMentorDeployReview() {
var reviewedAt = getMentorDeployNowTimestamp();
sub.review.round = (parseInt(sub.review.round, 10) || 0) + 1;
sub.review.status = overallStatus;
sub.review.artifactStatus = artifactStatus;
sub.review.reportStatus = reportStatus;
sub.review.comment = comment;
sub.review.score = scores;
sub.review.reviewedAt = reviewedAt;
......@@ -2775,8 +2738,8 @@ function submitMentorDeployReview() {
// 快照本轮 API 测试结果与验收参数,避免学生重提或导师重新测试影响历史验收记录
sub.review.tests = JSON.parse(JSON.stringify(getMentorDeployReviewNode('tests', sid)[sid] || {}));
sub.review.params = JSON.parse(JSON.stringify(getMentorDeployReviewNode('params', sid)[sid] || {}));
// 清空本轮分项草稿,避免下次切换学生时残留
if (mentorDeployReviewState.partStatus) mentorDeployReviewState.partStatus[sid] = {};
// 清空本轮整体结论草稿,避免下次切换学生时残留
if (mentorDeployReviewState.conclusion) delete mentorDeployReviewState.conclusion[sid];
// 同步到 studentState(全局学生数据)
if (typeof studentState !== 'undefined') {
......@@ -2786,15 +2749,11 @@ function submitMentorDeployReview() {
studentState.deployReviewRound = sub.review.round;
studentState.deployReviewUpdatedAt = reviewedAt;
studentState.deployReviewNotifiedAt = reviewedAt;
studentState.deployArtifactReviewStatus = artifactStatus;
studentState.deployReportReviewStatus = reportStatus;
studentState.deployPassed = (overallStatus === '已通过');
studentState.deployRejected = (overallStatus === '已驳回');
// 分项重置:只有被驳回 / 待补充的部分才重置提交状态,已通过的部分保留
if (artifactStatus === '驳回' || artifactStatus === '待补充') {
// 被驳回 / 待补充时重置提交状态,让学生可重新提交
if (conclusion === '驳回' || conclusion === '待补充') {
studentState.deployArtifactSubmitted = false;
}
if (reportStatus === '驳回' || reportStatus === '待补充') {
studentState.deployReportSubmitted = false;
}
studentState.deploySubmitted = !!(studentState.deployArtifactSubmitted && studentState.deployReportSubmitted);
......@@ -2803,18 +2762,15 @@ function submitMentorDeployReview() {
// 通知学生(本地模拟)
if (typeof studentState !== 'undefined') {
if (!studentState.notifications) studentState.notifications = [];
var partDesc = '部署产物:' + (artifactStatus || '未给出') + ';实操报告:' + (reportStatus || '未给出');
var message = overallStatus === '已通过'
? ('你的部署验收已通过。' + partDesc + ',本次评分 ' + scores.total + '/100 分。')
: ('你的部署验收需要处理。' + partDesc + (comment ? ',评语:' + comment : ''));
? ('你的部署验收已通过,本次评分 ' + scores.total + '/100 分。')
: ('你的部署验收需要处理(结论:' + conclusion + ')。' + (comment ? '评语:' + comment : ''));
studentState.notifications.unshift({
id: 'deploy-' + sid + '-' + reviewedAt.replace(/[^0-9]/g, ''),
type: 'deploy-review',
studentId: sid,
round: sub.review.round,
status: overallStatus,
artifactStatus: artifactStatus,
reportStatus: reportStatus,
title: title,
message: message,
createdAt: reviewedAt,
......@@ -2826,7 +2782,7 @@ function submitMentorDeployReview() {
var msg = overallStatus === '已通过'
? '已通知学生查看验收结果,本次评分 ' + scores.total + '/100 分。'
: (overallStatus === '已驳回'
? '已通知学生,被驳回的部分需要修改后重新提交。'
? '已通知学生,需要修改后重新提交。'
: '已通知学生,按补充要求补交材料后重新提交。');
showStudentFlowModal(title, msg);
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论