Skip to content

Conversation

@mgage
Copy link
Member

@mgage mgage commented Mar 28, 2020

Fixes bug in convert_to_array_ref() which was interpreting old style matrices (wwMatrix or Real1Matrix) as MathObject matrices. this caused problems with display_matrix() when using old style matrices

Hot fix.

@mgage
Copy link
Member Author

mgage commented Mar 28, 2020

Test file:

DOCUMENT();

loadMacros(
"PG.pl",
"PGbasicmacros.pl",
"PGanswermacros.pl",
"PGmatrixmacros.pl",
"MathObjects.pl",
"problemRandomize.pl"
);

TEXT(beginproblem());
$showPartialCorrectAnswers = 1;

$dim = 2;

Context ("Matrix");
$L1 = new Matrix($dim,$dim); #creates wwMatrix
$L1->assign(1,1,5);
$L2 = Matrix("[[2,5],[2,7]]"); #creates Matrix MathObject

BEGIN_TEXT

L1 {ref($L1)} {display_matrix($L1)}
$PAR
L2 {ref($L2)} {display_matrix($L2)}
$PAR
Notice that both old style (wwMatrix) and MathObject (Value::Matrix) should work now with no warnings. With the bug the wwMatrix was not properly processed.
END_TEXT

ENDDOCUMENT();

@mgage mgage requested review from drgrice1 and drjt March 28, 2020 03:30
@mgage
Copy link
Member Author

mgage commented Mar 28, 2020

Glenn. take a look and pull it if it seems ok.

Copy link
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@drgrice1 drgrice1 merged commit 5083fea into openwebwork:master Mar 28, 2020
@mgage mgage deleted the PG-2.15 branch May 19, 2020 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants