Hello
I am trying to create a problem that uses checkboxes, but I am not able to set it up in such a way that students get partial marks for the correct selected answers. It is only marked correct if and only if all correct answers are selected (and full marks are awarded).
I have tried to use
install_problem_grader(~~&avg_problem_grader);
###########################
# Initialization
DOCUMENT();
loadMacros(
"PGstandard.pl",
"PGchoicemacros.pl",
"PGunion.pl",
"choiceUtils.pl",
"PGcourse.pl",
"PGML.pl",
);
TEXT(beginproblem());
###########################
# Setup
$mc = new_checkbox_multiple_choice();
$mc -> qa (
"Select all expressions that are equivalent to
\( (x+y)^2 \). There may be more than
one correct answer. $BR",
"\( x^2 + 2xy + y^2 \) $BR $BR",
"\( (x+y)(x+y) \) $BR $BR",
);
$mc -> extra(
"\( x^2 + y^2 \) $BR $BR",
);
$mc -> makeLast("None of the above");
###########################
# Main text
BEGIN_PGML
[@ $mc -> print_q() @]*
[@ $mc -> print_a() @]*
END_PGML
install_problem_grader(~~&avg_problem_grader);
ANS( checkbox_cmp( $mc->correct_ans() ) );
BEGIN_PGML_SOLUTION
The correct answer is [@ $mc->correct_ans() @]*.
END_PGML_SOLUTION
ENDDOCUMENT();