Skip to content
Classroom

Calculated Question Type

Students enter algebraic or mathematical expressions that are simplified and evaluated for correctness.

Basic Syntax

[calculated]
answer = x^2 + 2*x + 1;

Options

answer (required)

The correct mathematical expression in simplified form.

[calculated]
answer = (x+1)^2;

simplify

  • full (default) — Both sides must simplify to the same form
  • none — Student answer must match exactly
  • basic — Basic simplification only (combine like terms)
[calculated]
answer = 2*x + 3;
simplify = full;  // Accepts: 2x+3, 4x+6-2x-3, etc.

variable

Define which variable(s) to use. Defaults to x.

[calculated]
answer = m*t + b;
variable = m, t, b;

ansdisplaymode

How to display the answer: - 1 — Simplified form (default) - 2 — Factored form - 3 — Expanded form

[calculated]
answer = (x+2)*(x-3);
ansdisplaymode = 1;  // Shows: x^2 - x - 6

Examples

Polynomial Simplification

$a = rand(1, 5);
$b = rand(1, 5);

Expand and simplify: $(x + $a)(x + $b)$

[calculated]
answer = x^2 + ($a + $b)*x + ($a * $b);
simplify = full;

Fraction Simplification

Simplify: `(x^2 - 4)/(x - 2)`

[calculated]
answer = x + 2;
simplify = full;

Multi-Variable Expression

$r = rand(2, 8);

Solve for distance using the formula `d = rt` where `r = $r`:

[calculated]
answer = $r * t;
variable = t;
simplify = full;

Grading

The system: 1. Parses both the student answer and the correct answer as symbolic expressions 2. Applies simplification rules (if enabled) 3. Compares the two expressions algebraically 4. Returns Correct if they are mathematically equivalent

Example: - Student enters: 2*(x + 1) + 3 - Answer defined as: 2*x + 5 - With simplify = full: Both simplify to 2*x + 5Correct

Common Mistakes

  • Forgetting to multiply: Entering (x+1)(x+1) instead of (x+1)*(x+1)
  • Order of operations: Entering 2x^2 when you meant (2x)^2
  • Implicit multiplication: 2x should be written as 2*x

See Also

  • Number — For single numerical answers
  • Function — For piecewise or complex expressions
  • Solver Tool — Use symbolic math in your questions