Match Question
The match_question resource asks learners to pair items from two columns. Provide the correct pairings as key-value pairs in answer.
HCL Syntax
Section titled “HCL Syntax”Basic Syntax
Section titled “Basic Syntax”resource "match_question" "capitals" { question = "Match each country to its capital." answer = { France = "Paris" Japan = "Tokyo" }}Fields
| Field | Type | Required | Description |
|---|---|---|---|
question | string | ✓ | Instructions for the matching exercise |
answer | map(string) | ✓ | Map of items to their correct matches (e.g. country = capital) |
hints | list(string) | — | Optional hints that can be revealed to help learners |
tags | list(string) | — | Optional tags for organizing and filtering questions |
Examples
Section titled “Examples”With hints
Section titled “With hints”resource "match_question" "ports" { question = "Match each service to its default port." answer = { HTTP = "80" HTTPS = "443" SSH = "22" } hints = ["Think of the well-known port range"] tags = ["networking"]}