feat: filter grading items by review and failure status
This commit is contained in:
@@ -183,6 +183,38 @@ test('output validation and insufficient evidence are not presented as network f
|
||||
await expect(page.getByText(/缺少或尚不足以支撑判断的目标:计划/)).toBeVisible();
|
||||
});
|
||||
|
||||
test('score filters isolate actionable rows without hiding zero grades or changing data', async ({ page }) => {
|
||||
await setup(page);
|
||||
const writes: string[] = [];
|
||||
page.on('request', request => { if (request.method() !== 'GET') writes.push(request.url()); });
|
||||
await page.route('**/api/projects/11/scores?*', route => route.fulfill({ json: {
|
||||
student_no: '9000000001', name: '学生甲', topic: '项目', totals: { overall: null }, facts: {},
|
||||
rows: ['scored', 'reviewed', 'needs_review', 'failed', 'unscorable'].map((status, i) => ({
|
||||
criterion: { criterion_id: `stage1.${i}`, category: 'stage1', name: `测试项目${i}`, max_score: 20 },
|
||||
status, model_score: status === 'scored' ? 0 : null, teacher_score: status === 'reviewed' ? 0 : null,
|
||||
final_score: ['scored', 'reviewed'].includes(status) ? 0 : null,
|
||||
error: status === 'failed' ? '模型证据未能匹配检索原文' : '', evidence: [],
|
||||
})),
|
||||
} }));
|
||||
await page.goto('/?page=scores&batch_id=71&project_id=11');
|
||||
await expect(page.getByText('已评分 1 项 · 教师已复核 1 项 · 待处理 3 项', { exact: true })).toBeVisible();
|
||||
const rows = page.getByRole('row').filter({ hasText: '测试项目' });
|
||||
await expect(rows).toHaveCount(5);
|
||||
for (const [option, count, name] of [
|
||||
['仅待处理(3)', 3, '测试项目2'], ['仅待教师复核(1)', 1, '测试项目2'],
|
||||
['仅评分失败(1)', 1, '测试项目3'], ['仅材料异常(1)', 1, '测试项目4'],
|
||||
['全部评分项(5)', 5, '测试项目0'],
|
||||
] as const) {
|
||||
await page.keyboard.press('Escape');
|
||||
await expect(page.locator('.ant-select-dropdown:visible')).toHaveCount(0);
|
||||
await choose(page, '评分项筛选', option);
|
||||
await expect(rows).toHaveCount(count);
|
||||
await expect(page.getByRole('row').filter({ hasText: name })).toBeVisible();
|
||||
}
|
||||
await expect(page.getByRole('row').filter({ hasText: '测试项目0' })).toContainText('0 / 20');
|
||||
expect(writes).toEqual([]);
|
||||
});
|
||||
|
||||
test('a slow project list keeps the student specified in a multi-project batch link', async ({ page }) => {
|
||||
const state = await setup(page);
|
||||
await page.route('**/api/scoring-batches', route => route.fulfill({ json: [{
|
||||
|
||||
Reference in New Issue
Block a user