WeBWorK Problems

Gateway Quiz Problems --- What precisely can't I do?

Re: Gateway Quiz Problems --- What precisely can't I do?

by Davide Cervone -
Number of replies: 0
I'm glad that you figured out the problem. (You had done so before I had the chance to point that out to you.)

This has to do with the fact that there are two implementations for Matrices in WeBWorK: the MathObject matrices that you get with Context("Matrix") and the traditional ones you get from the Perl Matrix package. The latter do now know about MathObjects, and since the basis_cmp() macro uses the traditional matrices, the error you are getting is due to that incompatibility. That is one reason you can't pass a MathObject Matrix to basis_cmp() directly.

You are correct to use the value() method of the MathObject Matrix entries to get the perl reals rather than MathObjects. (Note that in your original, the Real() around the element extraction was redundant, since the Matrix entries are already MathObject Reals).

A number of the matrix macros need to be updated to work with MathObject Matrices (or the MathObject Matrices could be updated to include methods that correspond to those older macros).