You are viewing this question as it will appear in the manual grading interface. Return to the normal view when you are done.

Element pl-matching: Match statements with options

This question illustrates different use cases for the pl-matching element.

Example 1: Match each nation with its capital city. In this example, the options are implicitly created by each statement's match attribute. Only distractor options need to be added manually. All statements and options are displayed by default.

United States
France
Mexico
Canada
  1. New York City
  2. Tijuana
  3. Mexico City
  4. Ottawa
  5. Washington, D.C.
  6. Toronto
  7. Paris

Example 2: Setting counter-type="full-text" will hide the column of options. The dropdown list next to each statement will contain the inner text of each option, rather than a counter.

headshot of Mariana
headshot of Matt

Example 3: blank="false" removes the blank first entry in the dropdown list, setting the default selection to the first option.

Mexico
Canada
United States
France
  1. Mexico City
  2. New York City
  3. Tijuana
  4. Washington, D.C.
  5. Paris
  6. Toronto
  7. Ottawa

Example 4: number-statements and number-options determine how many statements and options are shown. Statements are sampled at random. The options will always include each correct match for the sampled statements, plus random distractors.

Mexico
Canada
France
  1. Paris
  2. New York City
  3. Toronto
  4. Ottawa
  5. Mexico City

Example 5: if number-options is smaller than the amount of options required to match the sampled statements, None of the Above will be added.

France
United States
Canada
  1. Washington, D.C.
  2. Paris
  3. None of the above

Example 6: the counter-type attribute indicates how options are identified. It can be set to lower-alpha (a, b, c, ...), upper-alpha (A, B, C, ...), or decimal (1, 2, 3).

France
Canada
United States
  1. Ottawa
  2. Paris
  3. Washington, D.C.

Example 7: options can be added manually if they require more than simple text (e.g., images, equations or formatting). In that case, the name attribute of each pl-option must match the corresponding match attribute of the appropriate pl-statement.

$e$
$i$
$\phi$
  1. $\sqrt{-1}$
  2. $\cfrac{1+\sqrt{5}}{2}$
  3. $ \displaystyle \lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^{n}$

Example 8: HTML formatting and other PrairieLearn elements can be used inside statements and options. If used in options, an explicit pl-option must be defined with a name attribute matching the corresponding match attribute of the appropriate pl-statement.

1
list(filter(lambda item: item > 0, lst))
1
list(itertools.product(lst1, lst2))
1
list(map(lambda item: item * 2, lst))
  1. 1
    [(a, b) for a in lst1 for b in lst2]
    
  2. 1
    [item for item in lst if item > 0]
    
  3. 1
    [item * 2 for item in lst]
    

Example 9: This example uses the options-placement="bottom" argument. This is useful for questions with long statements and options, which may wrap over multiple lines or cause formatting issues in the default "right" placement.

What biotechnology technique offers potential in treating genetic disorders and enhancing crop yields?
Which theory revolutionized our understanding of space, time, and gravity?
What field of computer science encompasses machine learning, natural language processing, and computer vision?
What is a branch of physics that challenges classical intuition and underpins technologies like quantum computing?
  1. OPERA faster-than-light neutrino anomaly
  2. The theory of relativity
  3. Traditional computing
  4. Artificial intelligence
  5. Data science
  6. Quantum mechanics
  7. String theory
  8. Genetic engineering

Correct answer

e. Washington, D.C.
United States
g. Paris
France
c. Mexico City
Mexico
d. Ottawa
Canada
Mariana
headshot of Mariana
Matt
headshot of Matt
a. Mexico City
Mexico
g. Ottawa
Canada
d. Washington, D.C.
United States
e. Paris
France
e. Mexico City
Mexico
d. Ottawa
Canada
a. Paris
France
b. Paris
France
a. Washington, D.C.
United States
c. None of the above
Canada
2. Paris
France
1. Ottawa
Canada
3. Washington, D.C.
United States
c. $ \displaystyle \lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^{n}$
$e$
a. $\sqrt{-1}$
$i$
b. $\cfrac{1+\sqrt{5}}{2}$
$\phi$
b.
1
[item for item in lst if item > 0]
1
list(filter(lambda item: item > 0, lst))
a.
1
[(a, b) for a in lst1 for b in lst2]
1
list(itertools.product(lst1, lst2))
c.
1
[item * 2 for item in lst]
1
list(map(lambda item: item * 2, lst))
h. Genetic engineering
What biotechnology technique offers potential in treating genetic disorders and enhancing crop yields?
b. The theory of relativity
Which theory revolutionized our understanding of space, time, and gravity?
d. Artificial intelligence
What field of computer science encompasses machine learning, natural language processing, and computer vision?
f. Quantum mechanics
What is a branch of physics that challenges classical intuition and underpins technologies like quantum computing?

Student view placeholder

In student views this area is used for assessment and score info.
Tools

Staff information

Question

Title:
Element pl-matching: Match statements with options

Variant

Started at:
2026-08-05 00:45:47 (CDT)
Duration:
0s
Show/Hide answer
{
  "ex1": [
    4,
    6,
    2,
    3
  ],
  "ex2": [
    1,
    0
  ],
  "ex3": [
    0,
    6,
    3,
    4
  ],
  "ex4": [
    4,
    3,
    0
  ],
  "ex5": [
    1,
    0,
    2
  ],
  "ex6": [
    1,
    0,
    2
  ],
  "ex7": [
    2,
    0,
    1
  ],
  "ex8": [
    1,
    0,
    2
  ],
  "ex9": [
    7,
    1,
    3,
    5
  ]
}
History
dec frac
rad deg