The question below expects 3 strings answers.....the letters l, t and r.
It keeps marking it wrong. How set up the PGML problem so that
it allows lists of string answers?
Thanks,
Chris
DOCUMENT();
loadMacros(
"MathObjects.pl",
"PGstandard.pl",
"PGML.pl",
"PGcourse.pl",
"parserNumberWithUnits.pl",
"contextArbitraryString.pl",
"parserMultiAnswer.pl",
"parserPopUp.pl",
);
TEXT(beginproblem());
$showPartialCorrectAnswers = 1;
######################################################################
Context("ArbitraryString");
@string_answers_t = ("t");
$strings_t = Compute("")->cmp(checker => sub {
my ($temp1, $response, $temp2) = @_;
$response =~ s/^~~s+|~~s+$//g;
$response = lc($response);
foreach (@string_answers_t) {
if ($response eq lc($_)) {
return 1;
}
}
return 0;
});
@string_answers_r = ("r");
$strings_r = Compute("")->cmp(checker => sub {
my ($temp1, $response, $temp2) = @_;
$response =~ s/^~~s+|~~s+$//g;
$response = lc($response);
foreach (@string_answers_r) {
if ($response eq lc($_)) {
return 1;
}
}
return 0;
});
@string_answers_l = ("l");
$strings_l = Compute("")->cmp(checker => sub {
my ($temp1, $response, $temp2) = @_;
$response =~ s/^~~s+|~~s+$//g;
$response = lc($response);
foreach (@string_answers_l) {
if ($response eq lc($_)) {
return 1;
}
}
return 0;
});
BEGIN_PGML
What are all the *consonants* in the word 'letter'?
[________________________]{List($strings_l, $strings_t, $strings_r)}
END_PGML
######################################################################
ENDDOCUMENT();