Creating Courses
Quizzes
Quizzes assess learner comprehension at the end of a section. Each quiz lives in its own directory with a quiz.yml file.
quiz.yml Example
A complete quiz file using the fields loaded by the course CLI:
type: quiz
id: "kubernetes-basics-quiz"
title: "Kubernetes Basics Quiz"
description: "Test your understanding of Kubernetes fundamentals."
instructions: "Answer every question before submitting."
timeLimit: 15
passingScore: 70
maxAttempts: 3
questions:
- id: "q1"
type: single_choice
question: "What is the smallest deployable unit in Kubernetes?"
explanation: "A Pod is the smallest and simplest Kubernetes object. It represents one or more containers that share storage, networking, and a specification for how to run the containers."
points: 10
options:
- id: "a"
text: "Container"
isCorrect: false
- id: "b"
text: "Pod"
isCorrect: true
- id: "c"
text: "Deployment"
isCorrect: false
- id: "d"
text: "Service"
isCorrect: false
- id: "q2"
type: multiple_choice
question: "Which of the following are valid Kubernetes workload types? (Select all that apply)"
explanation: "Deployments, StatefulSets, and DaemonSets are all valid Kubernetes workload types. 'Container' is not a workload type — it runs inside a Pod."
points: 15
options:
- id: "a"
text: "Deployment"
isCorrect: true
- id: "b"
text: "StatefulSet"
isCorrect: true
- id: "c"
text: "Container"
isCorrect: false
- id: "d"
text: "DaemonSet"
isCorrect: true
- id: "q3"
type: single_choice
question: "True or False: Kubernetes Pods can contain multiple containers."
explanation: "True. Pods are designed to support co-located, co-managed helper programs, such as logging and monitoring agents."
points: 5
options:
- id: "a"
text: "True"
isCorrect: true
- id: "b"
text: "False"
isCorrect: false
Question Types
The shared quiz model describes these question types. The course validator accepts any non-empty question structure and does not enforce a value for type:
| Type | Description |
|---|---|
single_choice | Only one correct answer. Used for standard multiple-choice and true/false questions. |
multiple_choice | Multiple correct answers. Learners must select all correct options. |
Flat Structure
Put loaded fields at the top level of quiz.yml. A nested block is not read as quiz data, so required fields such as the description and questions would be empty.
Incorrect — nested structure
type: quiz
title: "Kubernetes Quiz"
quiz:
id: "kubernetes-basics-quiz"
passingScore: 70
questions:
- ...Correct — flat structure
type: quiz
id: "kubernetes-basics-quiz"
title: "Kubernetes Quiz"
description: "Check your Kubernetes knowledge."
passingScore: 70
questions:
- question: "What is the smallest deployable Kubernetes unit?"
options:
- text: "Pod"
isCorrect: true
- text: "Deployment"
isCorrect: falseQuiz Settings
The course loader accepts these quiz settings. It enforces only a non-empty description, at least one question, non-empty question text, at least two options per question, and at least one correct option. It does not enforce score ranges, attempt limits, or question-type-specific answer counts:
| Field | Default | Description |
|---|---|---|
instructions | empty | Optional instructions loaded with the quiz. |
passingScore | 0 | Accepted numeric value; this validator does not enforce a percentage range. |
maxAttempts | 0 | Accepted numeric value; zero is represented as unlimited by the shared model. |
timeLimit | 0 | Accepted minute value; zero is represented as no limit by the shared model. |
allowRetakes, shuffleQuestions, passMessage, failMessage, reviewResources | — | Not loaded from quiz.yml by the course bundle. |
