I am making a scaffolding problem. The first step of the problem includes some fill-in-the-blank questions, and the second step asks students to fill in a table. When I tested the problem, the answer checker checks the answers from the first step at the end, and it checks the answers of the table first. As a result, it does not check properly. If the fill-in-the-blank questions come after the table, there is no issue. Here is my code:
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGML.pl",
"scaffold.pl",
"PGcourse.pl"
);
TEXT(beginproblem());
###########################
# Setup
Context()->strings->add(T => {}, F => {});
$table1 = $BCENTER.begintable(3) .
row( "\(p\)", "\(q\)", " \(p \vee q\) ") .
row( ans_rule(5), ans_rule(5), ans_rule(5),) .
row( ans_rule(5), ans_rule(5), ans_rule(5),) .
row( ans_rule(5), ans_rule(5), ans_rule(5),) .
row( ans_rule(5), ans_rule(5), ans_rule(5),) .
endtable().$ECENTER;
@answer1 = ("T", "T", "T",
"T", "F", "T",
"F", "T", "T",
"F", "F", "F",
);
###########################
# Main text
Scaffold::Begin();
Section::Begin("Step 1");
BEGIN_PGML
[`x = `] [__________]{1}
[`y = `] [__________]{0}
END_PGML
Section::End();
Section::Begin("Step 2");
BEGIN_PGML
[@ $table1 @]***
END_PGML
foreach my $i (0..$#answer1) {
ANS( String($answer1[$i])->cmp() );
}
Section::End();
Scaffold::End();
ENDDOCUMENT();