Skip to content

Single Choice Question

The single choice question resource creates multiple choice questions with one correct answer. Participants select from a list of options that includes the correct answer and distractors.

resource "single_choice_question" "name" {
question = "What is the capital of France?"
answer = "Paris"
distractors = [
"Berlin",
"London",
"Madrid"
]
}
resource "single_choice_question" "name" {
question = "Which container orchestration platform is developed by Google?"
answer = "Kubernetes"
distractors = [
"Docker Swarm",
"Apache Mesos",
"Nomad"
]
hints = [
"This platform was originally called Borg internally at Google",
"The name comes from the Greek word for helmsman"
]
tags = ["kubernetes", "containers", "orchestration"]
}

single_choice_question

FieldRequiredTypeDescription
questionstringThe question text presented to participants
answerstringThe correct answer option
distractorslist(string)Incorrect answer options presented alongside the correct answer
hintslist(string)Hints shown to participants when hints are enabled. Defaults to empty list.
tagslist(string)Tags for categorizing and organizing questions. Defaults to empty list.
  • Answer uniqueness: The correct answer must not appear in the distractors list
  • Minimum options: Must have at least 2 total options (answer + distractors)
  • Maximum options: Recommended maximum of 5-6 total options for usability
  • Question clarity: Questions should be clear and unambiguous
resource "single_choice_question" "geography_basic" {
question = "What is the capital of Japan?"
answer = "Tokyo"
distractors = [
"Osaka",
"Kyoto",
"Hiroshima"
]
}
resource "single_choice_question" "docker_concepts" {
question = "Which Docker command is used to create and start a new container?"
answer = "docker run"
distractors = [
"docker start",
"docker create",
"docker exec"
]
tags = ["docker", "containers", "commands"]
}
resource "single_choice_question" "networking_advanced" {
question = "Which HTTP status code indicates a successful request?"
answer = "200"
distractors = [
"404",
"500",
"302"
]
hints = [
"This is a 2xx status code",
"It's the most common success status code"
]
tags = ["http", "networking", "status-codes"]
}
resource "single_choice_question" "kubernetes_basic" {
question = "What is the smallest deployable unit in Kubernetes?"
answer = "Pod"
distractors = [
"Container",
"Node",
"Service"
]
tags = ["kubernetes", "concepts"]
}
resource "single_choice_question" "kubernetes_storage" {
question = "Which Kubernetes resource provides persistent storage?"
answer = "PersistentVolume"
distractors = [
"ConfigMap",
"Secret",
"EmptyDir"
]
tags = ["kubernetes", "storage"]
}
  1. Clear and Specific: Write questions that test specific knowledge
  2. Avoid Ambiguity: Ensure only one answer is clearly correct
  3. Appropriate Difficulty: Match question difficulty to learning objectives
  4. Real-world Relevance: Use practical scenarios when possible
  1. Plausible Distractors: Make incorrect options believable but clearly wrong
  2. Consistent Format: Keep all options in the same format (length, style)
  3. Avoid “All of the above”: This can make questions too easy or confusing
  4. Random Order: Options are automatically shuffled during presentation
  1. Progressive Hints: Order hints from general to specific
  2. Educational Value: Use explanations to reinforce learning
  3. Concise Content: Keep hints and explanations brief but informative
  4. Avoid Giving Away: Don’t make hints too obvious

Single choice questions are referenced in quiz resources:

resource "quiz" "fundamentals" {
questions = [
resource.single_choice_question.geography_basic,
resource.single_choice_question.docker_concepts,
resource.single_choice_question.networking_advanced
]
show_hints = true
attempts = 2
}
  1. Balanced Difficulty: Mix easy, medium, and hard questions
  2. Logical Grouping: Use tags to organize related questions
  3. Quality Distractors: Include options that test common misconceptions
  4. Learning Reinforcement: Use explanations to strengthen understanding
  5. Testing Strategy: Test understanding, not memorization
  6. Accessibility: Ensure questions work for diverse learning styles
  7. Review and Iterate: Test questions with real learners and refine based on feedback