Refactor: Убран single_choice (частный случай multiple_choice)

 Все single_choice конвертированы в multiple_choice
 Отображение (radio/checkbox) зависит от кол-ва правильных ответов:
   - 1 правильный → radio (bi-circle)
   - 2+ правильных → checkbox (bi-check2-square)
 Обновлены миграции
 Обновлены view файлы

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
mirivlad
2026-03-27 09:55:33 +08:00
co-authored by Qwen-Coder
parent acf616fc08
commit 025b03c94b
4 changed files with 19 additions and 15 deletions
@@ -11,7 +11,7 @@ return new class extends Migration
Schema::create('questions', function (Blueprint $table) {
$table->id();
$table->foreignId('test_id')->constrained()->onDelete('cascade');
$table->enum('type', ['single_choice', 'multiple_choice', 'matching', 'ordering'])->default('multiple_choice');
$table->enum('type', ['multiple_choice', 'matching', 'ordering'])->default('multiple_choice');
$table->text('question_text');
$table->text('explanation')->nullable();
$table->integer('score')->default(1);
@@ -9,8 +9,8 @@ return new class extends Migration
{
public function up(): void
{
// Добавляем ordering и убираем input
DB::statement("ALTER TABLE questions MODIFY COLUMN type ENUM('single_choice', 'multiple_choice', 'matching', 'ordering') NOT NULL");
// Добавляем ordering и убираем input, single_choice
DB::statement("ALTER TABLE questions MODIFY COLUMN type ENUM('multiple_choice', 'matching', 'ordering') NOT NULL");
// Создаём таблицу для ordering элементов
Schema::create('question_ordering_items', function (Blueprint $table) {