# Composing Multiple Online Exams: The Bees Algorithm Solution
## 1 Introduction
The motivation for employing the BA algorithm lies in its ability to effectively tackle real-world problems that have proven challenging for other classical algorithms [8]. This algorithm, in particular, demonstrates promise in addressing combinatorial optimization problems [7]. Moreover, for the multiple-exam composition problem specifically, we opted for the BA for two primary reasons. Firstly, despite its popularity and simplicity, the BA has not been previously applied to solve this particular problem, unlike other well-known methods such as Simulated Annealing (SA) [9], the Genetic Algorithm (GA) [10], Particle Swarm Optimization (PSO) [2; 11; 12], and Ant Colony Optimization (ACO) [13]. Secondly, we believe that the BA possesses an inherent advantage over other methods which directly aligns with the multiple-exam composition problem. Specifically, it naturally selects the best and elite solutions as part of its optimization process, thereby readily generating multiple exams (i.e., solutions) in each run. In other words, the BA does not require any additional steps to generate multiple tests simultaneously, as seen in other algorithms, such as the random algorithm [14], SA [9], GA [10], and ACO [13], which involve repeating runs and/or sorting the population to select the best individuals, or incorporating parallelization, as in PSO [2; 11; 12]. The problem tackled in this research is defined as follows [15]:  
Let a question bank \(QB=\{Q_{1},\ Q_{2},\ Q_{3},\ldots,Q_{k}\}\) and the generated test \(T_{i}\ =\ \{Q_{1},\ Q_{2},\ Q_{3},\ldots,Q_{n}\}\) where \(n\leq k\). The difficulty level requirement of the exam set by the educator is \(DLR\in[0,1]\); the difficulty level of each question, \(DLx\in[0,1]\), is also determined by the educator. Moreover, each question belongs to a certain chapter (part). The objective function that determines the quality of the solution (exam) computes the average of the difficulty values of all questions in the exam and then compares it to the required difficulty level \(DLR\), as shown in Equation (1) [15]. \[f(Q_{ij}\cdot DL)=\left|\frac{\sum_{j=1}^{n}Q_{ij}\cdot DL}{n}-DLR\right| \tag{1}\]  
where \(Q_{ij}\cdot DL\) represents the difficulty level of question \(Q_{ij}\). The smaller \(f\big{(}Q_{ij}\cdot DL\big{)}\) becomes, the better the fitness of the solution. In addition, each generated exam must adhere to the following constraints, where C1, C2, and C3 are hard (i.e., mandatory) constraints, while C4 is a soft (i.e., desired but not mandatory) constraint:  
C1: Each question in the exam must be unique. C2: The difficulty level of each question should not be concentrated around the required difficulty level of the exam, ensuring diversity. In other words, selecting questions all of the same difficulty level for the test is not allowed. C3: The number of questions extracted from each chapter (or section) must match the desired number specified by the educator. C4: To generate multiple exams while ensuring a high level of uniqueness in each test, it is desirable to restrict the percentage of overlapping questions between tests. The acceptable overlap percentage can be determined using Equation (2). This approach guarantees that the exams exhibit minimal redundancy and maintain a diverse collection of questions. Following [2], the maximum acceptable overlap percentage is 0.3. Assuming we have \(m\) generated tests, the overlap percentage \(P_{test}\) between the \(m\) tests is calculated as follows:  
\[P_{test}=\frac{O-U}{m\cdot n}\cdot 100 \tag{2}\]  
where  
* \(O\) is the number of overlapping questions between all tests;
* \(U\) is the number of unique questions within \(O\);
* \(m\) is the number of tests generated;
* \(n\) is the number of questions in each test. The \(O-U\) term accounts for the diversity of the questions involved in the overlapping count. Its purpose is to slightly mitigate the impact of overlap when the questions involved in the overlapping count are different.