Element pl-number-input: Input of real and complex numbers

Questions below were designed to showcase the different features of pl-number-input. The goal of pl-number-input is to allow users to enter real or complex values to be checked within a specific tolerance. The correct value of $c$ in all questions below is 12.806248474865697.

Within this question, you can observe the default behavior of the pl-number-input element. In particular, 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.

Solve for the value of $c$ given $c^2 = 8^2 + 10^2$

This question modifies the default relative tolerance (of 1e-3) and absolute tolerance (of 1e-8) underneath pl-number-input element. Furthermore, we add a label to the front of the input field to specify what the field should receive. The attribute initial-value pre-fills the input box the first time it is rendered. Here the initial value is set to one of the given values rather than the correct answer, so students still need to compute the result themselves.

Solve for the value of $c$ given $c^2 = 8^2 + 10^2$

$c = $

Under this variant, we opt to change the default comparison of pl-number-input from relative and absolute tolerances (comparison="relabs") to significant digits (comparison="sigfig"), which has a default of two digits. In addition, we've opted to add a suffix or a unit classification to the input via suffix="units".

Solve for the value of $c$ given $c^2 = 8^2 + 10^2$

$c = $ units

Another option is to set the comparison for pl-number-input to decimal digits ("decdig") with a requirement for four digits (digits="4"). Furthermore, we changed the weight of this question to be more impactful vs the previous entries via weight="2". Lastly, we allow students to enter complex numbers by setting allow-complex="true".

Solve for the value of $c$ given $c^2 = 8^2 + 10^2$

$c = $ units

As another example, we remove the help popup box found in pl-number-input by setting show-help-text="false".

Solve for the value of $c$ given $c^2 = 8^2 + 10^2$

$c = $ units

This example shows the use of the attribute size to control the width of the input box. Enter below the coefficients for a function $y = a x + b$ that has a slope equal to $2$ and intercepts the $y$-axis at $5$. Here we also use placeholder="" for both input boxes and show-help-text="false" for the first input box.

$f = $ $ x \, +$

This example allows the user to provide a blank value as a valid response. It uses the allow-blank="true" and blank-value="" options.

One of the roots of $c^2 = 0$ is $c=0$. Is there another root? Keep blank if there is no other root.

$c = $

If allow-blank="true" is set, blank-value can also be set to any other accepted input value, such as blank-value="1" below.

What is the greatest common divisor of 7 and 9? If the answer is 1, you can keep it blank.

$c = $

This question modifies the default format used to print the correct answer and submitted answer. This option can be used, for example, to set the number of decimal places, force (or avoid) scientific notation, or to include a sign in the result. We also set show-score="False" to hide the score badge.

Solve for the value of $c$ given $c^2 = 8^2 + 10^2$

Correct answer

Student view placeholder

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

Staff information

Question

Title:
Element pl-number-input: Input of real and complex numbers

Variant

Started at:
2026-08-04 21:54:12 (CDT)
Duration:
0s
Show/Hide answer
{
  "c_1": 12.806248474865697,
  "c_2": 12.806248474865697,
  "c_3": 12.806248474865697,
  "c_4": 12.806248474865697,
  "c_5": 12.806248474865697,
  "c_6": "",
  "c_7": 12.806248474865697,
  "c_b": 5,
  "c_m": 2,
  "c_6_blank": 1
}
History
dec frac
rad deg