Drawing Question Type¶
Students draw curves, points, and lines on a coordinate grid for auto-grading.
Basic Syntax¶
[drawing:function]
answer = x^2 - 2;
Types¶
function — Curve from an equation¶
Student draws the curve for a given function.
[drawing:function]
answer = 2*sin(x);
line — Straight line with slope and intercept¶
Student draws a line by clicking two points.
[drawing:line]
answer = 2*x + 3; // Slope = 2, y-intercept = 3
point — Single point on the plane¶
Student places a point at specific coordinates.
[drawing:point]
answer = (3, 5);
piecewise — Multiple curves or segments¶
Student draws a piecewise function.
[drawing:piecewise]
answer = {x^2 : x < 0, 2*x : x >= 0};
Options¶
xmin, xmax, ymin, ymax¶
Bounds of the coordinate grid.
[drawing:function]
answer = x^2;
xmin = -5;
xmax = 5;
ymin = -2;
ymax = 25;
showgrid¶
true(default) — Display gridfalse— Plain coordinate plane
[drawing:function]
answer = cos(x);
showgrid = true;
xmin = -2*pi;
xmax = 2*pi;
tolerance¶
Acceptable drawing error as a percentage of the visible area (default: 5%).
[drawing:function]
answer = x^3;
tolerance = 3; // Stricter grading
Examples¶
Quadratic Function¶
$a = rand(-3, 3);
$b = rand(-3, 3);
$c = rand(-5, 5);
Draw the graph of `f(x) = $a*x^2 + $b*x + $c`.
[drawing:function]
answer = $a*x^2 + $b*x + $c;
xmin = -10;
xmax = 10;
ymin = -20;
ymax = 30;
Piecewise Function¶
Draw the graph of the piecewise function:
`f(x) = {x + 1 : x ≤ 0, x^2 : x > 0}`
[drawing:piecewise]
answer = {x + 1 : x <= 0, x^2 : x > 0};
xmin = -5;
xmax = 5;
ymin = -2;
ymax = 25;
Line with Specific Slope¶
$slope = rand(1, 3);
$yint = rand(-5, 5);
Draw a line with slope $slope and y-intercept $yint.
[drawing:line]
answer = $slope*x + $yint;
xmin = -10;
xmax = 10;
ymin = -20;
ymax = 20;
Solution Set on Number Line¶
Draw the point(s) that satisfy: `x = 2` and `y = -3`.
[drawing:point]
answer = (2, -3);
xmin = -5;
xmax = 5;
ymin = -5;
ymax = 5;
Grading¶
The system compares the student's drawing to the correct answer curve:
- Matches within tolerance threshold → Correct
- Differs by more than tolerance → Incorrect
Tolerance is calculated as a percentage of the visible coordinate area.
Tips¶
- Use reasonable grid bounds: Too large or too small makes drawing difficult
- Test the tolerance level: Adjust based on how precise your students should be
- Provide context: Tell students what tools are available (Shift-click to add points, etc.)
- Start simple: Introduce with linear functions before quadratics
- Pair with calculator: Let students verify their answer using a graphing calculator first
Common Issues¶
- Degenerate parabola: Very flat parabolas can appear as straight lines on large grids
- Asymptotes: Functions with vertical asymptotes need careful grid bounds
- Periodicity: Trigonometric functions need sufficient domain to show 1–2 complete cycles
See Also¶
- Function — Enter function equations (not draw)
- Math Entry — Entering mathematical expressions
- Graph/Table Macros — Display graphs in your question text