Answer is an inequality
Download file: InequalityAnswer.pg
DOCUMENT();
loadMacros('PGstandard.pl', 'PGML.pl', 'contextInequalities.pl', 'PGcourse.pl');
Preamble
The contextInequalities.pl macro must be loaded
Context('Inequalities-Only');
Context()->flags->set(formatStudentAnswer => 'parsed');
$a = random(3, 9);
$ans = Compute("x >= -10 / $a");
Setup
Require students to use inequalities by using
Context('Inequalities-Only'). Note that if
Context('Inequalities') is used instead, then students
could also enter answers using interval notation. For more details,
please see contextInequalities.pl.
The context flag formatStudentAnswer => 'parsed' is
used so that the student’s answer is left as a fraction rather than
reduced to a decimal.
BEGIN_PGML
Solve the inequality [``-[$a]x \leq 10``].
Enter your answer using inequality notation.
[_]{$ans}
[@ helpLink('inequalities') @]*
END_PGML
Statement
This is the problem statement in PGML.BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION ENDDOCUMENT();
Solution
A solution should be provided here.