Hello,
I'm writing my first WW problem (a work in progress; see below) and it seems to work ok, but for some reason when I try to click on the "Randomize" link when viewing the problem in the library browser I get an error:
"434 setmaker.js: /webwork2/instructorXMLHandler: Forbidden"
I can use the "Randomize" link for other problems in the library, but not for this one. I can get WW to generate various randomizations of the problem by editing the problem and using the view option (where you can specify a seed).
Does anyone know why I'm earning the warning above? Thanks!
--Keir
(I'm also happy to hear from anyone who wants to tell me how to better construct this problem.)
#########
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGML.pl",
"PGcourse.pl",
"contextFraction.pl",
"parserPopUp.pl",
);
$showPartialCorrectAnswers = 1;
TEXT(beginproblem());
Context("Fraction-NoDecimals");
$b = non_zero_random(-6,6);
$d = non_zero_random(-6,6);
do {
$a = non_zero_random(-6,6);
$c = non_zero_random(-6,6);
} until $c != $a;
Context()->variables->add(k=>"Real");
Context()->variables->add(h=>"Real");
Context()->variables->add(y=>"Real");
$k_cutoff = Formula("$a * $d / ($c * $b)")->reduce();
$h_cutoff = Formula("$k_cutoff / (1 - $c / $a)")->reduce();
$popEQ = PopUp(["select","=","≠"], "=");
$popNEQ = PopUp(["select","=","≠"], "≠");
$LHS1 = Formula("$a * x + $b *k* y")->reduce();
$LHS2 = Formula("$c * x + $d * y")->reduce();
BEGIN_PGML
Consider the linear system [```\begin{array}{rl}[$LHS1] &= h \\[$LHS2] &= h -k \\\end{array}```] In the parts below, if you think that [``h``] can be any real number, then input [``h = ``] ANY.
(a) Find all values of [``k``] and [``h``] so that the system has no solution.
[``k``] [@ $popEQ->menu() @]* [_____] and [``h``] [@ $popNEQ->menu() @]* [_____]
(b) Find all values of [``k``] and [``h``] so that the system has a unique solution.
[``k``] [@ $popNEQ->menu() @]* [_____] and [``h``] [@ $popEQ->menu() @]* [_____]
(c) Find all values of [``k``] and [``h``] so that the system has infinitely many solutions.
[``k``] [@ $popEQ->menu() @]* [_____] and [``h``] [@ $popEQ->menu() @]* [_____]
END_PGML
ANS($popEQ->cmp());
ANS($k_cutoff->cmp());
ANS($popNEQ->cmp());
ANS($h_cutoff->cmp());
ANS($popNEQ->cmp());
ANS($k_cutoff->cmp());
ANS($popEQ->cmp());
Context()->strings->add(ANY=>{});
ANS(String("ANY")->cmp());
ANS($popEQ->cmp());
ANS($k_cutoff->cmp());
ANS($popEQ->cmp());
ANS($h_cutoff->cmp());
# For the solution.
$b2 = Formula("($b/$a)*k")->reduce();
$d2 = Formula("$d - ($c * $b/$a)*k")->reduce();
$aug1 = Formula("h/$a")->reduce();
$aug2 = Formula("(1 - [$c]/[$a])*h - k")->reduce();
$sf = Formula("1/[$a]")->reduce();
BEGIN_PGML_SOLUTION
The augmented matrix for the given linear system is [```\left[ \begin{array}{rrr} [$a] & [$b]k & h \\ [$c] & [$d] & h - k \end{array}\right].```]
We may row reduce the matrix to obtain (e.g., scale the top row [``R_1``] by [``[$sf]``], then replace the second row [``R_2``] with [``R_2 - ([$c])R_1``]): [```\left[ \begin{array}{rrr} 1 & [$b2] & [$aug1] \\ 0 & [$d2] & [$aug2] \end{array}\right].```]
If [``[$d2] \neq 0``] ([``k \neq [$k_cutoff]``]), then the system will be consistent for any value of [``h``]. If [``[$d2] = 0``] ([``k = [$k_cutoff]``]), then the system has infinitely many solutions if [``[$aug2] = 0``] ([``h = [$h_cutoff]``]) and has no solutions (is inconsistent) if [``[$aug2] \neq 0``] ([``h \neq [$h_cutoff]``]).
END_PGML_SOLUTION
ENDDOCUMENT();