ingest_question
Insert a new question into the question bank with subject, type, difficulty, and stem text; handles duplication via external key or stem hash.
Instructions
录一道题入库(事务多表),归属当前登录 teacher。返回 {ok, question_id, created, import_source, batch_id}。
free_tags: 自由标签 → biz_free_tag 字典 + biz_question_free_tag 关联(三件套之一,检索锚)。
参数(NOT NULL=必填): subject_id : 科目锚 level1(年级根,如 数学七上 的根 id),NOT NULL question_type: 字典 biz_question_type 1选择/2判断/3应用/4填空/5解答/6作图/7计算/8证明,NOT NULL difficult : 1基础/2提升/3压轴,NOT NULL stem_text : 纯文本题干(全文检索 + 去重 hash),NOT NULL block_json : 来自 format_question 的 blockJson(三端渲染);空则只存 stem_text answer_text / analyze_text: 答案 / 解析文本 knowledge_ids: 锚知识点叶子 [{kpId, isPrimary, source, confidence}](KG 关联,供组卷/举一反三召回) images : 题图 [{ossUrl, assetId, role, ...}](来自 upload_image) external_key: 幂等键(book+节+课时+题号),去重;空则按 stem_text hash 去重 status : '0'草稿 / '1'发布(默认发布) import_source: 双管道来源标记;空则自动打 "mcp-<角色>"(MCP 机录,与手工/其他管道可区分) import_batch_id: 录入批次号;空则自动生成 mcp-YYYYMMDD-HHMMSS-4位随机 🔴 双管道语义:不带 "mcp-" 前缀的 import_source(main/手工导入/'举一反三'引擎…)= 其他/手工管道。 异常: 底座报错 → {ok:false, reason}(不假成功)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| images | No | ||
| status | No | 1 | |
| difficult | Yes | ||
| exam_year | No | ||
| free_tags | No | ||
| stem_text | Yes | ||
| block_json | No | ||
| source_raw | No | ||
| subject_id | Yes | ||
| answer_text | No | ||
| region_code | No | ||
| source_type | No | ||
| analyze_text | No | ||
| external_key | No | ||
| import_source | No | ||
| knowledge_ids | No | ||
| question_type | Yes | ||
| import_batch_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||