WeBWorK Problems

PGML and perl array elements

PGML and perl array elements

by Alex Jordan -
Number of replies: 1
Hello,

I've been unable to reference an array element within math mode within PGML. Here is a minimal example, with various things I have tried, none o which work:

for my $i (0..2)
{$a[$i] = random(2,8,1);}

BEGIN_PGML

[`[$a[0]]`]

[:[$a[0]]:]

[`[$a[[0]]]`]

[:[$a[[0]]]:]

END_PGML

Is it possible to reference perl array elements using PGML?
In reply to Alex Jordan

Re: PGML and perl array elements

by Davide Cervone -
Looks like there is a problem with this. I'll have to check into it further. In the meantime, try
    [@ $a[0] @]
which I think will work, for you.

Davide