[ww-bugs] Bug 3551: LinearInequality not working

bugzilla-daemon at webwork.maa.org bugzilla-daemon at webwork.maa.org
Sun Dec 20 14:52:25 EST 2015


http://bugs.webwork.maa.org/show_bug.cgi?id=3551





--- Comment #4 from Mike Gage <gage at math.rochester.edu>  2015-12-20 14:52:23 ---
I think the following behaves the way you want it to. It only uses
parserLinearInequality. 
 I don't yet understand the conflict between parserLinearInequality and
contextInequalities yet.  

The original use case for parserLinearInequality was to specify a system of
constrain inequalities for a linear programming problem. 

DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGML.pl",
"parserLinearInequality.pl",
);
TEXT(beginproblem());

Context("LinearInequality");
Context()->constants->remove('pi');
Context()->variables->are('pi'=>['Real','TeX'=>'\pi'],'phat'=>['Real','TeX'=>'\widehat{p}']);

$ans1 = Compute("phat = 0.62");
$ans2 = Compute("pi = 0.5");
$ans3 = Compute("pi > 0.5");

BEGIN_PGML
# Answer checker allows incorrect variable names #

+ Observed sample statistic (correct answer [$ans1]) [_____________] Try
entering [| pi = 0.62 |] instead.
+ Null hypothesis (correct answer [$ans2]) [_____________] 
Try entering [| phat = 0.5 |] instead.
+ Alternative hypothesis (correct answer [$ans3]) [_____________]  Try entering
[| phat > 0.5 |] instead.

---
END_PGML

ANS( $ans1->cmp, $ans2->cmp, $ans3->cmp );

ENDDOCUMENT();

-- 
Configure bugmail: http://bugs.webwork.maa.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the webwork-bugs mailing list