Show a desktop notification when the AI TA finishes replying
Notify me when classmates post messages in the forum
Play an alert sound whenever there is a new notification
Explain how Uedu's AI question-generation system uses teaching content, question types, and difficulty distribution to generate quiz questions in batches through an LLM, so teaching researchers can understand how questions are produced.
Uedu's Quiz Generator allows instructors to provide teaching content and have the LLM automatically generate quiz questions of multiple question types and difficulty levels. The core of the system is the QuizAIGenerator class, which uses the gpt-5-mini model and supports bilingual generation in Chinese and English.
The generation process adopts a question type × difficulty batching strategy, with each batch calling the LLM independently and reporting progress in real time through a progress callback, so that instructors can see the live generation status on the front end.
When creating an AI question-generation task, the Instructor must provide the following parameters:
| Parameter | Type | Description |
|---|---|---|
source_content | String | Teaching content text, as the knowledge source for question-setting |
question_types | Dict | Question types to generate and the number of questions for each type, for example {"multiple_choice": 10, "true_false": 5} |
difficulty_dist | Dict | Difficulty distribution ratio, for example {"easy": 0.3, "medium": 0.5, "hard": 0.2} |
course_context | String | Course background information (optional), to help the LLM understand the question context |
language | String | Generation language: zh (Traditional Chinese) or en (English) |
| Question type code | Description |
|---|---|
multiple_choice | Single-choice question (one of four) |
true_false | True/False |
fill_in_blank | Fill-in-the-blank question |
short_answer | Short Answer |
essay | Essay questions |
| Level | English | Description |
|---|---|---|
| Simple | easy | Memory-based, direct recall questions |
| Medium | medium | Comprehension and application questions |
| Difficulty | hard | Analytical, evaluative and creative questions |
The system uses the _calculate_difficulty_counts() method to split the total number of questions for each question type into the actual number of questions at each difficulty level according to the difficulty ratio:
floor (round down)Assume multiple_choice: 10 questions, difficulty_dist: {"easy": 0.3, "medium": 0.5, "hard": 0.2}:
| Difficulty | Percentage | Calculate | floor | Final |
|---|---|---|---|---|
| easy | 0.3 | 10 × 0.3 = 3.0 | 3 | 3 |
| medium | 0.5 | 10 × 0.5 = 5.0 | 5 | 5 |
| hard | 0.2 | 10 × 0.2 = 2.0 | 2 | 2 |
The system splits question-setting tasks into a batch matrix of question type × difficulty. For example, if the Instructor requests multiple_choice (10 questions) and true_false (5 questions), with an easy/medium/hard difficulty distribution, it is split into:
Each batch makes one independent call to the LLM API.
The system supports a progress callback mechanism. After each batch is completed, the callback function will be called to report:
current)total)progress, 0.0 ~ 1.0)processing, completed, failed)The front end displays the generation status in real time via polling the progress API.
After all batches of questions have been generated, the system shuffles all questions and then reorders question_order to ensure that questions of different difficulty levels and types are evenly interleaved.
Each question generated by the LLM includes the following fields:
| Field | Type | Description |
|---|---|---|
question_text | String | Question text |
question_type | String | Question type code (multiple_choice, true_false, etc.) |
difficulty | String | Difficulty level (easy, medium, hard) |
options | Array | Option list (for multiple-choice and true/false questions) |
correct_answer | String | Correct Answer |
explanation | String | Answer Explanation |
question_order | Number | Question order (randomly reshuffled after all items are generated) |
The questions generated by AI are drafts. The Instructor may review, edit or delete each question in the question bank to ensure the quality meets teaching needs.
Quiz questions are automatically generated by the Quiz Generator module on the Uedu platform (the QuizAIGenerator class). Instructors provide teaching content (source_content), question type distribution (question_types) and difficulty ratio (difficulty_dist); the system splits the task into batch matrices of question type × difficulty, and each batch independently calls the LLM (OpenAI gpt-5-mini) to generate the specified number of questions. The difficulty distribution is allocated proportionally by _calculate_difficulty_counts() and corrected for rounding errors. Once generation is complete, all questions are shuffled randomly. The system supports bilingual generation in Traditional Chinese (zh) and English (en), and course context information (course_context) can be included. The generated questions are drafts and must be reviewed and edited by the Instructor before they can be used in a formal quiz. See https://uedu.tw/doc/quiz-generator for a detailed methodology.
It is recommended to provide the following: