WeBWorK Problems

problemPanic.pl

problemPanic.pl

by Kenneth Appel -
Number of replies: 1
I am having difficulty getting problemPanic.pl to work and
think that I have narrowed things down.

Putting in the panic button causes no difficulty and if I just
put it in the problem works fine. When I try to add the
if($panic) section I get errors that I cannot figure out.

In particular, I added the following part immediately after an
END_TEXT and before the answers to an otherwise working problem (which had an operating) panic button.

if ($panic) {
BEGIN_TEXT
Hint: Such a set of (x,y) pairs is a function if the same value x never appears with two different values of y.
END_TEXT }

[I did not see the right curly bracket in the directions, but
if I did not put it in things seemed worse.]

Here is the error message (where line 53 is the BEGIN_TEXT after if($panic)

syntax error at (eval 11566) line 53, near "BEGIN_TEXT Hint:" Missing right curly or square bracket at (eval 11566) line 63, at end of line syntax error at (eval 11566) line 63, at EOF

What sin have I committed?
Ken
In reply to Kenneth Appel

Re: problemPanic.pl

by Davide Cervone -
The source of the error message is that you have put the close brace on the same line as END_TEXT, but END_TEXT must be on a line all by itself. The brace should be on the following line, as it is in the documentation. (It is in the documentation, but on the line following the END_TEXT.)

There is a second problem, which is my fault: the variable $panic should be $panicked and I listed it incorrectly in the documentation. I have corrected it in the CVS copy, so you should get that, but the on-line documentation won't be updated until tonight (it is updated nightly from the .pl files automatically).

Davide