Quiz
Quiz
A quiz consists of a number of questions that need to be answered in order to complete the quiz.
resource "quiz" "name" {
...
}
Attributes
Questions questions
type: Reference to MultipleChoiceQuestion, SingleChoiceQuestion, TextAnswerQuestion, NumericAnswerQuestion
The questions that need to be answered in order to complete the quiz.
questions = [
resource.multiple_choice_question.cities_france,
resource.single_choice_question.capital_france
]
ShowHints show_hints
type: bool
Whether to show hints to the participants.
show_hints = true
ShowAnswers show_answers
type: bool
Whether to show answers to the participants.
show_answers = true
Attempts attempts
type: int
The number of attempts a participant can make.
attempts = 3
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
resource "quiz" "france" {
questions = [
resource.multiple_choice_question.cities_france,
resource.text_answer_question.capital_france,
]
show_hints = true
}
Last updated