任务说明补齐 23 份;设计器支持窗体改名

- 其余 21 个实验的 task.md:控件名照示例代码,"在平台上怎么试"和评分步骤一致,列出书上的印刷错误和控件名不一致
- 窗体改名:属性窗口里选中窗体可以改名称,类名、构造函数、new X()、Program.cs 和两个文件名一起改;方法名和字符串不变
- 11 个主窗体不叫 Form1 的实验,任务说明提示先改窗体名再双击生成 Load 事件
- 测试:表头只认分隔行上面那一行,数据行里出现"名称"不再被当成表头

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-26 13:55:39 +08:00
1 parent 90b739a2c7
commit d4b8bf9241
29 files changed
+1236 -31

No files matched your search

+5 -2
View File
@@ -6,15 +6,18 @@ import { listSamples, loadSample, loadTask } from '../src/samples'
function tableNames(task: string): string[] {
const names: string[] = []
let column = -1
let previous: string[] = []
for (const line of task.split('\n')) {
if (!line.trim().startsWith('|')) {
column = -1
previous = []
continue
}
const cells = line.trim().replace(/^\||\|$/g, '').split('|')
const header = cells.findIndex((c) => c.includes('名称'))
if (header >= 0) column = header
// 表头是分隔行(|---|)上面那一行;数据行里出现"名称"两个字不算表头
if (cells.every((c) => /^\s*:?-+:?\s*$/.test(c))) column = previous.findIndex((c) => c.includes('名称'))
else if (column >= 0) names.push(...[...(cells[column] ?? '').matchAll(/`([^`]+)`/g)].map((m) => m[1]))
previous = cells
}
return names
}