Skip to content

List inside a RadioMultiAnswer not working if the list has only one thing. #1349

@Alex-Jordan

Description

@Alex-Jordan

I think this is an issue with parserRadioMultiAnswer.pl. But maybe with Lists.

Consider the exercise below. Imagine a problem where you ask if the MVT applies to a function on a certain closed interval or not. The first option is something like "The MVT does not apply.". The second option is for when it does apply, and there is a list of numbers c where f'(c) = (f(b) - f(a))/(b - a).

That answer blank should expect a List. And for the problem in question, it turns out the list only has one element. Then the problem is not accepting the correct answer as correct.

DOCUMENT();

loadMacros(qw(PGstandard.pl PGML.pl parserRadioMultiAnswer.pl));

Context("Numeric");

$list = List(Real(1));
$list2 = List(Real(1),Real(2));

$rma = RadioMultiAnswer([
    ['No numbers.'],
    ["The list \($list\):$BR %s", $list]
], 1);

BEGIN_PGML
[_]{$rma}
END_PGML
ENDDOCUMENT();

If there are two numbers in the list, then it's OK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions