文件
edu-content/schemas/qb-1.1.md

51 行
2.6 KiB
Markdown

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

# 题库统一 Schema(qb-1.1)
`qb-1.1` 是 `qb-1.0` 的**向后兼容升级**:保留全部旧字段,仅新增血缘字段。每行一条 JSON(JSONL),一条记录 = 一个**完整任务**(一个语篇 + 若干小题)。
> 升级点(相对 qb-1.0):`source` 对象新增 `source_id`(必填)与 `source_item_id`(可选),指向 `sources/` 登记的根 id。旧字段 `origin`/`file`/`url`/`retrieved` 保留用于迁移期兼容。
## 记录级字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| `schema` | string | ✅ | 固定 `"qb-1.1"` |
| `id` | string | ✅ | 全局唯一 `{考试缩写}-{来源缩写}-{序号4位}` |
| `exam` | string | ✅ | `A2 Key`/`A2 Key for Schools`/`B1 Preliminary`/`B1 Preliminary for Schools` |
| `cefr` | string | ✅ | `A2`/`B1` |
| `paper` | string | ✅ | `reading_writing`/`reading`/`writing`/`listening`/`speaking`/`vocabulary` |
| `part` | int\|null | ✅ | 卷内 Part 号;未标注为 `null` |
| `type` | string | ✅ | 题型枚举(见下表) |
| `task_prompt` | string | ❌ | 完整作答指令 |
| `title` | string\|null | ❌ | 语篇标题 |
| `passage` | string\|null | ❌ | 语篇正文;空格用 `blank_token` 占位 |
| `blank_token` | string | ❌ | 默认 `"_"` |
| `items` | array | ✅ | 小题数组(见 §2) |
| `source` | object | ✅ | **溯源 + 血缘**(见 §3) |
| `license` | string | ✅ | 许可枚举(见 `../LICENSES.md`);对外许可 = 引用 source 的最严格者 |
| `tags` | array | ❌ | 自由标签 |
| `note` | string | ❌ | 备注 |
| `meta` | object | ❌ | 扩展位(音频/图片路径、评分量表引用等) |
## `type` 题型枚举
`mcq`/`matching`/`open_cloze`/`gap_fill`/`word_formation`/`writing_task`/`speaking_prompt`/`word_entry`/`other`(含义与判题方式同 qb-1.0)。
## `source` 对象(§3,含血缘)
```json
{
"source_id": "cepoc", // [新增·必填] 指 sources/ 中的 source id
"source_item_id": "cepoc-ket-json", // [新增·可选] 精确到文件
"origin": "cepoc", // [保留] 旧字段,迁移期兼容
"file": "assets/questions/CEPOC_KET.json",
"url": "https://github.com/CambridgeALTA/cepoc",
"retrieved": "2026-08-21"
}
```
`source_id` 必须存在于 `sources/`;lint 据此校验血缘完整性并推导该记录的对外 `license`。
## 机器校验
`../schemas/qb-1.1.schema.json` 为该格式 JSON Schema。CI 用 `tools/lint_structured.py` 校验:每条记录 `source.source_id` 必须存在、`license` 必须是合法枚举且 = 引用 source 的最严格许可。