mc.matrix

With the answer type mc.matrix you can arrange your multiple choice problem in a matrix layout.

012

Rows and columns can be permuted. That's optional, as are the title name for rows and the title name for columns.

  • \permuterows{min index}{max index}
  • \permutecolumns{min index}{max index}
  • \rowTitle{row title}
  • \columnTitle{column title}

The column labels are defined by the \tasks command. The labels are seperated by a semicolon. As usual
you can write TeX, math, use variables and image references as a label.

\tasks{column 1 label; column 2 label; ...} e.g.

1
\tasks{$e^x$; some text; function $\var{f}$;\image{image lid}}

Each row is defined in its own environment.

1
2
3
\begin{row}
    ...
\end{row}

The row labels are defined by the \text command inside a row environment. As usual you can write TeX, math, use
variables and image references as a label.

\text{row label}

Example code

(for result see screenshot above)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
\begin{question}
 
    \begin{variables}           
        \randint{a}{2}{7}
    \end{variables}
 
    \type{mc.matrix}
    \text{We are curious:}
    \explanation{Please reconsider your answer}
 
    \begin{answer}   
        \text{What do you think of the following functions?}
 
        \permuterows{1}{2} %optional
        \permutecolumns{1}{3} %optional
        \rowTitle{Properties} %optional
        \columnTitle{Functions} %optional
 
        % column 1-4 labels
        \tasks{$sin(\var{a}x)$;$e^x$; \image[100][100]{image1}}
 
        \begin{row}          
            % row 1 label
            \text{non periodic}
 
            \begin{choice}
                \solution{compute}
                \iscorrect{a}{<}{4}
            \end{choice}
 
            \begin{choice}
                \solution{true}
            \end{choice}
 
            \begin{choice}
                \solution{false}
            \end{choice}     
        \end{row}
 
        \begin{row}    
            % row 2 label
            \text{periodic}
 
            \begin{choice}
                \solution{true}
            \end{choice}
 
            \begin{choice}
                \solution{true}
            \end{choice}
 
            \begin{choice}
                \solution{true}
            \end{choice}              
        \end{row}
 
    \end{answer}
 
\end{question}