WeBWorK Problems

CompoundProblem5 bug

CompoundProblem5 bug

by Peter Staab -
Number of replies: 3
I'm trying to use the new version of compoundProblem (compoundProblem5.pl) and started with the documented one at http://webwork.maa.org/wiki/CompoundProblem5 and I'm running the latest version of the develop branch. 

If I walk through the problem, the 3rd section doesn't open.  Troubleshooting, it looks like at the end of the problem, it opens sections based on

$opensection = $last_correct_section + 1;
$scaffold->openSections($opensection);

and if I print out $opensection, then it equals 0 when the problem first loads, 1 after the correct answer is opened in the first sections, and remains 1 after the 2nd section is correctly solved.  
In reply to Peter Staab

Re: CompoundProblem5 bug

by Peter Staab -
It appears that the second section doesn't have a SECTION_ANS command.  Is this what's missing?
In reply to Peter Staab

Re: CompoundProblem5 bug

by Peter Staab -
That seems to be the problem.  I added the line:

SECTION_ANS($ans->cmp, $popup->cmp);

which seemed to fix the problem.  I'll go ahead and change the problem technique page as well. 
In reply to Peter Staab

Re: CompoundProblem5 bug

by Ian Delbridge -
Hi Peter,
I agree - you hit the nail on the head. 
I just added that page recently, so there likely are errors in it like the one you found. If you find any more, feel free to go ahead and change it yourself, or let me know so I can change it. 

-Ian Delbridge