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();