WeBWorK Problems

A failed attempt to use Gavin LaRose's Sample Problem 2

Re: A failed attempt to use Gavin LaRose's Sample Problem 2

by Davide Cervone -
Number of replies: 0
You have used the same variable ($radio) for both parts, and so when you use it in the second part, it wipes out the value from the first part. Since you don't print the text of the first part of set up its answer checkers until the end, you have lost that data when you initialize the second part.

I'd put the text of part 1 and its answer checkers right after initializing it, and before starting on part 2. I know Gavin's sample doesn't work that way, but I think that makes more sense, and avoid this type of error.

In the lastest version of PG there is now a BEGIN_SOLUTION/END_SOLUTION block that will make it easier (or at least prettier) to enter your solutions.

Davide