You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that in the quiz_questions a unique constraint is set on quiz_id and question_id.
2021_05_22_053359_create_quizzes_table.php
// Quiz Questions Table
Schema::create($this->tableNames['quiz_questions'], function (Blueprint $table) {
$table->id();
$table->foreignId('quiz_id')->nullable()->constrained($this->tableNames['quizzes'])->cascadeOnDelete();
$table->foreignId('question_id')->nullable()->constrained($this->tableNames['questions'])->cascadeOnDelete();
$table->unsignedFloat('marks')->default(0); //0 means no marks
$table->unsignedFloat('negative_marks')->default(0); //0 means no negative marks in case of wrong answer
$table->boolean('is_optional')->default(false); //0 means not optional, 1 means optional
$table->unsignedInteger('order')->default(0);
$table->timestamps();
$table->softDeletes();
$table->unique(['quiz_id', 'question_id']);
});
When a question is deleted by mistake it cannot be added anymore. I guess it would make sense to remove the unique constraint and handle this also with the validation. What do you think?
The text was updated successfully, but these errors were encountered:
I found that in the quiz_questions a unique constraint is set on quiz_id and question_id.
2021_05_22_053359_create_quizzes_table.php
When a question is deleted by mistake it cannot be added anymore. I guess it would make sense to remove the unique constraint and handle this also with the validation. What do you think?
The text was updated successfully, but these errors were encountered: