MatrixAnswer1
Paultpearson (Talk  contribs) m 
Paultpearson (Talk  contribs) (PGML example link) 

Line 6:  Line 6:  
</p>  </p>  
* File location in OPL: [https://github.com/openwebwork/webworkopenproblemlibrary/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/LinAlg/MatrixAnswer1.pg FortLewis/Authoring/Templates/LinAlg/MatrixAnswer1.pg]  * File location in OPL: [https://github.com/openwebwork/webworkopenproblemlibrary/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/LinAlg/MatrixAnswer1.pg FortLewis/Authoring/Templates/LinAlg/MatrixAnswer1.pg]  
+  * PGML location in OPL: [https://github.com/openwebwork/webworkopenproblemlibrary/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/LinAlg/MatrixAnswer1_PGML.pg FortLewis/Authoring/Templates/LinAlg/MatrixAnswer1_PGML.pg]  
<br clear="all" />  <br clear="all" /> 
Latest revision as of 15:45, 14 June 2015
Answer is a Matrix 1
This PG code shows how to evaluate answers that are matrices.
 File location in OPL: FortLewis/Authoring/Templates/LinAlg/MatrixAnswer1.pg
 PGML location in OPL: FortLewis/Authoring/Templates/LinAlg/MatrixAnswer1_PGML.pg
PG problem file  Explanation 

Problem tagging: 

DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "AnswerFormatHelp.pl", ); TEXT(beginproblem()); 
Initialization: 
Context("Matrix"); $A = Matrix([ [random(5,5,1),random(5,5,1),random(5,5,1)], [random(5,5,1),random(5,5,1),random(5,5,1)], ]); $B = Matrix([random(5,5,1),random(5,5,1),random(5,5,1)]); $answer = $A * ($B>transpose); 
Setup:
Use 
Context()>texStrings; BEGIN_TEXT Suppose \[ A = $A \ \ \mbox{and} \ \ B = $B. \] Evaluate the following matrix product. $BR $BR \( A B^T = \) \{ $answer>ans_array(5) \} \{ AnswerFormatHelp("matrices") \} END_TEXT Context()>normalStrings; 
Main Text:
Use the 
$showPartialCorrectAnswers = 1; ANS( $answer>cmp() ); 
Answer Evaluation: Use standard MathObject answer evaluation. 
Context()>texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()>normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT(); 
Solution: 