[LON-CAPA-users] perl if statement with two conditions

ciskep lon-capa-users@mail.lon-capa.org
Wed, 14 Jun 2006 22:39:49 -0400


I am writing a problem containing an if statement with two conditions.

if ($z < $answer and $sym == "<") {$two = "true"}
elsif ($z > $answer and $sym == ">") {$two = "true"}
else {$two = "false"}

If $z is less than the answer and it is a less than statement it should be true.
 Also, if $z is greater than the answer and it is a greater than statement, it
is true.  Otherwise it is false.

This is not working, I have tried other variations without luck.  Does anyone
have a sugguestion.

Thank You
Paul Ciske