# Create Matrix Questions

When you create a matrix question, you have the option to use an expandable or static matrix in your answer key. By default, matrix answer keys are expandable, which means you are not providing the dimensions of the answer matrix to your students.

1. Click Questions > Create.
The Question Editor opens.
2. In Name, type a name for the question.
3. In Mode, select Fill in the Blank.
4. In Question, type your question.
Note An asterisk (*) must be used for multiplication in variable expressions. For an example of this requirement, see question 2431015, ExpandableMatrixExample 1.1.007. in WebAssign.
1. Set the variables in the question using Perl statements. For more information, see Set Perl Variables.

For example:


<eqn>
($a,$b) = pick(2, 2..9);
''
</eqn>

2. Create the question using WaTeX notation. For more information on the general syntax, see Create WaTeX Arrays and Matrices.

For example:


Find the product: <watex>$\begin{matrix}{rrr}{2} 1 & a & 2 \\ b & 0 & 1 \end{matrix} \begin{matrix}{rr}{3} -1 & 0 \\ 0 & 5 \\ 1 & 1 \end{matrix}.$</watex><br />
(Use the green arrows to change the dimensions of your answer matrix.)

3. Using the following parameters, create the answer blank in matrix form <_ matrix_mode='mode' matrix_dimensions='RxC'>, where mode is the display value and RxC is the number of rows and columns:
• matrix_mode is a required parameter and sets the visual presentation using one of four values:
• matrix_mode='matrix' displays the matrix in expandable columns and rows
• matrix_mode='determinant' displays the matrix as an expandable determinant matrix
• matrix_mode='columnvectors' displays the matrix as expandable column vectors
• matrix_mode='rowvectors' displays the matrix as expandable row vectors
• matrix_dimensions is a required parameter and determines how many rows and columns are initially displayed to the student. For example, matrix_dimensions='4x2' means the initial matrix will have 4 rows and 2 columns. Values 1-8 are supported.
• matrix_label is an optional parameter that adds labels (in plain text format) to the matrix. The position and type of label depends on the matrix mode.
• matrix_static is an optional parameter set to true to make a matrix static (non-expandable). If this is not set, the matrix is expandable by default.

For example:


<_ matrix_mode='matrix' matrix_dimensions='3x3'>

The example code in the Question block now looks like this:

<eqn>
($a,$b) = pick(2, 2..9);
''
</eqn>

Find the product: <watex>$\begin{matrix}{rrr}{2} 1 & a & 2 \\ b & 0 & 1 \end{matrix} \begin{matrix}{rr}{3} -1 & 0 \\ 0 & 5 \\ 1 & 1 \end{matrix}.$</watex><br />
(Use the green arrows to change the dimensions of your answer matrix.)

<_ matrix_mode='matrix' matrix_dimensions='3x3'>

5. In Answer, type the answer to the question. You must use <EQN $MATRIX=1;''> to initiate the matrix mode followed by your answer_key. For example:  <EQN$MATRIX=1; '';>[1, <EQN 2+5*$a>; <EQN 1 -$b>, 1]

You can view this example question in WebAssign: 2645454, Test Matrix Mode Instructions 001.
6. Optional: Type a Solution.

The solution helps your students understand the steps they need to take to determine the correct answer to the question. Your assignment settings specify when to show the solution.

7. Click Test/Preview to test the appearance and behavior of the question. See Test Questions.
8. Click Redisplay to show certain kinds of errors in the Display section of the Question Editor. Make any needed changes to your question.
9. Optional: Click Show Additional Information and change the question's sharing permission or add descriptive information.
• By default, other instructors can use your question only if you provide them with the question ID, and only you can edit the question or find it in search results. To change the permission, see Share Questions With Other Instructors.
• If you make your question publicly available, you might want to provide descriptive information to help others search for it. See Add Search Metadata to Questions.
10. When your question displays and functions correctly, click Save.

WebAssign assigns it a unique question ID (QID), which is displayed in parentheses after the question name.

You can use your question in an assignment and see it in your My Questions list only after it is saved.

## Example Question using an Expandable Matrix

The following table summarizes an actual question.

 QID 4550735 Template2 7.MATRIX.01. Fill in the Blank  $a31 = randnum(2, 4, 1);$a32 = 3*$a31;$a34 = 5*$a31;$c1 = randnum(4, 7, 1); $d2 = randnum(2, 5, 1);$c2 = 2*$c1 +$d2; $c3 =$c1*\$a31; '' Consider $\begin{matrix}{r}{3} 1 & 3 & 0 & 5 & \\ 2 & 6 & 1 & 8 & \\ & & 0 & & \end{matrix}.$ Find the reduced row echelon form of this matrix.
<_ matrix_mode='matrix' matrix_dimensions='3x5'> [1, 3, 0, 5, ; 0, 0, 1, -2, ; 0, 0, 0, 0, 0]