Files
012-kaopeilian/docs/规划/dify 工作流/恩喜-02-试题生成器-考陪练.yml
111 998211c483 feat: 初始化考培练系统项目
- 从服务器拉取完整代码
- 按框架规范整理项目结构
- 配置 Drone CI 测试环境部署
- 包含后端(FastAPI)、前端(Vue3)、管理端

技术栈: Vue3 + TypeScript + FastAPI + MySQL
2026-01-24 19:33:28 +08:00

659 lines
22 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
app:
description: 动态生成考试题目
icon: 🤖
icon_background: '#FBE8FF'
mode: workflow
name: 恩喜-02-试题生成器-考陪练
use_icon_as_answer_icon: false
dependencies:
- current_identifier: null
type: marketplace
value:
marketplace_plugin_unique_identifier: langgenius/openrouter:0.0.22@99ef4cf4e08292c28806abaf24f295ed66e04e4b9e74385b487fd0767c7f56df
version: null
kind: app
version: 0.5.0
workflow:
conversation_variables: []
environment_variables: []
features:
file_upload:
allowed_file_extensions:
- .JPG
- .JPEG
- .PNG
- .GIF
- .WEBP
- .SVG
allowed_file_types:
- image
allowed_file_upload_methods:
- local_file
- remote_url
enabled: false
fileUploadConfig:
audio_file_size_limit: 50
batch_count_limit: 5
file_size_limit: 15
image_file_batch_limit: 10
image_file_size_limit: 10
single_chunk_attachment_limit: 10
video_file_size_limit: 100
workflow_file_upload_limit: 10
image:
enabled: false
number_limits: 3
transfer_methods:
- local_file
- remote_url
number_limits: 3
opening_statement: ''
retriever_resource:
enabled: true
sensitive_word_avoidance:
enabled: false
speech_to_text:
enabled: false
suggested_questions: []
suggested_questions_after_answer:
enabled: false
text_to_speech:
enabled: false
language: ''
voice: ''
graph:
edges:
- data:
isInIteration: false
isInLoop: false
sourceType: if-else
targetType: code
id: 1757697174164-false-1759336370957-target
source: '1757697174164'
sourceHandle: 'false'
target: '1759336370957'
targetHandle: target
type: custom
zIndex: 0
- data:
isInLoop: false
sourceType: llm
targetType: end
id: 1759336189971-source-1757522219070-target
source: '1759336189971'
sourceHandle: source
target: '1757522219070'
targetHandle: target
type: custom
zIndex: 0
- data:
isInLoop: false
sourceType: if-else
targetType: llm
id: 1757697174164-true-17593434940720-target
source: '1757697174164'
sourceHandle: 'true'
target: '17593434940720'
targetHandle: target
type: custom
zIndex: 0
- data:
isInLoop: false
sourceType: llm
targetType: end
id: 17593434940720-source-17576978306140-target
source: '17593434940720'
sourceHandle: source
target: '17576978306140'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
isInLoop: false
sourceType: start
targetType: tool
id: 1757517722090-source-1766636474539-target
source: '1757517722090'
sourceHandle: source
target: '1766636474539'
targetHandle: target
type: custom
zIndex: 0
- data:
isInLoop: false
sourceType: tool
targetType: if-else
id: 1766636474539-source-1757697174164-target
source: '1766636474539'
sourceHandle: source
target: '1757697174164'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
isInLoop: false
sourceType: code
targetType: tool
id: 1759336370957-source-1766636566272-target
source: '1759336370957'
sourceHandle: source
target: '1766636566272'
targetHandle: target
type: custom
zIndex: 0
- data:
isInLoop: false
sourceType: tool
targetType: llm
id: 1766636566272-source-1759336189971-target
source: '1766636566272'
sourceHandle: source
target: '1759336189971'
targetHandle: target
type: custom
zIndex: 0
nodes:
- data:
desc: ''
selected: false
title: 开始
type: start
variables:
- default: '1'
label: course_id
max_length: 255
options: []
required: true
type: number
variable: course_id
- default: '1'
hint: ''
label: position_id
max_length: 48
options: []
placeholder: ''
required: true
type: number
variable: position_id
- default: ''
hint: ''
label: mistake_records
max_length: 480000
options: []
placeholder: ''
required: false
type: paragraph
variable: mistake_records
- default: '4'
hint: ''
label: single_choice_count
max_length: 48
options: []
placeholder: ''
required: false
type: number
variable: single_choice_count
- default: '2'
hint: ''
label: multiple_choice_count
max_length: 48
options: []
placeholder: ''
required: false
type: number
variable: multiple_choice_count
- default: '1'
hint: ''
label: true_false_count
max_length: 48
options: []
placeholder: ''
required: false
type: number
variable: true_false_count
- default: '2'
hint: ''
label: fill_blank_count
max_length: 48
options: []
placeholder: ''
required: false
type: number
variable: fill_blank_count
- default: '1'
hint: ''
label: essay_count
max_length: 48
options: []
placeholder: ''
required: false
type: number
variable: essay_count
- default: '3'
hint: ''
label: difficulty_level
max_length: 48
options: []
placeholder: ''
required: false
type: number
variable: difficulty_level
height: 317
id: '1757517722090'
position:
x: 113.18367757866764
y: 380.7254702687234
positionAbsolute:
x: 113.18367757866764
y: 380.7254702687234
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
desc: ''
outputs:
- value_selector:
- '1759336189971'
- text
value_type: string
variable: result
selected: false
title: 结束
type: end
height: 88
id: '1757522219070'
position:
x: 2675.4479082184957
y: 699.3770729563379
positionAbsolute:
x: 2675.4479082184957
y: 699.3770729563379
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
cases:
- case_id: 'true'
conditions:
- comparison_operator: not empty
id: 2b42b816-606a-4753-8494-5451b3d7ab42
value: ''
varType: string
variable_selector:
- '1757517722090'
- mistake_records
id: 'true'
logical_operator: and
desc: ''
selected: false
title: 条件分支
type: if-else
height: 124
id: '1757697174164'
position:
x: 1075.7946800832713
y: 393.17560717622047
positionAbsolute:
x: 1075.7946800832713
y: 393.17560717622047
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
desc: ''
outputs:
- value_selector:
- '17593434940720'
- text
value_type: string
variable: result
selected: false
title: 结束 (1)
type: end
height: 88
id: '17576978306140'
position:
x: 1890.5828711788172
y: 199.92291499877138
positionAbsolute:
x: 1890.5828711788172
y: 199.92291499877138
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
context:
enabled: false
variable_selector: []
model:
completion_params:
exclude_reasoning_tokens: true
response_format: json_object
temperature: 0.7
mode: chat
name: google/gemini-2.5-flash
provider: langgenius/openrouter/openrouter
prompt_template:
- id: df690399-5bed-4567-9b1d-5d31584d65e8
role: system
text: "## 角色\n你是一位经验丰富的考试出题专家能够依据用户提供的知识内容结合用户的岗位特征随机地生成{{#1759336370957.result#}}题考题。你会以专业、严谨且清晰的方式出题。\n\
\n## 输出{{#1757517722090.single_choice_count#}}道单选题\n1、每道题目只能有 1 个正确答案。\n\
2、干扰项要具有合理性和迷惑性且所有选项必须与主题相关。\n3、答案解析要简明扼要说明选择理由。\n4、为每道题记录出题来源的知识点 id。\n\
5、请以 JSON 格式输出。\n6、为每道题输出一个序号。\n\n### 输出结构:\n{\n \"num\": \"题号\",\n\
\ \"type\": \"single_choice\",\n \"topic\": {\n \"title\"\
: \"清晰完整的题目描述\",\n \"options\": {\n \"opt1\": \"A符合语境的选项\"\
,\n \"opt2\": \"B符合语境的选项\",\n \"opt3\": \"C符合语境的选项\"\
,\n \"opt4\": \"D符合语境的选项\"\n }\n },\n \"knowledge_point_id\"\
: \"出题来源知识点的id\",\n \"correct\": \"其中一个选项的全部原文\",\n \"analysis\"\
: \"准确的答案解析,包含选择原因和知识点说明\"\n}\n\n- 严格按照以上格式输出\n\n## 输出{{#1757517722090.multiple_choice_count#}}道多选题\n\
1、每道题目有多个正确答案。\n2、\"type\": \"multiple_choice\"\n3、其它事项同单选题。\n\n## 输出{{#1757517722090.true_false_count#}}道判断题\n\
1、每道题目只有 \"正确\" 或 \"错误\" 两种答案。\n2、题目表述应明确清晰避免歧义。\n3、题目应直接陈述事实或观点便于做出是非判断。\n\
4、其它事项同单选题。\n\n### 输出结构:\n{\n \"num\": \"题号\",\n \"type\": \"true_false\"\
,\n \"topic\": {\n \"title\": \"清晰完整的题目描述\"\n },\n \"\
knowledge_point_id\": \" 出题来源知识点的id\",\n \"correct\": \"正确\", // 或\
\ \"错误\",表示正确答案是对还是错\n \"analysis\": \"准确的答案解析,包含判断原因和知识点说明\"\n}\n\n\
- 严格按照以上格式输出\n\n## 输出{{#1757517722090.fill_blank_count#}}道填空题\n1. 题干应明确完整空缺处需用横线“___”标示且只能有一处空缺\n\
2. 答案应唯一且明确,避免开放性表述\n3. 空缺长度应与答案长度大致匹配\n4. 解析需说明答案依据及相关知识点\n5. 其余要求与单选题一致\n\
\n### 输出结构:\n{\n \"num\": \"题号\",\n \"type\": \"fill_blank\",\n\
\ \"topic\": {\n \"title\": \"包含___空缺的题目描述\"\n },\n \"\
knowledge_point_id\": \"出题来源知识点的id\",\n \"correct\": \"准确的填空答案\",\n\
\ \"analysis\": \"解析答案的依据和相关知识点说明\"\n}\n\n- 严格按照以上格式输出\n\n### 输出{{#1757517722090.essay_count#}}道问答题\n\
1. 问题应具体明确,限定回答范围\n2. 答案需条理清晰,突出核心要点\n3. 解析可补充扩展说明或评分要点\n4. 避免过于宽泛或需要主观发挥的问题\n\
5. 其余要求同单选题\n\n### 输出结构:\n{\n \"num\": \"题号\",\n \"type\": \"essay\"\
,\n \"topic\": {\n \"title\": \"需要详细回答的问题描述\"\n },\n \"\
knowledge_point_id\": \"出题来源知识点的id\",\n \"correct\": \"完整准确的参考答案(分点或连贯表述)\"\
,\n \"analysis\": \"对答案的补充说明、评分要点或相关知识点扩展\"\n}\n\n## 特殊要求\n1. 题目难度:{{#1757517722090.difficulty_level#}}级5\
\ 级为最难)\n2. 避免使用模棱两可的表述\n3. 选项内容要互斥,不能有重叠\n4. 每个选项长度尽量均衡\n5. 正确答案A、B、C、D分布要合理避免规律性\n\
6. 正确答案必须使用其中一个选项中的全部原文,严禁修改\n7. knowledge_point_id 必须是唯一的,即每道题的知识点来源只允许填一个\
\ id。\n\n请按以上要求生成题目确保每道题目质量。"
- id: 9cb9ef44-bbfc-464d-9634-8873babcb6e4
role: user
text: '# 请针对岗位特征、待出题的知识点内容进行出题。
## 岗位信息:
{{#1766636474539.text#}}
---
## 知识点:
{{#1766636566272.text#}}'
selected: false
structured_output_enabled: false
title: 第一轮出题
type: llm
vision:
enabled: false
height: 88
id: '1759336189971'
position:
x: 2233.770517088806
y: 854.8259046963252
positionAbsolute:
x: 2233.770517088806
y: 854.8259046963252
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
code: "from typing import Dict\n\n\ndef main(\n single_choice_count: float,\n\
\ multiple_choice_count: float,\n true_false_count: float,\n fill_blank_count:\
\ float,\n essay_count: float,\n) -> Dict[str, str]:\n total = (\n\
\ single_choice_count\n + multiple_choice_count\n +\
\ true_false_count\n + fill_blank_count\n + essay_count\n\
\ )\n # 将总和转换为字符串类型\n return {\n \"result\": str(total),\n\
\ }\n"
code_language: python3
outputs:
result:
children: null
type: string
selected: false
title: 计算总题量
type: code
variables:
- value_selector:
- '1757517722090'
- single_choice_count
value_type: number
variable: single_choice_count
- value_selector:
- '1757517722090'
- multiple_choice_count
value_type: number
variable: multiple_choice_count
- value_selector:
- '1757517722090'
- true_false_count
value_type: number
variable: true_false_count
- value_selector:
- '1757517722090'
- fill_blank_count
value_type: number
variable: fill_blank_count
- value_selector:
- '1757517722090'
- essay_count
value_type: number
variable: essay_count
height: 52
id: '1759336370957'
position:
x: 1120.8286797224275
y: 773.2970549304636
positionAbsolute:
x: 1120.8286797224275
y: 773.2970549304636
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
context:
enabled: false
variable_selector: []
model:
completion_params:
response_format: json_object
temperature: 0.7
mode: chat
name: google/gemini-2.5-flash
provider: langgenius/openrouter/openrouter
prompt_template:
- id: df690399-5bed-4567-9b1d-5d31584d65e8
role: system
text: "## 角色\n你是一位经验丰富的考试出题专家能够依据用户提供的错题记录重新为用户出题。你会为每道错题重新出一题你会以专业、严谨且清晰的方式出题。\n\
\n## 输出单选题\n1、每道题目只能有 1 个正确答案。\n2、干扰项要具有合理性和迷惑性且所有选项必须与主题相关。\n3、答案解析要简明扼要说明选择理由。\n\
4、为每道题记录出题来源的知识点 id。\n5、请以 JSON 格式输出。\n6、为每道题输出一个序号。\n\n### 输出结构:\n{\n\
\ \"num\": \"题号\",\n \"type\": \"single_choice\",\n \"topic\"\
: {\n \"title\": \"清晰完整的题目描述\",\n \"options\": {\n \
\ \"opt1\": \"A符合语境的选项\",\n \"opt2\": \"B符合语境的选项\"\
,\n \"opt3\": \"C符合语境的选项\",\n \"opt4\": \"D符合语境的选项\"\
\n }\n },\n \"knowledge_point_id\": \"出题来源知识点的id\",\n \
\ \"correct\": \"其中一个选项的全部原文\",\n \"analysis\": \"准确的答案解析,包含选择原因和知识点说明\"\
\n}\n\n- 严格按照以上格式输出\n\n\n## 特殊要求\n1. 题目难度:{{#1757517722090.difficulty_level#}}级5\
\ 级为最难)\n2. 避免使用模棱两可的表述\n3. 选项内容要互斥,不能有重叠\n4. 每个选项长度尽量均衡\n5. 正确答案A、B、C、D分布要合理避免规律性\n\
6. 正确答案必须使用其中一个选项中的全部原文,严禁修改\n7. knowledge_point_id 必须是唯一的,即每道题的知识点来源只允许填一个\
\ id。\n\n请按以上要求生成题目确保每道题目质量。"
- id: 9cb9ef44-bbfc-464d-9634-8873babcb6e4
role: user
text: '## 错题记录:
{{#1757517722090.mistake_records#}}'
selected: false
structured_output_enabled: false
title: 错题重出
type: llm
vision:
enabled: false
height: 88
id: '17593434940720'
position:
x: 1542.474476799452
y: 294.89553593472453
positionAbsolute:
x: 1542.474476799452
y: 294.89553593472453
selected: true
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
is_team_authorization: true
paramSchemas:
- auto_generate: null
default: null
form: llm
human_description:
en_US: ''
ja_JP: ''
pt_BR: ''
zh_Hans: ''
label:
en_US: SQL 语句
ja_JP: SQL 语句
pt_BR: SQL 语句
zh_Hans: SQL 语句
llm_description: ''
max: null
min: null
name: sql
options: []
placeholder:
en_US: ''
ja_JP: ''
pt_BR: ''
zh_Hans: ''
precision: null
required: true
scope: null
template: null
type: string
params:
sql: ''
plugin_id: null
plugin_unique_identifier: null
provider_icon:
background: '#FFEAD5'
content: 🤖
provider_id: 2e7e915c-606c-4230-b4bd-ff95efb72f39
provider_name: 恩喜-00-SQL 执行器-考陪练专用
provider_type: workflow
selected: false
title: 恩喜-00-查询岗位
tool_configurations: {}
tool_description: 考陪练系统专用的 sql 执行器
tool_label: 恩喜-00-SQL 执行器-考陪练专用
tool_name: SQL_executor_enxi
tool_node_version: '2'
tool_parameters:
sql:
type: mixed
value: SELECT id, name, description, skills, level FROM positions WHERE
id = 1 AND is_deleted = FALSE
type: tool
height: 52
id: '1766636474539'
position:
x: 680.6972117920154
y: 459.1566958608885
positionAbsolute:
x: 680.6972117920154
y: 459.1566958608885
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
is_team_authorization: true
paramSchemas:
- auto_generate: null
default: null
form: llm
human_description:
en_US: ''
ja_JP: ''
pt_BR: ''
zh_Hans: ''
label:
en_US: SQL 语句
ja_JP: SQL 语句
pt_BR: SQL 语句
zh_Hans: SQL 语句
llm_description: ''
max: null
min: null
name: sql
options: []
placeholder:
en_US: ''
ja_JP: ''
pt_BR: ''
zh_Hans: ''
precision: null
required: true
scope: null
template: null
type: string
params:
sql: ''
plugin_id: null
plugin_unique_identifier: null
provider_icon:
background: '#FFEAD5'
content: 🤖
provider_id: 2e7e915c-606c-4230-b4bd-ff95efb72f39
provider_name: 恩喜-00-SQL 执行器-考陪练专用
provider_type: workflow
selected: false
title: 恩喜-00-查询知识点
tool_configurations: {}
tool_description: 考陪练系统专用的 sql 执行器
tool_label: 恩喜-00-SQL 执行器-考陪练专用
tool_name: SQL_executor_enxi
tool_node_version: '2'
tool_parameters:
sql:
type: mixed
value: SELECT kp.id, kp.name, kp.description, kp.topic_relation FROM knowledge_points
kp INNER JOIN course_materials cm ON kp.material_id = cm.id WHERE kp.course_id
= {{#1757517722090.course_id#}} AND kp.is_deleted = FALSE AND cm.is_deleted
= FALSE ORDER BY RAND() LIMIT {{#1759336370957.result#}}
type: tool
height: 52
id: '1766636566272'
position:
x: 1751.0251613776625
y: 1090.0135783943633
positionAbsolute:
x: 1751.0251613776625
y: 1090.0135783943633
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
viewport:
x: 208.8157315753573
y: 57.80270447312665
zoom: 0.3556496204015805
rag_pipeline_variables: []