WeBWorK Main Forum

Scaffold sections

Scaffold sections

by Andrew Dabrowski -
Number of replies: 3

I'm just starting the process of revising old problems to use scaffold.pl (rather than compoundProblem.pl).  But it seems that scaffold isn't working as advertised: later parts are open whether or not earlier parts have been completed successfully.  I saw a post here from a few years ago,

https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4004,

with the same complaint, for which the problem turned out to be registering the answers outside the section; but that doesn't seem to be the issue with me. 

Here's a MWE:


DOCUMENT();        

loadMacros(
  "PG.pl",
  "PGbasicmacros.pl",
  "PGanswermacros.pl",
  "scaffold.pl"
);

TEXT(&beginproblem);
    
Scaffold::Begin(can_open => "when_previous_correct");
Section::Begin("Part 1");

BEGIN_TEXT
    1+1=\{ans_rule(4)\}
END_TEXT

ANS(std_num_cmp(2) );
Section::End();

Section::Begin("Part 2");

BEGIN_TEXT
    2+2=\{ans_rule(4)\}
END_TEXT

ANS( std_num_cmp(4) );
Section::End();

Scaffold::End();

ENDDOCUMENT();      


In reply to Andrew Dabrowski

Re: Scaffold sections

by Glenn Rice -
This seems to work correctly for me. What version of PG are you using? Is this in a homework set, or in a gateway quiz?

Also, check to make sure that you don't have a local version of the scaffold.pl file somewhere earlier in the macro directory search order that is being used instead of the default one in /opt/webwork/pg/macros. For example the the courses templates/macros directory.
In reply to Glenn Rice

Re: Scaffold sections

by Andrew Dabrowski -
I have PG-2.13. I have never used scaffold before so I don't see how I could have another copy anywhere; a search turned none up, certainly none in templates/macros.

neither answered, both open