feat: add portable role-based question bank assistant
This commit is contained in:
+3
-3
@@ -121,7 +121,7 @@ function parseCSV(text) {
|
||||
document.querySelector('app-examtest').innerHTML = new DOMParser().parseFromString(html, 'text/html').querySelector('app-examtest').innerHTML;
|
||||
}, { url: practiceURL('缺答案练习'), html: fixture('缺答案练习', { missingAnswer: true }) });
|
||||
await page.waitForTimeout(2600); assert.equal(downloads.length, beforeMissing);
|
||||
assert((await page.locator('#yian-question-bank-exporter').innerText()).includes('缺少 1 个答案'));
|
||||
assert((await page.locator('#yian-question-assistant .page-status').innerText()).includes('缺少 1 个网页答案'));
|
||||
const manual = page.waitForEvent('download'); await page.getByRole('button', { name: '导出 CSV', exact: true }).click();
|
||||
assert((await manual).suggestedFilename().includes('_不完整'));
|
||||
const missing = await page.evaluate(() => QuestionBankCore.extract(document));
|
||||
@@ -134,9 +134,9 @@ function parseCSV(text) {
|
||||
}, { url: practiceURL('缺题练习'), html: fixture('缺题练习', { cardCount: 4 }) });
|
||||
const beforeCount = downloads.length;
|
||||
await page.waitForTimeout(2600); assert.equal(downloads.length, beforeCount);
|
||||
assert((await page.locator('#yian-question-bank-exporter').innerText()).includes('3 / 4'));
|
||||
assert((await page.locator('#yian-question-assistant .page-status').innerText()).includes('3 / 4'));
|
||||
await page.evaluate(() => history.pushState({}, '', location.href.replace('flag=exercise', 'flag=exam')));
|
||||
await page.waitForTimeout(1100); assert.equal(await page.locator('#yian-question-bank-exporter').count(), 0);
|
||||
await page.waitForTimeout(1100); assert(await page.getByRole('button', { name: '导出 CSV', exact: true }).isDisabled());
|
||||
assert.equal(await page.evaluate(() => window.answerClicks), 0);
|
||||
console.log('PASS 缺题等待、考试页面不触发、不改变答题状态');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user