Quiz System
The quiz system allows you to create interactive assessments for your courses. Quizzes are written in Markdown files with front matter configuration and support various question types, scoring, and user progress tracking.
File Location
Quizzes live under content/pages/courses/. The file path becomes the URL.
File naming. Lower case, words separated by hyphens. The name becomes part of the URL — choose it for the topic, not for today's version.
Front Matter
The block is a small YAML subset. Keys are lower case.
Required
| Key | Type | Description |
|---|---|---|
title | string | Quiz title shown on the page |
quiz | boolean | Must be true to identify the file as a quiz |
Optional
| Key | Type | Default | Description |
|---|---|---|---|
course_slug | string | "" | Course this quiz belongs to (e.g., courses/intro-web-dev.md) |
collectEmail | boolean | false | Collect email from guest users |
reviewAnswersOnSubmit | boolean | true | Show correct/incorrect after submission |
requireLogin | boolean | true | User must be logged in to take the quiz |
requireEnrollment | boolean | true | User must be enrolled in the course |
passingScore | integer | 70 | Percentage required to pass (0-100) |
timeLimit | integer | 0 | Time limit in minutes (0 = unlimited) |
showResultsImmediately | boolean | false | Show results immediately after submission |
allowRetake | boolean | false | Allow users to retake the quiz |
maxAttempts | integer | 0 | Maximum attempts (0 = unlimited) |
description | string | "" | Optional description below the quiz title |
Example Front Matter
---
title: "Module 1 Quiz: Introduction to Web Development"
quiz: true
course_slug: courses/intro-web-dev.md
requireLogin: true
requireEnrollment: true
passingScore: 70
reviewAnswersOnSubmit: true
allowRetake: false
maxAttempts: 2
timeLimit: 15
description: "Test your understanding of the basic concepts covered in Module 1."
---
Question Format
Each question follows a numbered pattern. Questions must be numbered sequentially starting from
Basic Structure
---
question1: Your question text here
answerForQuestion1: Correct answer
questionType1: text
questionRequired1: true
questionExplanation1: Explanation for the correct answer
---
---
title: "HTML & CSS Basics Quiz"
quiz: true
course_slug: courses/intro-web-dev.md
requireLogin: true
requireEnrollment: true
passingScore: 70
reviewAnswersOnSubmit: true
allowRetake: false
maxAttempts: 2
timeLimit: 10
description: "Test your knowledge of HTML and CSS fundamentals."
---
question1: What is the correct HTML element for creating a hyperlink?
questionType1: multipleChoice
questionOptions1: <a>|<link>|<href>|<url>
questionCorrectOptions1: 0
questionRequired1: true
questionExplanation1: The <a> (anchor) element is used for creating hyperlinks.
question2: Which CSS property is used to change the background color?
questionType2: multipleChoice
questionOptions2: color|background-color|bgcolor|background
questionCorrectOptions2: 1
questionRequired2: true
questionExplanation2: background-color is the CSS property used to set the background color.
question3: What does CSS stand for?
answerForQuestion3: Cascading Style Sheets
questionType3: text
questionRequired3: true
questionExplanation3: CSS stands for Cascading Style Sheets — it's used to style HTML documents.
question4: Which of these are valid HTML semantic elements?
questionType4: multipleSelect
questionOptions4: <header>|<footer>|<nav>|<div>|<span>
questionCorrectOptions4: 0,1,2
questionRequired4: true
questionExplanation4: <header>, <footer>, and <nav> are semantic HTML5 elements. <div> and <span> are non-semantic.
question5: Explain the difference between inline and block elements.
answerForQuestion5: Inline elements don't start on a new line and only take up as much width as needed. Block elements start on a new line and take up the full width available.
questionType5: longText
questionRequired5: false
---