优化批次统计查询并统一评分反馈与复核刷新 #3
@@ -34,6 +34,7 @@ const pageTypeLabel = (value: string) => pageTypeLabels[value] || '未分类页
|
|||||||
const statusLabels: Record<string, string> = { pending: '待评分', scored: '模型已评分', reviewed: '教师已复核', needs_review: '待教师复核', unscorable: '材料缺失或解析失败', failed: '评分失败' };
|
const statusLabels: Record<string, string> = { pending: '待评分', scored: '模型已评分', reviewed: '教师已复核', needs_review: '待教师复核', unscorable: '材料缺失或解析失败', failed: '评分失败' };
|
||||||
const statusLabel = (value: string) => statusLabels[value] || value;
|
const statusLabel = (value: string) => statusLabels[value] || value;
|
||||||
const scoreStatusLabel = (row: any) => {
|
const scoreStatusLabel = (row: any) => {
|
||||||
|
if (row.status_label) return row.status_label;
|
||||||
if (row.status !== 'failed') return statusLabel(row.status);
|
if (row.status !== 'failed') return statusLabel(row.status);
|
||||||
if (/模型证据|target_id|评分项或满分|JSON校验/.test(row.error || '')) return '模型输出校验失败';
|
if (/模型证据|target_id|评分项或满分|JSON校验/.test(row.error || '')) return '模型输出校验失败';
|
||||||
if (/ConnectError|Timeout|Network|连接|超时|HTTP/i.test(row.error || '')) return '模型连接失败';
|
if (/ConnectError|Timeout|Network|连接|超时|HTTP/i.test(row.error || '')) return '模型连接失败';
|
||||||
|
|||||||
@@ -140,12 +140,14 @@ test('failed scoring shows the network error and retry guidance on the page', as
|
|||||||
await page.route('**/api/projects/11/scores?*', route => route.fulfill({ json: {
|
await page.route('**/api/projects/11/scores?*', route => route.fulfill({ json: {
|
||||||
student_no: '9000000001', name: '学生甲', topic: '项目', totals: { overall: null }, facts: {},
|
student_no: '9000000001', name: '学生甲', topic: '项目', totals: { overall: null }, facts: {},
|
||||||
rows: [{ criterion: { criterion_id: 'stage1.problem', category: 'stage1', name: '需求分析', max_score: 25 },
|
rows: [{ criterion: { criterion_id: 'stage1.problem', category: 'stage1', name: '需求分析', max_score: 25 },
|
||||||
status: 'failed', error: 'ConnectError:无法连接模型端点,请检查 Docker 网络、DNS 或代理',
|
status: 'failed', status_label: '模型连接失败',
|
||||||
|
error: '模型请求或JSON校验失败(ConnectError:无法连接模型端点,请检查 Docker 网络、DNS 或代理),已重试2次',
|
||||||
evidence: [], missing_evidence: [], evidence_gaps: [] }],
|
evidence: [], missing_evidence: [], evidence_gaps: [] }],
|
||||||
} }));
|
} }));
|
||||||
await page.goto('/?page=scores&batch_id=71&project_id=11');
|
await page.goto('/?page=scores&batch_id=71&project_id=11');
|
||||||
await expect(page.getByText('当前项目有 1 项评分失败', { exact: true })).toBeVisible();
|
await expect(page.getByText('当前项目有 1 项评分失败', { exact: true })).toBeVisible();
|
||||||
await expect(page.getByText(/ConnectError:无法连接模型端点/)).toBeVisible();
|
await expect(page.getByText(/ConnectError:无法连接模型端点/)).toBeVisible();
|
||||||
|
await expect(page.getByText('模型连接失败', { exact: true })).toBeVisible();
|
||||||
await expect(page.getByText(/已经成功的评分和教师复核会保留/)).toBeVisible();
|
await expect(page.getByText(/已经成功的评分和教师复核会保留/)).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user