提交 bef3cabc authored 作者: yujiejie's avatar yujiejie

验收评分卡

上级 cdc562e6
......@@ -1525,7 +1525,8 @@ function buildMentorDeployCompletenessNotice(sub) {
// ===== 导师部署验收台:验收参数与测试状态(按学生索引,临时值不改学生原始提交) =====
var mentorDeployReviewState = {
params: {},
tests: {}
tests: {},
scores: {}
};
function getMentorDeployReviewParams(studentId) {
......@@ -2065,6 +2066,95 @@ function buildMentorDeployImageGenItems(sid) {
'</div>';
}
// ===== 导师部署验收台:验收评分(5 项评分,总分最高 100 分,按学生索引) =====
var MENTOR_DEPLOY_SCORE_ITEMS = [
{ key: 'api', label: 'API 可用性', max: 40 },
{ key: 'deployment', label: '部署规范性', max: 20 },
{ key: 'logs', label: '实操日志完整度', max: 15 },
{ key: 'report', label: '实操报告质量', max: 15 },
{ key: 'reflection', label: '问题排查与总结', max: 10 }
];
function getMentorDeployScoreItem(key) {
for (var i = 0; i < MENTOR_DEPLOY_SCORE_ITEMS.length; i++) {
if (MENTOR_DEPLOY_SCORE_ITEMS[i].key === key) return MENTOR_DEPLOY_SCORE_ITEMS[i];
}
return null;
}
function getMentorDeployReviewScores(studentId) {
var sid = Number(studentId);
var sub = getMentorDeploySubmission(sid);
var reviewScore = (sub && sub.review && sub.review.score) || {};
var saved = mentorDeployReviewState.scores[sid] || {};
var scores = {};
var total = 0;
MENTOR_DEPLOY_SCORE_ITEMS.forEach(function(item) {
var raw = saved[item.key] != null ? saved[item.key] : reviewScore[item.key];
var v = 0;
if (raw != null) {
v = parseInt(raw, 10);
if (isNaN(v)) v = 0;
v = Math.max(0, Math.min(item.max, v));
}
scores[item.key] = v;
total += v;
});
scores.total = total;
return scores;
}
function setMentorDeployReviewScore(field, value) {
var sid = Number(mentorState.deployReviewStudentId);
if (!mentorDeployReviewState.scores[sid]) mentorDeployReviewState.scores[sid] = {};
var item = getMentorDeployScoreItem(field);
if (!item) return;
var num = parseInt(value, 10);
if (isNaN(num)) num = 0;
mentorDeployReviewState.scores[sid][field] = Math.max(0, Math.min(item.max, num));
updateMentorDeployScoreTotal();
}
function normalizeMentorDeployScoreInput(field) {
var sid = Number(mentorState.deployReviewStudentId);
var s = getMentorDeployReviewScores(sid);
var input = document.getElementById('mentorDeployScore_' + field);
if (input && String(input.value) !== String(s[field])) input.value = s[field];
}
function updateMentorDeployScoreTotal() {
var sid = Number(mentorState.deployReviewStudentId);
var s = getMentorDeployReviewScores(sid);
var el = document.getElementById('mentorDeployScoreTotal');
if (el) el.textContent = s.total;
}
function buildMentorDeployScoreCard(sid) {
var s = getMentorDeployReviewScores(sid);
var rows = MENTOR_DEPLOY_SCORE_ITEMS.map(function(item) {
return '<div class="flex items-center justify-between py-2">' +
'<span class="text-sm text-[#4E5969]">' + item.label + '</span>' +
'<div class="flex items-center gap-1.5">' +
'<input id="mentorDeployScore_' + item.key + '" type="number" min="0" max="' + item.max + '" class="w-16 input-field text-sm text-center font-mono" value="' + s[item.key] + '" oninput="setMentorDeployReviewScore(\'' + item.key + '\', this.value)" onblur="normalizeMentorDeployScoreInput(\'' + item.key + '\')">' +
'<span class="text-xs text-[#86909C]">/ ' + item.max + ' 分</span>' +
'</div>' +
'</div>';
}).join('');
return '<div class="bg-white rounded-lg border border-[#E5E6EB] p-4 mb-4">' +
'<div class="flex items-center justify-between mb-1"><h3 class="font-semibold text-[#1D2129]">验收评分</h3><span class="text-xs px-2 py-1 rounded bg-[#E8F3FF] text-[#165DFF]">' + s.total + '/100 分</span></div>' +
'<p class="text-xs text-[#86909C] mb-1">按五项维度给分,总分自动计算,最高 100 分。</p>' +
'<div class="divide-y divide-[#F2F3F5]">' + rows + '</div>' +
'<div class="flex items-center justify-between mt-2 pt-3 border-t border-[#E5E6EB]">' +
'<span class="text-sm font-medium text-[#1D2129]">总分</span>' +
'<div class="flex items-baseline gap-1">' +
'<span id="mentorDeployScoreTotal" class="text-xl font-bold ' + (s.total >= 100 ? 'text-emerald-600' : 'text-[#165DFF]') + '">' + s.total + '</span>' +
'<span class="text-sm text-[#86909C]">/ 100 分</span>' +
'</div>' +
'</div>' +
'</div>';
}
function buildMentorDeployConclusionPanel() {
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>' +
......@@ -2078,7 +2168,7 @@ function buildMentorDeployReviewPanel(student) {
var sub = getMentorDeploySubmission(sid);
var taskType = (sub && sub.taskType === 'image-gen') ? 'image-gen' : 'text-model';
var itemsHtml = taskType === 'image-gen' ? buildMentorDeployImageGenItems(sid) : buildMentorDeployTextModelItems(sid);
return buildMentorDeployParamsPanel(sid) + itemsHtml + buildMentorDeployConclusionPanel();
return buildMentorDeployParamsPanel(sid) + itemsHtml + buildMentorDeployScoreCard(sid) + buildMentorDeployConclusionPanel();
}
function reviewDeployArtifact(passed) {
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论