Skip to content

You are viewing documentation for Instruqt 2.0 Labs - our upcoming product releasing in September 2026. For current Tracks documentation, please visitdocs.instruqt.com.

Numeric Answer Question


Defined inquizzes.hcl

The numeric answer question resource creates questions that expect numerical responses. These questions support exact values, ranges, and precision validation for mathematical calculations and quantitative assessments.

As a lab author, you use numeric answer questions to assess quantitative knowledge:

  • Configuration Values: Assess knowledge of specific numeric settings, ports, timeouts, or limits in system configurations
  • Resource Calculations: Test understanding of resource requirements, capacity planning, or performance calculations
  • Technical Specifications: Evaluate recall of specific numeric values from documentation, standards, or best practices

Numeric answer questions provide precise assessment of quantitative technical knowledge and calculation abilities.

resource "numeric_answer_question" "name" {
question = "How many CPU cores does a t3.medium EC2 instance have?"
answer = 2
}
resource "numeric_answer_question" "name" {
question = "What is the default HTTP port for web servers?"
answer = 80
hints = [
"This is a well-known port number",
"Most web browsers use this port by default"
]
tags = ["networking", "http", "ports"]
}

Fields

FieldTypeRequiredDescription
questionstringThe question that learners will answer
answernumberThe correct numeric answer
exactboolEnable for exact numeric matching, disable for approximate matching with tolerance
Defaulttrue
hintslist(string)Optional hints that can be revealed to help learners
tagslist(string)Optional tags for organizing and filtering questions

Numeric questions require users to enter the exact value specified in the answer field.

resource "numeric_answer_question" "kubernetes_port" {
question = "What is the default port for the Kubernetes API server?"
answer = 6443
tags = ["kubernetes", "networking", "api"]
}
resource "numeric_answer_question" "memory_calculation" {
question = "How many gigabytes of RAM does a server with 8192 MB have? (Round to nearest whole number)"
answer = 8
hints = [
"Convert megabytes to gigabytes",
"1024 MB = 1 GB"
]
tags = ["memory", "calculations", "conversions"]
}
resource "numeric_answer_question" "pod_replicas" {
question = "If you have 3 worker nodes and want to distribute 9 pod replicas evenly, how many pods per node?"
answer = 3
tags = ["kubernetes", "scaling", "calculations"]
}

Numeric answer questions are referenced in quiz resources:

resource "quiz" "technical_calculations" {
questions = [
resource.numeric_answer_question.kubernetes_port,
resource.numeric_answer_question.memory_calculation,
resource.numeric_answer_question.pod_replicas
]
show_hints = true
attempts = 2
}
  1. Clear Units: Specify units in the question (MB, GB, seconds, etc.)
  2. Precise Values: Ensure the expected answer is clearly defined
  3. Context Clarity: Provide enough context for users to understand what to calculate
  4. Realistic Numbers: Use practical values that users might encounter
  5. Helpful Hints: Guide the calculation process without giving away the answer
  6. Educational Value: Use explanations to reinforce the underlying concepts
  7. Input Validation: Consider what formats users might use (decimals, integers)
  8. Avoid Trick Questions: Focus on knowledge and understanding, not mathematical gotchas