YTUyZDVmY2E4MGE2ZGJlN2NlODFhZWMwYjZkMDU3ODg2OWZkNTg2ZDIyY2UyOWIzODRhN2IzNmYyY2RhNDY0OQ.msfha81p.eyJ1cmwiOiIvcGwvY291cnNlX2luc3RhbmNlLzIvaW5zdGFuY2VfcXVlc3Rpb24vMjEwLyIsImF1dGhuX3VzZXJfaWQiOiIxIn0
Skip to main content Accessibility guide
PrairieLearn Go home
  • XC 101, SectionA
  • Assessments
  • Gradebook
  • C4
Load from disk
  • Dev User student
    View type
    ✓ Staff view staff ✓ Student view student ✓ Student view without access restrictions student
    Effective user
    Customize…
    Course Requests Settings Log out

Regenerate assessment instance

Warning: Regenerating the assessment instance will select a new set of questions from this assessment. Any progress on the current assessment instance will be lost.

Are you sure you want to regenerate the assessment instance?

Course staff: Regenerate your assessment instance to pick up changes to the assessment or to get a fresh set of questions.

C4.15. Element pl-units-input: Input of answers with units

Questions below were designed to showcase the different features of pl-units-input. The goal of pl-units-input is to allow users to enter real values with units. This element has similar behavior to the pl-number-input element, with the added benefit of being able to interact with units.

Within this question, you can observe the default behavior of the pl-units-input element. The submitted answer and reference solutions will be first be converted to base units and then compared. Submitting units of incorrect dimensionality will not be given any credit. The attribute initial-value fills the input the first time it renders to provide a suggested starting point.

What is the length of a meter stick?

Here, we've set grading-mode="exact-units", requiring units matching the reference solution exactly. The default input field has help text as a placeholder as well as a question button and is set to use "relabs" to check the tolerance, which is a combination of relative ("rtol") and absolute ("atol") tolerances. Make sure to include the unit suffix m to indicate that your answer is in meters.

What is the length of a meter stick?

This question modifies the default relative tolerance (of 1e-3) and absolute tolerance (of 1e-8) underneath pl-units-input element. Furthermore, we add a label to the front of the input field to specify what the field should receive.

Let $c$ be the length of a meter stick. What is the value of $c$?

$c = $

In this question, we opt to change the default comparison of pl-units-input from relative and absolute tolerances (comparison="relabs") to significant digits (comparison="sigfig"), which has a default of two digits. In addition, this question showcases some of the more complex units that this element can handle. We also remove the help popup box found in by setting show-help-text="false".

Let $g$ be the acceleration due to gravity at Earth's surface. What is the value of $g$?

$g = $

For this question, we only ask for units by setting grading-mode="only-units".

What is the acceleration due to gravity at Earth's surface?

$9.8$

This example shows the use of the attribute size to control the width of the input box. We also use placeholder="" and show-help-text="false". We have also set allow-feedback="False" to suppress feedback given to students, and custom-format=".2g" to show a fixed number of digits after the answer has been parsed.

Express the distance of one mile in feet (include unit).

Distance of 1 mile =

This example shows the use of the attribute allow-blank to allow students to leave this input blank. We set blank-value="1m" to customize the value used for the blank input. We also set show-score="false" to hide the score badge.

How long is a meter stick? Leave the box blank to submit "1 meter".

When allow-blank="true" is set, we can set blank-value="" (and potentially correct-answer="") to support truly empty answers as well.

How large is the wind? Leave the box blank if there is no correct answer.

Additional attempts available with new variants

Correct answer

Collection 4

Assessment overview
Total points: 0/360
Score:
0%

Question C4.15

Value: 2
All variants: Open (current)
Total points: — /10
Auto-graded question

This form is only for reporting errors in the question itself. Do not use this form if you just don't know how to answer the question.

Previous question Next question

 Personal Notes

No attached notes

Attached files will be saved here for your reference. These files act as personal notes and can be used for your own review purposes. They are not used for grading.

Max file size: 10 MB

Attached personal notes will be saved here for your reference. These notes can be used for your own review purposes. They are not used for grading.

Staff information

Student details

Dev User
dev@example.com

Question

QID:
element/unitsInput
Title:
Element pl-units-input: Input of answers with units

Variant

Started at:
2026-08-04 16:37:49 (CDT)
Duration:
0s
Show/Hide answer
{
  "c_1": "1m",
  "c_2": "1m",
  "c_3": "1m",
  "c_4": "9.8 m/s**2",
  "c_5": "m/s^2",
  "c_6": "5280 foot",
  "c_7": "1m",
  "c_8": ""
}

Assessment instance

Assessment:
gallery/elements
Started at:
2026-08-04 16:37:17 (CDT)
Duration:
0s
View log
This box is not visible to students.