## DESCRIPTION
## 
## ENDDESCRIPTION


## DBsubject(Algebra)
## DBchapter(Absolute value expressions and functions)
## DBsection(Absolute value inequalities)
## Date(06/02/2017)
## Institution(Red Rocks Community College, Colorado Community College System)
## Author(Brenda Forland)
## MO(1)
## KEYWORDS('college algebra','absolute value')


#######################################
#  Initialization


DOCUMENT();  

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"AnswerFormatHelp.pl",
"PGML.pl",
"PGchoicemacros.pl",
"PGcourse.pl",
);

TEXT(beginproblem());

###########################
#  Setup
$a = random(1,9,1);
do { $b = random(-9,9,1); } until ( $b != $a );

$ans1=Interval("($b-$a, $b+$a)");

$mc = new_checkbox_multiple_choice();
$mc -> qa (
"In absolute value notation, where \( x \) represents the numbers, this is:", 
"\( |x-$b| < $a \)$BR",                
);
$mc -> extra(
"\( |x-$b| > $a \)$BR",
"\( |x-$a| < $b \)$BR",
"\( |x-$a| > $b \)$BR",
);
$mc -> makeLast("None of the above");


###########################
#  Main text

BEGIN_TEXT
Find the interval(s) of numbers that are less than a distance of \( $a \) from \( $b \). Enter solution as an interval or union of intervals. 
$BR
$BR
\{ ans_rule(20) \}
\{ AnswerFormatHelp("intervals") \}
$BR
$BR
\{ $mc -> print_q() \}
$BR
\{ $mc -> print_a() \}
END_TEXT

############################
#  Answer evaluation

install_problem_grader(~~&std_problem_grader);

$showPartialCorrectAnswers = 1;

ANS($ans1->cmp());
ANS( checkbox_cmp( $mc->correct_ans() ) );
############################
#  Solution

#BEGIN_PGML_SOLUTION
#Solution explanation goes here.
#END_PGML_SOLUTION

COMMENT('Uses PGML.');

ENDDOCUMENT();