Skip to content

Multiple Choice Question

The multiple choice question resource creates questions where multiple answers can be correct. Participants can select multiple options from the provided choices, and all correct answers must be selected to get the question right.

resource "multiple_choice_question" "name" {
question = "Which of the following are container orchestration platforms?"
answer = [
"Kubernetes",
"Docker Swarm"
]
distractors = [
"Apache Kafka",
"Redis"
]
}
resource "multiple_choice_question" "name" {
question = "Which of the following are benefits of using Docker containers?"
answer = [
"Consistent environments across development and production",
"Efficient resource utilization",
"Easy application deployment"
]
distractors = [
"Automatic code optimization",
"Built-in database management"
]
hints = [
"Think about portability and resource usage",
"Consider deployment and environment consistency"
]
tags = ["docker", "containers", "benefits"]
}

multiple_choice_question

FieldRequiredTypeDescription
questionstringThe question text presented to participants
answerlist(string)The correct answer options (participants must select all)
distractorslist(string)Incorrect answer options presented alongside correct answers
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: Correct answers must not appear in the distractors list
  • Minimum answers: Must have at least 1 correct answer
  • Multiple correct answers: At least 2 correct answers recommended for true multiple choice
  • Minimum options: Must have at least 3 total options (answers + distractors)
  • Maximum options: Recommended maximum of 6-8 total options for usability
resource "multiple_choice_question" "cloud_services" {
question = "Which of the following are Amazon Web Services (AWS) compute services?"
answer = [
"EC2",
"Lambda",
"ECS"
]
distractors = [
"BigQuery",
"Cloud Functions",
"App Engine"
]
tags = ["aws", "cloud", "compute"]
}
resource "multiple_choice_question" "security_practices" {
question = "Which of the following are recommended security practices for containers?"
answer = [
"Use minimal base images",
"Scan images for vulnerabilities",
"Run containers as non-root users",
"Keep container images updated"
]
distractors = [
"Store secrets in image files",
"Use the latest tag for production"
]
hints = [
"Think about reducing attack surface",
"Consider secrets management and image versioning"
]
tags = ["security", "containers", "best-practices"]
}
resource "multiple_choice_question" "kubernetes_components" {
question = "Which of the following are core Kubernetes control plane components?"
answer = [
"kube-apiserver",
"etcd",
"kube-scheduler"
]
distractors = [
"kubelet",
"kube-proxy",
"container runtime"
]
tags = ["kubernetes", "architecture", "components"]
}
resource "multiple_choice_question" "docker_commands" {
question = "Which Docker commands can be used to view running containers?"
answer = [
"docker ps",
"docker container ls"
]
distractors = [
"docker images",
"docker logs",
"docker exec"
]
hints = [
"These commands list active containers",
"One is the newer syntax, one is the classic syntax"
]
tags = ["docker", "commands", "containers"]
}
  1. Clear Instructions: Make it clear that multiple answers may be correct
  2. Logical Grouping: Ensure correct answers belong to the same category
  3. Balanced Options: Include 2-4 correct answers typically
  4. Avoid Overlap: Ensure answers don’t contradict each other
  1. Thematic Consistency: All options should relate to the same topic
  2. Plausible Distractors: Make incorrect options believable
  3. Equal Weighting: All correct answers should be equally important
  4. Comprehensive Coverage: Test breadth of knowledge in the topic area
  1. Category Hints: Provide hints about what type of answers to look for
  2. Process Guidance: Help participants think through the selection process
  3. Comprehensive Explanations: Explain why each option is correct or incorrect
  4. Learning Reinforcement: Use explanations to strengthen understanding

Multiple choice questions use all-or-nothing scoring:

  • Participants must select all correct answers and no incorrect answers
  • Partial credit is not awarded for selecting only some correct answers
  • The question is marked incorrect if any wrong options are selected

Multiple choice questions are referenced in quiz resources:

resource "quiz" "comprehensive_assessment" {
questions = [
resource.multiple_choice_question.cloud_services,
resource.multiple_choice_question.security_practices,
resource.multiple_choice_question.kubernetes_components
]
show_hints = true
attempts = 2
}
  1. Clear Question Stem: Make the question clear about expecting multiple answers
  2. Balanced Difficulty: Include a mix of obvious and subtle correct answers
  3. Logical Distractors: Use common misconceptions as incorrect options
  4. Appropriate Scope: Don’t make questions too broad or too narrow
  5. Consistent Format: Keep all options in similar format and length
  6. Educational Value: Use questions that reinforce important concepts
  7. Real-world Relevance: Focus on practical knowledge and application
  8. Review Carefully: Test questions to ensure all correct answers are truly correct