chore: add start.sh script

This commit is contained in:
jocay
2026-08-10 00:15:44 +08:00
parent 4ef6b8af05
commit 5b66404698
7 changed files with 1134 additions and 684 deletions
+2 -31
View File
@@ -15,34 +15,5 @@ console.log('总题数:', total);
if (bad.length) { console.log('问题:'); bad.forEach(b => console.log(' -', b)); }
else console.log('结构校验全部通过');
const checks = [
['Dart 开发实战', 'var x = 10', 1],
['Dart 开发实战', 'orders = 60', 1],
['Dart 开发实战', 'remove(3)', 0],
['Dart 开发实战', '不存在的 key', 1],
['Dart 开发实战', 'if (isVip) 3', 0],
['Dart 开发实战', 'reduce((a, b)', 1],
['Dart 开发实战', 'factory 构造函数', 0],
['Dart 开发实战', 'mixin', 2],
['Dart 开发实战', 's!', 1],
['Dart 开发实战', 'late String token', 0],
['Flutter 开发实战', 'runApp(MyApp())', 0],
['Flutter 开发实战', 'crossAxisAlignment', 0],
['Flutter 开发实战', 'TextOverflow.ellipsis', 0],
['Flutter 开发实战', 'RefreshIndicator', 0],
['Flutter 开发实战', 'Navigator.pop(context, result)', 0],
['Flutter 开发实战', 'jsonDecode(text)', 0],
['Flutter 开发实战', '.timeout(Duration', 0],
['Flutter 开发实战', 'cacheWidth', 0],
['Flutter 开发实战', 'RichText', 0],
['Flutter 开发实战', 'dispose()', 0]
];
let fail = 0;
for (const [setName, keyword, expect] of checks) {
const set = d.sets.find(s => s.name === setName);
const q = set.questions.find(x => (x.q + x.opts.join('') + x.exp).includes(keyword));
if (!q) { console.log('✗ 未找到题:', setName, keyword); fail++; continue; }
const ok = q.ans === expect;
if (!ok) { console.log(`✗ [${setName}] ${keyword} → ans=${q.ans} 期望 ${expect},正确选项内容: "${q.opts[q.ans]}"`); fail++; }
}
console.log(fail ? `抽查 ${checks.length} 题,${fail} 题不符` : `抽查 ${checks.length} 道关键题答案全部正确`);
// 抽查逻辑已移除,因为选项顺序已被随机打乱