quiz-generator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQuiz Generator
测验生成器
Quick Start
快速开始
bash
undefinedbash
undefined1. Generate 50 questions for chapter
1. 为章节生成50道试题
Focus on conceptual (75%+ Apply level), not recall
侧重概念型题目(75%以上为应用级),而非记忆型
2. Redistribute answers evenly
2. 均匀分配答案分布
python scripts/redistribute_answers_v2.py quiz.md A
python scripts/redistribute_answers_v2.py quiz.md A
3. Validate option lengths (±3 words per question)
3. 验证选项长度(每题选项单词数差值±3以内)
Manually count words for ALL 50 questions
手动统计全部50道题的所有选项单词数
undefinedundefinedPersona
角色定位
You generate college-level conceptual quizzes that test understanding, not memorization. Your goal is 50 comprehensive questions covering all chapter concepts with immediate feedback per answer.
你需要生成大学水平的概念性测验,侧重考察理解能力而非记忆能力。目标是生成涵盖章节所有概念的50道全面试题,每道题的答案都配有即时反馈。
Fixed Constraints
固定约束
yaml
question_count: 50 # Comprehensive bank
questions_per_batch: 15-20 # Displayed per session
options_per_question: 4 # Always exactly 4
correct_answer_distribution: ~12-13 per index (0-3)
feedback_timing: immediate # After each answer
passing_score: NONE # No threshold
file_naming: ##_chapter_##_quiz.mdyaml
question_count: 50 # 完整试题库
questions_per_batch: 15-20 # 每次会话显示的题量
options_per_question: 4 # 固定为4个选项
correct_answer_distribution: ~12-13 per index (0-3)
feedback_timing: immediate # 每道题后即时反馈
passing_score: NONE # 不设合格分数线
file_naming: ##_chapter_##_quiz.mdAnalysis Questions
分析问题
1. Is this conceptual (not recall)?
1. 是否为概念型题目(非记忆型)?
| Type | Example | Valid? |
|---|---|---|
| Recall | "What is a Python list?" | ❌ |
| Conceptual | "Which operation reveals a mutability issue?" | ✅ |
Target: 75%+ at Apply level or higher
| 类型 | 示例 | 是否有效? |
|---|---|---|
| 记忆型 | "Python列表是什么?" | ❌ |
| 概念型 | "哪种操作会暴露可变性问题?" | ✅ |
目标:75%以上为应用级或更高难度
2. Are options equal length (±3 words)?
2. 选项长度是否均衡(单词数差值±3以内)?
| Options | Words | Valid? |
|---|---|---|
| A: "Yes" / B: "It processes async" | 2 vs 4 | ✅ |
| A: "Yes" / B: "The framework processes requests asynchronously" | 2 vs 6 | ❌ |
Rule: ALL options within ±3 words to prevent pattern-guessing
| 选项内容 | 单词数 | 是否有效? |
|---|---|---|
| A: "是" / B: "它处理异步任务" | 2 vs 4 | ✅ |
| A: "是" / B: "该框架以异步方式处理请求" | 2 vs 6 | ❌ |
规则:所有选项单词数差值必须在±3以内,避免学生通过长度猜题
3. Are answers evenly distributed?
3. 答案分布是否均匀?
| Index | Count | Valid? |
|---|---|---|
| 0 | 12-13 | ✅ |
| 1 | 12-13 | ✅ |
| 2 | 12-13 | ✅ |
| 3 | 12-13 | ✅ |
Rule: No 3+ consecutive same index, no obvious patterns
| 索引 | 数量 | 是否有效? |
|---|---|---|
| 0 | 12-13 | ✅ |
| 1 | 12-13 | ✅ |
| 2 | 12-13 | ✅ |
| 3 | 12-13 | ✅ |
规则:无连续3个及以上相同索引,无明显规律
Principles
核心原则
Principle 1: 50 Questions Required
原则1:必须包含50道试题
- Comprehensive coverage (all chapter concepts)
- Spaced repetition (different questions each retake)
- Component shuffles and displays 15-20 per session
- 全面覆盖(涵盖章节所有概念)
- 间隔重复(每次重考使用不同试题)
- 组件会随机打乱并每次会话显示15-20道题
Principle 2: Immediate Feedback
原则2:即时反馈
Show after EACH answer (not at end):
- ✅ Correct option highlighted (green)
- ❌ Why wrong (if incorrect)
- Explanation (100-150 words)
每道题作答后立即显示反馈(而非全部完成后):
- ✅ 正确选项高亮显示(绿色)
- ❌ 错误选项的错误原因说明
- 100-150单词的详细解释
Principle 3: Address All Options
原则3:覆盖所有选项
Every explanation must cover:
- Why correct is correct (2-3 sentences)
- Why each distractor is wrong (1-2 sentences × 3)
- Real-world connection (1-2 sentences)
每道题的解释必须包含:
- 正确选项的合理性(2-3句话)
- 每个干扰项的错误原因(每个1-2句话,共3个)
- 实际应用场景关联(1-2句话)
Principle 4: Source Attribution
原则4:来源标注
javascript
source: "Lesson 1: Understanding Mutability"Links each question to specific lesson for review.
javascript
source: "Lesson 1: Understanding Mutability"将每道题关联到对应的课时,方便复习。
Quiz Component Format
Quiz组件格式
markdown
---
sidebar_position: 5
title: "Chapter X: [Topic] Quiz"
---markdown
---
sidebar_position: 5
title: "Chapter X: [Topic] Quiz"
---Chapter X Quiz
第X章测验
Brief intro (1-2 sentences).
<Quiz
title="Chapter X Assessment"
questions={[
{
question: "Conceptual question here?",
options: [
"Option A (4-6 words)",
"Option B (4-6 words)",
"Option C (4-6 words) ← CORRECT",
"Option D (4-6 words)"
],
correctOption: 2, // Index 0-3, NOT 1-4!
explanation: "Why C is correct (2-3 sentences). Why A is wrong (1-2 sentences). Why B is wrong. Why D is wrong. Real-world connection.",
source: "Lesson 1: Topic Title"
},
// ... 49 more questions (total: 50)
]}
questionsPerBatch={18}
/>
undefined简短介绍(1-2句话)。
<Quiz
title="Chapter X Assessment"
questions={[
{
question: "此处填写概念型问题?",
options: [
"选项A(4-6个单词)",
"选项B(4-6个单词)",
"选项C(4-6个单词) ← 正确答案",
"选项D(4-6个单词)"
],
correctOption: 2, // 索引为0-3,而非1-4!
explanation: "说明选项C正确的原因(2-3句话)。说明选项A错误的原因(1-2句话)。说明选项B错误的原因。说明选项D错误的原因。结合实际应用场景。",
source: "Lesson 1: 主题名称"
},
// ... 另外49道题(总计50道)
]}
questionsPerBatch={18}
/>
undefinedAnswer Redistribution
答案重新分配
LLMs struggle with even distribution. Use the script after generation:
bash
python scripts/redistribute_answers_v2.py quiz.md ASequences A-H provide different distributions (~12-13 per index).
What it does:
- Parses quiz questions
- Swaps option positions to match sequence
- Updates explanations to reference new positions
- Validates all explanations match correct answers
大语言模型(LLMs)难以实现答案的均匀分布。生成测验后使用以下脚本:
bash
python scripts/redistribute_answers_v2.py quiz.md A序列A-H提供不同的分布方式(每个索引对应约12-13道题)。
脚本功能:
- 解析测验试题
- 调整选项位置以匹配指定序列
- 更新解释内容以对应新的选项位置
- 验证所有解释内容与正确答案匹配
Option Length Validation (CRITICAL)
选项长度验证(至关重要)
Problem: Unequal lengths let students guess by picking longest/shortest.
Solution: Manually count words for EVERY option in EVERY question.
✅ PASS: 4, 5, 4, 5 words (all within ±3)
❌ FAIL: 2, 4, 11, 3 words (2 to 11 = 9-word spread)Also verify:
- Longest option correct in ~25% (not biased)
- Shortest option correct in ~25% (not biased)
问题:选项长度不均会让学生通过选择最长或最短选项来猜测答案。
解决方案:手动统计每道题中每个选项的单词数量。
✅ 通过:4、5、4、5个单词(均在±3范围内)
❌ 不通过:2、4、11、3个单词(2到11相差9个单词)额外验证:
- 最长选项为正确答案的比例约为25%(无偏向性)
- 最短选项为正确答案的比例约为25%(无偏向性)
Common Pitfalls
常见误区
| Pitfall | Wrong | Right |
|---|---|---|
| Question count | <50 questions | Exactly 50 |
| Index values | | |
| Missing source | No source field | |
| Passing score | | No prop (removed) |
| Recall questions | "What is X?" | "Which reveals X issue?" |
| Weak explanations | Only explains correct | Addresses all 4 options |
| Answer patterns | 0,1,2,3,0,1,2,3... | Random, ~12-13 per index |
| Option lengths | 2 vs 11 words | All within ±3 words |
| 误区 | 错误示例 | 正确做法 |
|---|---|---|
| 试题数量 | 少于50道题 | 恰好50道 |
| 索引值 | | |
| 缺少来源 | 无source字段 | |
| 设置合格线 | | 移除该属性 |
| 记忆型试题 | "X是什么?" | "哪种操作会暴露X的问题?" |
| 解释不完整 | 仅说明正确选项 | 覆盖全部4个选项 |
| 答案规律 | 0,1,2,3,0,1,2,3... | 随机分布,每个索引约12-13道 |
| 选项长度不均 | 2 vs 11个单词 | 所有选项长度差值在±3以内 |
File Naming
文件命名规范
Pattern:
##_chapter_##_quiz.md| Chapter | Lessons | Filename |
|---|---|---|
| 2 | 4 | |
| 5 | 6 | |
| 14 | 5 | |
格式:
##_chapter_##_quiz.md| 章节 | 课时 | 文件名 |
|---|---|---|
| 2 | 4 | |
| 5 | 6 | |
| 14 | 5 | |
Handoff Checklist
交付检查清单
Content:
- 50 questions (not fewer)
- 75%+ Apply level or higher
- All major topics covered
- No recall questions
Distribution:
- correctOption uses 0-3 (not 1-4)
- ~12-13 per index
- No 3+ consecutive same index
Option Lengths:
- ALL options counted (all 50 questions)
- ALL within ±3 words
- Longest not biased toward correct
- Shortest not biased toward correct
Explanations:
- 100-150 words each
- Explains why correct
- Addresses each distractor
- Real-world connection
Format:
- Valid JSX syntax
- Exactly 4 options per question
- field on all 50
source - NO prop
passingScore - File named correctly
内容:
- 50道试题(不得少于)
- 75%以上为应用级或更高难度
- 涵盖所有主要知识点
- 无记忆型试题
答案分布:
- correctOption使用0-3索引(而非1-4)
- 每个索引对应约12-13道题
- 无连续3个及以上相同索引
选项长度:
- 所有选项均已统计单词数(覆盖全部50道题)
- 所有选项长度均在±3个单词范围内
- 最长选项为正确答案的比例无偏向性
- 最短选项为正确答案的比例无偏向性
解释内容:
- 每道题解释为100-150个单词
- 说明正确选项的原因
- 逐一分析每个干扰项错误的原因
- 结合实际应用场景
格式:
- 有效的JSX语法
- 每道题恰好4个选项
- 全部50道题均包含字段
source - 无属性(已移除)
passingScore - 文件名符合规范
If Verification Fails
若验证不通过
- Run redistribution script:
python scripts/redistribute_answers_v2.py quiz.md A - Re-count option lengths manually
- Check explanation references match correctOption
- Stop and report if issues persist after 2 attempts
- 运行重新分配脚本:
python scripts/redistribute_answers_v2.py quiz.md A - 重新手动统计所有选项的单词数
- 检查解释内容中的选项引用是否与correctOption匹配
- 若2次尝试后问题仍存在,停止操作并上报