Part 12: MixedAnswerTypes¶
With the Miau release 2.14 Authors can set the type of an answer. This way, it is possible to create a question with have different types of answers.
Notice that some features like \permuteAnswers won't be available if a question has different types of answers.
- question-environment(default answer type): this is optional and will be used as the default answer type
- answer-environment(answer type): if not specified, the default answer type will be used
Make sure you have a default answer type or you have to specify the type in every answers.
Example:
\begin{problem} \begin{question} \begin{variables} \randint[Z]{a}{-3}{3} \randint[Z]{b}{1}{5} \randint[Z]{c}{1}{2} \randint[Z]{d}{1}{5} \randint[Z]{f}{-5}{5} \matrix[calculate]{v1}{a\\b\\c} \matrix[calculate]{v2}{d\\f\\0} \matrix[calculate]{cr}{-c*f\\c*d\\(a*f)-(d*b)} \function[calculate]{dot}{a*d+b*f} \end{variables} \type{input.matrix} %optional, this will be the default answer type. \field{real} \text{Gegeben sind:\\ $\vec{v1} = \var{v1}, \vec{v2} = \var{v2}$} \explanation{} \begin{answer} %First answer with default type input.matrix \text{$\vec{v1} \times \vec{v2} = $} \solution{cr} \format{3}{1} \end{answer} \begin{answer} %Second answer with type input.number \type{input.number} %set a different answer type than the default type \text{$\vec{v1} \cdot \vec{v2} =$} \solution{dot} \end{answer} \end{question} \end{problem}
Using MC-types as answer type:
\begin{answer} \type{mc.multiple} \lang{de}{\text{W\"{a}hlen Sie alle richtigen Aussagen aus:}} \lang{en}{\text{Select all the correct statements:} } \permutechoices{1}{5} \begin{choice} \lang{de}{\text{$\var{a}$ ist eine nat"urliche Zahl.}} \lang{en}{\text{$\var{a}$ is a natural number.}} \solution{compute} \iscorrect{a}{>}{0} \end{choice} \begin{choice} \lang{de}{\text{$\var{b}$ ist eine rationale Zahl.}} \lang{en}{\text{$\var{b}$ is a rational number.}} \solution{true} \end{choice} \begin{choice} \lang{de}{\text{$\frac{\var{c3}}{\var{c2}}$ ist eine ganze Zahl.}} \lang{en}{\text{$\frac{\var{c3}}{\var{c2}}$ is an integer.}} \solution{true} \end{choice} \begin{choice} \lang{de}{\text{$\var{d1}\cdot (-\var{d2})$ ist eine nat"urliche Zahl.}} \lang{en}{\text{$\var{d1}\cdot (-\var{d2})$ is a natural number.}} \solution{compute} \iscorrect{d1}{<}{0} \end{choice} \begin{choice} \lang{de}{\text{$1:\var{n}$ ist eine ganze Zahl.}} \lang{en}{\text{$1:\var{n}$ is an integer.}} \solution{compute} % \iscorrect{n}{=}{1} \end{choice} \begin{choice} \lang{de}{\text{Keine der Aussagen ist richtig.}} \lang{en}{\text{None of the above statments is correct.}} \solution{false} \end{choice} \end{answer}