Skip to content
Classroom

N-Tuple

Answer type: ntuple

The student types an ordered tuple — a point, a vector, or a coordinate pair.

The minimum

Common Control:

$answer = "(3,4)"

Options

Variable Effect
$answer the correct tuple — required
$reqdecimals accuracy of each component: sets an absolute tolerance of 0.5×10⁻ⁿ (unless $abstolerance/$reltolerance is set) and adds "accurate to n decimal places" to the tip; students are not required to type n digits
$displayformat "point", "pointlist", "vector", "vectorlist", "set", "setlist" or "list": changes only the entry tip (and, for vectors, how the correct answer is shown). Brackets are graded against $answer, so pair "vector" with $answer = "<3,4>"
$answerformat accepted-format flags
$ansprompt only with $answerformat = "nosoln" or "nosolninf": the radio-button labels, separated by ; (special solution;no solution;infinite solutions). Not shown before the box — put lead-in text in qtext
$answerboxsize width of the input box

Several points

To require every point — the two intersection points of a line and a circle, in either order — list them in $answer separated by commas, e.g. $answer = "(1,2),(3,4)". The student enters them the same way, in any order. Each point is worth an equal share, and extra points lose credit. Set $displayformat = "pointlist" so the entry tip asks for a list.

To accept any one of several tuples, separate the alternatives with or, e.g. $answer = "(1,2) or (3,4)". One of them earns full credit. A student who enters both is marked down for an extra answer.

Type Use when
ntuple components are numbers
calcntuple components are expressions to evaluate
algntuple components compare algebraically
complexntuple, calccomplexntuple components are complex

Example

Common Control — setup:

$h = nonzerorand(-6, 6)
$k = nonzerorand(-6, 6)
$f = makexpretty("(x - $h)^2 + $k")

Question Text:

<p>Give the vertex of `y = $f` as an ordered pair.</p>

Common Control, continued — answer and options:

$answer = "($h,$k)"
$displayformat = "point"

See Also