You can do this with a custom answer checker, as in the sample below. Note that by default WeBWorK doesn't check blank answers, so you need to include the "->withPreFilter('erase')" at the end to tell WeBWorK to still pass empty answers to the checker.
This was tested in 2.19, but I believe everything should work with 2.17.
Also note that this will only work in test mode, since all answers are submitted at once. If this is used in an assignment, then the student would only get the partial credit for questions where they clicked submit without choosing an answer.
DOCUMENT();
loadMacros(
"PGstandard.pl", # Standard macros for PG language
"PGML.pl", # PGML markup and Math Objects
"parserRadioButtons.pl",
"PGcourse.pl", # Customization file for the course
);
$rb = RadioButtons(
[ [ "Right", "Wrong1", "Wrong2", "Wrong3" ], "None of the above" ], 0)
->cmp(
checker => sub {
my ($correct, $student, $ansHash) = @_;
if ($correct == $student) {
return 1;
} elsif ($student eq '') {
return 0.3;
} else {
return 0;
}
}
)->withPreFilter('erase');
BEGIN_PGML
[_]{$rb}
END_PGML
ENDDOCUMENT();