Skip to content

You are viewing documentation for Instruqt 2.0 Labs which is in Beta currently. Official release date - 29 September, 2026. For Tracks documentation, please visit docs.instruqt.com.

Quiz


Defined inquizzes.hcl

The quiz resource creates interactive knowledge assessments with multiple question types. Users must answer questions correctly to complete the quiz, with configurable hints and answer visibility.

As a lab author, you use quizzes to assess and reinforce learning:

  • Knowledge Assessment: Evaluate user understanding of concepts, procedures, and technical knowledge covered in the lab
  • Learning Reinforcement: Help users consolidate their learning through active recall and application of concepts
  • Progress Checkpoints: Create assessment points throughout the lab to verify comprehension before moving forward

Quizzes transform passive reading into active learning experiences that improve knowledge retention and skill development.

resource "quiz" "name" {
questions = [
resource.single_choice_question.question1,
resource.multiple_choice_question.question2
]
}
resource "quiz" "name" {
questions = [
resource.single_choice_question.basics,
resource.multiple_choice_question.concepts,
resource.text_answer_question.short_answer,
resource.numeric_answer_question.calculation
]
show_hints = true
show_answers = false
}

Fields

FieldTypeRequiredDescription
prerequisiteslist(reference)chapter, task, quizSpecify which tasks must be completed before learners can access this quiz
questionslist(reference)single_choice_question, multiple_choice_question, text_answer_question, numeric_answer_question, true_false_question, match_question, sequence_question, fill_in_the_blanks_question, drag_words_questionAdd question resources to include in this quiz assessment
show_hintsboolEnable to allow learners to view hints for questions
Defaultfalse
show_answersboolEnable to reveal correct answers after quiz submission
Defaultfalse

The quiz can include any combination of these question types:

Question TypeReferenceDescription
Single Choiceresource.single_choice_question.nameOne correct answer from multiple options
Multiple Choiceresource.multiple_choice_question.nameMultiple correct answers from options
Text Answerresource.text_answer_question.nameFree-form text response
Numeric Answerresource.numeric_answer_question.nameNumerical response with optional precision
resource "quiz" "docker_basics" {
questions = [
resource.single_choice_question.what_is_docker,
resource.multiple_choice_question.docker_benefits
]
}
resource "quiz" "final_exam" {
questions = [
resource.single_choice_question.concepts,
resource.multiple_choice_question.best_practices,
resource.text_answer_question.explain_process,
resource.numeric_answer_question.calculate_resources
]
show_hints = false
show_answers = true
}
resource "quiz" "practice_session" {
questions = [
resource.single_choice_question.easy_question,
resource.multiple_choice_question.medium_question,
resource.text_answer_question.hard_question
]
show_hints = true
show_answers = true
}
resource "quiz" "comprehensive_test" {
questions = [
resource.single_choice_question.theory_basics,
resource.multiple_choice_question.practical_applications,
resource.text_answer_question.describe_workflow,
resource.numeric_answer_question.calculate_capacity,
resource.single_choice_question.troubleshooting
]
show_hints = false
show_answers = false
}

Quizzes must be referenced in instruction pages using the activities map and <instruqt-quiz> component:

resource "page" "assessment" {
title = "Knowledge Assessment"
file = "instructions/chapter2/assessment.md"
activities = {
final_quiz = resource.quiz.docker_basics
}
}

Then in your markdown file:

## Test Your Knowledge
<instruqt-quiz id="final_quiz"></instruqt-quiz>
  1. Presentation: Questions are shown in the order specified
  2. Interaction: Participants select/enter answers
  3. Hints: Available if show_hints = true
  4. Submission: Answers are validated
  5. Results: Feedback provided based on configuration
  1. Question Variety: Mix different question types for comprehensive assessment
  2. Logical Order: Arrange questions from basic to advanced concepts
  3. Hint Usage: Enable hints for learning-focused quizzes, disable for formal assessments
  4. Answer Visibility: Show answers for practice, hide for formal evaluations
  5. Question Quality: Write clear, unambiguous questions with meaningful distractors
  6. Content Alignment: Ensure questions align with the instructional content