WeBWorK Problems

PGML Matrix answers

PGML Matrix answers

by David Gilliam -
Number of replies: 5

In the PGML example p08.pg an answer involving a matrix in array form is requested using

BEGIN_PGML
[`[$M] = `][___]*{$M}
END_PGML

This works but, on our system, produces an warning message 

Warning -- there may be something wrong with this question. Please inform your instructor including the warning messages below.

Warning messages

  • ans_label AnSwEr0001 MaTrIx_AnSwEr0001__0_1 at line 933 of (eval 9890)
  • ans_label AnSwEr0001 MaTrIx_AnSwEr0001__1_0 at line 933 of (eval 9890)
  • ans_label AnSwEr0001 MaTrIx_AnSwEr0001__1_1 at line 933 of (eval 9890)
Other than removing the * to accept answers inserted using inline matrix syntax, is it possible to eliminate the warning?

In reply to David Gilliam

Re: PGML Matrix answers

by Davide Cervone -
It looks like there are some debugging messages that have been left in PGbasicmacros.pl. In particular, in the NAMED_ANS_ARRAY_EXTENSION routine, there is a warn command that I think is producing this (it is as line 948 of my copy, but looks like 933 in yours).

If you edit pg/macros/PGbasicmacros.pl to remove (or comment out) that line, I think that will take care of it. If you don't have access to edit it, make a copy of it in your course's templates/macros and edit it there. (I don't think this is one of the preloaded macro files that would require restarting the server, so I think that should work).

@Mike, can these warning messages be removed? I see there are a number of them still in the code.

In reply to Davide Cervone

Re: PGML Matrix answers

by Michael Gage -
I'm sure the warning messages can be removed.

Could you remove them or comment them out and then submit a pull request 
to ww2.5.1.1 (and ww2.5.1.3 while you are at it ) on openwebwork/pg-dev

and I'll merge the pull request.

-- Mike

In reply to Michael Gage

Re: PGML Matrix answers

by David Gilliam -
Davide and Mike

Thanks that worked.  I did not actually  make the changes but Bob Byerly did and there is no longer any warning. 



In reply to Michael Gage

Re: PGML Matrix answers

by Davide Cervone -
I only see ww2.5.1.1 and ww2.5.1.3 branches in webwork2-dev, not pg-dev. There is only one branch there (master). So I should pull request for that?
In reply to Davide Cervone

Re: PGML Matrix answers

by Michael Gage -
Yes.  the changes to PG-dev have been small and incremental so I haven't seen a need to create versions.  

I did have three versions of PG for a while but they were always identical and updating all three every time something was added became a burden. If some big change happens in PG we can create a new branch but just adding the little changes incrementally to master seems to be working for now.