As a first attempt, I made this problem:

*** BEGIN CODE ***

DOCUMENT();

loadMacros("PGstandard.pl",

"MathObjects.pl",

"PGML.pl");

Context("Vector");

$v1 = Vector(random(-10,10,1),random(-10,10,1),random(-10,10,1));

$v2 = Vector(random(-10,10,1),random(-10,10,1),random(-10,10,1));

TEXT(beginproblem());

BEGIN_PGML

[$v1] + [$v2] = [________]{Compute("$v1+$v2")}

END_PGML

ENDDOCUMENT();

*** END CODE ***

The trouble with this problem is that the student can enter a sum of two vectors as their answer, instead of calculating the sum and entering a single vector as an answer. In this problem I'm checking if the student understands how to add two vectors, so that's undesirable.

Reading the wiki, I found:

http://webwork.maa.org/pod/pg_TRUNK/macros/contextLimitedVector.pl.html

which made me think that I could fix the problem by inserting

Context("LimitedVector");

However, when I do that, I get an error message containing:

ERRORS from evaluating PG file: Unknown context 'LimitedVector' at line 136 of [PG]/macros/Parser.pl Died within main::Context called at line 8 of (eval 2165)What am I doing wrong?