You're not reading the latest revision of this page, which is here.

Randomquestionpool

With the help of \randomquestionpool it is possible to select from a multitude of questions always exactly the same
number for each student.

You use \randomquestionpool to define question groups. A question for the student is selected from each group.
Each question can be of different types. The system randomly selects a question from each group.

Each group is defined by the indices of the questions.

1
\randomquestionpool{start}{end} --> \randomquestionpool{2}{5}

Here, questions 2, 3, 4 and 5 are grouped together.
The student will see either the 2nd, 3rd, 4th or 5th question.

Warning: If \randomquestionpool is specified, then only questions that are in the range of the indices are included. So questions that should be always displayed have to get their own "questionpool", e.g. by \randomquestionpool{1}{1} for the very first question.
CAUTION: The effect is not seen when randomquestionpool is deactivated (e.g. in webmiau-preview). You need to put this on a server with randomquestionpool activated.

A similar functionality is offered for quickchecks by \randomquickcheckpool. For examples, see Quickchecks.

Example

Here you can see an example of 4 different questions.
Two question pools are formed.

The first pool contains questions 1 and 2.
The second pool contains questions 3 and 4.

The student sees either the 1st or 2nd question as question 1 and either the 3rd and 4th question as question 2.

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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
\begin{problem}
 
  \randomquestionpool{1}{2}
  \randomquestionpool{3}{4}
 
  \begin{question} % Question 1
 
    \type{mc.multiple}
 
    \lang{de}{
      \text{Frage 1}
      \explanation{Die Erklärung}
    }
 
    \lang{en}{
      \text{Question 1}
      \explanation{Explanation}
    }
 
    \begin{choice}
      \text{$-5 = -5$}
      \solution{true}
    \end{choice}
 
    \begin{choice}
      \text{$5 = |-5|$}
      \solution{true}
    \end{choice}
 
    \begin{choice}
      \text{$5 = -5$}
      \solution{false}
    \end{choice}
 
  \end{question}
 
 
  \begin{question} % Question 2
 
    \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}   
 
    \lang{de}{
      \text{Gegeben sind:\\ $\vec{v1} = \var{v1}, \vec{v2} = \var{v2}$}
    }
 
    \lang{en}{
      \text{Given:\\ $\vec{v1} = \var{v1}, \vec{v2} = \var{v2}$}
    }
 
    \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}
 
 
  \begin{question} % Question 3
    \type{input.interval}
 
    \text{Write down the Interval from 1 to 3:}
    \field{rational}
 
    \begin{answer}
      \text{ A = }
      \solution{[1;3]} % or ] for open type, the boundaries should be separated by ";"
    \end{answer}
 
  \end{question}
 
 
  \begin{question} % Question 4
 
    \begin{variables}
      \number{a}{1/2}
      \number{b}{1/3}
      \number{c}{1/5}
    \end{variables}
 
    \lang{en}{
      \text{\textit{Write the set $A$ of numbers $\var{a}$, $\var{b}$, and
        $\var{c}$}:}
    }
 
    \lang{de}{
      \text{\textit{Schreibe die Menge $A$}:}
    }
 
    \type{input.finite-number-set}
    \field{rational}
 
    \begin{answer}
      \text{$A =$}
      \solution{a, b, c}
    \end{answer}
 
  \end{question}
 
 
\end{problem}

Other examples

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
% The following *3* questions would be selected by the system due to the 3 randomquestionpools:
%  # Question: Either question 1, question 2 or question 3
%  # Question: 4 or 5
%  # Question: 6 or 7
 
\begin{problem}
   \randomquestionpool{1}{3}
   \randomquestionpool{4}{5}
   \randomquestionpool{6}{7}
 
  \begin{question}
    ... % Question 1
  \end{question}
 
  \begin{question}
    ... % Question 2
  \end{question}
 
  \begin{question}
    ... % Question 3
  \end{question}
 
  \begin{question}
    ... % Question 4
  \end{question}
 
  \begin{question}
    ... % Question 5
  \end{question}
 
  \begin{question}
    ... % Question 6
  \end{question}
 
  \begin{question}
    ... % Question 7
  \end{question}    
 
\end{problem}
1
2
3
4
% The following (one) question would randomly select the system based on the (one) randomquestionpool:
%  # Question: Either question 1, question 2, question 3, question 4, question 5, question 6 or question 7
 
\randomquestionpool{1}{7}
1
2
3
4
5
6
7
8
9
10
% *4* questions are randomly selected from the 4 randomquestionpools:
%   # Question: question 1
%   # Question: 2 or 3
%   # Question: question 4
%   # Question: Either question 5, question 6 or question 7
 
\randomquestionpool{1}{1}
\randomquestionpool{2}{3}
\randomquestionpool{4}{4}
\randomquestionpool{5}{7}
1
2
3
4
5
6
7
8
% The following 3 questions would randomly select the system due to the 3 randomquestionpools:
%   # Question: 2 or 3
%   # Question: question 4
%   # Question: Either question 5 or question 6
 
\randomquestionpool{2}{3}
\randomquestionpool{4}{4}
\randomquestionpool{5}{6}

Question 1 and question 7 in the code would not be displayed by the system.