I'm trying to write a question that takes one answer from a student, compares it with two correct possibilities and then grades the students answer correct if it matches either correct answer.
I have an idea that i should be using multianswer but am struggling. I've used the checker and adapted is as follows
$multians = MultiAnswer($ans1, $ans2)->with(
singleResult => 1,
checker => sub {
my ( $correct, $student, $self ) = @_;
my ( $f1stu ) = @{$student};
my ( $f1, $f2 ) = @{$correct};
if ( ($f1 == $f1stu || $f2 == $f1stu) ) {
return [1];
} else {
return [0];
}
}
);
Any insight is gratefully recieved