Dynamically setting size in matrix questions

Dear All,

I'm creating matrix questions and wish to dynamically set the size of the matrix. So I'm trying something like this:

\qutext{Find the transpose of the matrix $$A=\left[\begin{array}{ccc} 1 & 2 & 3\\ 0 & 1 & -2\end{array}\right]$$}

\code{$a=3;}

\size{$a}{2}
 

<snip>

But this doesn't seem to work.

 Thanks

 Colin

 

 

Something for the question editor.

I generated a question using the MathTA 3.01 question editor
that generates different sizes of matrices. Here is the code
it generated for finding the determinant of an nxn matrix. I
hope this contains what you want.

question=Find the determinant of $mathmlM .@
maple=evalb(simplify(($ANSWER)-($RESPONSE))=0);@
maple_answer=$ans;@
type=formula@
mode=Maple@
name=Matrix size@
editing=useHTML@
algorithm=$a=range(3,5,1);
$M=maple("LinearAlgebra:-RandomMatrix($a,$a);
");
$mathmlM=maple("printf(MathML:-ExportPresentation($M));
");
$ans=maple("LinearAlgebra:-Determinant($M)");@

Thanks, but..

Hi,

Thanks for the suggestion, but my problem is trying to dynamically set the size of the answer, as opposed to the initial matrix. In your example, the answer is always a text box.

Thanks

Colin

Setting size

What format do you want for the answer?

 

If you are willing to use Maple formating for the input, you can require the answer to be entered in the form "[[a,b,c],[d,e,f]]."  (This is almost identical to TI-89 format.)

You then need to set up the grading appropriately by converting to a Matrix, converting to another format, or checking entry byentry.

Thanks for your response

Thanks for your response Jay. Funnily enough, I'd just come up with the same solution as you had suggested.

Many thanks,

Colin

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}