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.

How-ToInstructor HelpWebAssign
  1. Click Questions Create.

    The Question Editor opens.

  2. In Mode, select Fill in the Blank.

  3. In Question, type your question.

    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'>
         
  4. 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.

  5. 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.

Example Question using an Expandable Matrix The following table summarizes an actual question. QID 4550735 Name Template2 7.MATRIX.01. Mode Fill in the Blank Question <eqn> $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; '' </eqn> Consider <watex>\[ \begin{matrix}{r}{3} 1 & 3 & 0 & 5 & <eqn $c1>\\ 2 & 6 & 1 & 8 & <eqn $c2>\\ <eqn $a31> & <eqn $a32> & 0 & <eqn $a34> & <eqn $c3> \end{matrix}. \]</watex> Find the reduced row echelon form of this matrix.<br /> <_ matrix_mode='matrix' matrix_dimensions='3x5'> Answer <EQN $MATRIX=1; '';>[1, 3, 0, 5, <EQN $c1>; 0, 0, 1, -2, <EQN $d2>; 0, 0, 0, 0, 0] Display to Students Matrix question displayed to students