To implement the requirements mentioned in the question, we can create the following tables in Laravel:
-
exams: This table will store the details of each exam, such as the name, date, time, acceptance rate, and duration.
-
questions: This table will store the questions uploaded by the exam organizer. Each question will have a unique ID, the question text, the correct answer, and the score.
-
question_bank: This table will store the questions uploaded as a group, such as an Excel file. Each question group will have a unique ID, the name of the group, and the file path.
-
video_questions: This table will store the video questions uploaded by the exam organizer. Each video question will have a unique ID, the name of the video, the file path, and the score.
-
participants: This table will store the details of each participant, such as their name, email, and password.
-
exam_participants: This table will store the details of each participant who has taken the exam. It will have a foreign key to the exams table and the participants table. It will also store the participant's score and whether they passed or failed the exam.
To implement the random or in-order movement of questions, we can add a column to the exams table called "question_movement" and set it to either "random" or "in-order".
To implement the percentage of participants and acceptance rate, we can calculate these values based on the data in the exam_participants table.
Here is an example migration for the exams table:
Schema::create('exams', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->date('date');
$table->time('time');
$table->integer('acceptance_rate');
$table->integer('duration');
$table->enum('question_movement', ['random', 'in-order']);
$table->timestamps();
});
And here is an example migration for the questions table:
Schema::create('questions', function (Blueprint $table) {
$table->id();
$table->text('question_text');
$table->text('correct_answer');
$table->integer('score');
$table->timestamps();
});
We can create similar migrations for the other tables mentioned above.