Multiple Choice
MultipleChoiceQuestion
A question that requires a multiple choice answer.
Answers and distractors are combined in a single list and showed in randomized order.
resource "multiple_choice_question" "name" {
...
}
Attributes
Question question
type: string
The question that needs to be answered.
question = "Which of these cities is located in France?"
Answer answer
type: []string
The correct answer to the question.
answer = ["Paris", "Lyon"]
Distractors distractors
type: []string
Additional incorect options to present to the participants.
distractors = ["Berlin", "London"]
Hints hints
type: []string
The hints to show to the participants.
hints = [
"One of these cities is located in England",
"The other country is located in Germany"
]
Tags tags
type: []string
The tags to associate with the question.
tags = ["cities", "europe"]
Computed Attributes
These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.
Meta ID meta.id
string
The full ID of the resource e.g. `resource.type.name`. This is computed from the full resource path:
// given the following resource
resource "container" "ubuntu" {
...
}
// the resulting id will be
resource.container.ubuntu
Meta Type meta.type
string
The type of the resource. This taken from the type label of the resource definition.
// given the following resource
resource "container" "ubuntu" {
...
}
// the resulting type will be
container
Meta Name meta.name
string
The name of the resource. This taken from the name label of the resource definition.
// given the following resource
resource "container" "ubuntu" {
...
}
// the resulting name will be
ubuntu
Examples
Full Example
question = "Which of these cities are in France?"
answer = ["Paris", "Lyon", "Nantes"]
distractors = ["London", "Berlin"]
hints = [
"One of these cities is in the UK",
"Another city is in Germany"
]
}
Last updated