### Re: how to Compute |x| > 6 in webwork answer

by D. Brian Walton -The Inequalities context is not designed for the problem you are trying to write. It is designed to describe basic intervals, and not generic inequalities. For example, suppose I want the student to describe the interval [1,5]. They might answer the interval directly as "[1,5]". But they might also want to represent it in inequality form as "x >= 1 and x <= 5". The Inequalities context allows this to happen, as well as allowing the author to describe intervals through basic inequalities. It does not deal with solving inequalities.

When I write problems where I want the student to give me the absolute value inequality, I use a three-part answer. I have done a similar problem where I have an answer blank followed by a pop-up menu followed by another answer blank with instructions that the first answer blank needs to be an absolute value of something.

The solution checker verifies that the actual formulas in the blanks agree with what I am expecting and that the correct inequality was selected in the popup menu.

Here is an example problem I used, modified to be cleaner here so it doesn't have any random aspect.

DOCUMENT(); # First line

loadMacros(

"PGstandard.pl",

"MathObjects.pl",

"parserPopUp.pl",

);

TEXT(beginproblem);

$c = Real(3);

$delta = Real(2);

$a = $c-$delta;

$b = $c+$delta;

$popup = PopUp(["?", ">", ">=", "<", "<="], "<=");

BEGIN_TEXT

Rewrite the statement \(x \in [$a,$b]\) as a distance inequality of the form

\(|x-c| >_{\ge} \delta\) or \(|x-c| <_{\le} \delta\).

$PAR

\(|x - \)\{ ans_rule(5) \}\(|\) \{ $popup->menu() \} \{ ans_rule(5) \}

END_TEXT

###################################

# Answer checking

ANS( $c->cmp, $popup->cmp, $delta->cmp );

ENDDOCUMENT(); # Last line.