@include('admin.crud.form', [ 'action' => route('admin.quizzes.update', $edit_data->id), 'method' => 'PUT', 'formId' => 'edit-quizzes-form', 'submitText' => 'Update Quizzes', 'class' => 'ajax-crud-form', 'redirect' => route('admin.quizzes.index'), 'fields' => [ [ 'type' => 'select2', 'name' => 'course_id', 'id' => 'course_id', 'label' => 'Course', 'required' => true, 'options' => $courses->pluck('title', 'id')->toArray(), 'col' => 12, 'value' => $edit_data->material->course_id ?? '' ], [ 'type' => 'hidden', 'name' => 'status', 'id' => 'status', 'value' => 'active' ], [ 'type' => 'text', 'name' => 'title', 'id' => 'title', 'label' => 'Exam Title', 'placeholder' => 'Enter exam title', 'required' => true, 'value' => $edit_data->title, 'col' => 12 ], [ 'type' => 'textarea', 'name' => 'description', 'id' => 'description', 'label' => 'Description', 'placeholder' => 'Enter exam description', 'rows' => 3, 'value' => $edit_data->description, 'col' => 12 ], [ 'type' => 'number', 'name' => 'attempts', 'id' => 'attempts', 'label' => 'Number of Attempts', 'placeholder' => '1', 'required' => true, 'min' => 1, 'max' => 10, 'value' => $edit_data->attempts, 'col' => 4 ], [ 'type' => 'number', 'name' => 'pass_score', 'id' => 'pass_score', 'label' => 'Pass Score (%)', 'placeholder' => '60', 'required' => true, 'min' => 0, 'max' => 100, 'value' => $edit_data->pass_score, 'col' => 4 ], [ 'type' => 'number', 'name' => 'max_score', 'id' => 'max_score', 'label' => 'Maximum Score', 'placeholder' => '100', 'required' => true, 'min' => 1, 'value' => $edit_data->max_score, 'col' => 4 ], [ 'type' => 'number', 'name' => 'time_limit', 'id' => 'time_limit', 'label' => 'Time Limit (minutes)', 'placeholder' => '60', 'min' => 1, 'max' => 480, 'value' => $edit_data->time_limit, 'col' => 6 ], [ 'type' => 'number', 'name' => 'questions_limit', 'id' => 'questions_limit', 'label' => 'Questions Limit', 'placeholder' => '1', 'required' => true, 'value' => $edit_data->questions_limit, // 'min' => 1, // 'max' => 480, 'col' => 6 ], [ 'type' => 'number', 'name' => 'mark_correct', 'id' => 'mark_correct', 'label' => 'Marks for Correct Answer', 'placeholder' => '1.00', // 'min' => 0, // 'step' => 0.01, 'value' => $edit_data->mark_correct, 'col' => 6 ], [ 'type' => 'number', 'name' => 'mark_wrong', 'id' => 'mark_wrong', 'label' => 'Marks for Wrong Answer', 'placeholder' => '0.00', // 'max' => 0, // 'min' => 0, // 'step' => 0.01, 'value' => $edit_data->mark_wrong, 'col' => 6 ], [ 'type' => 'checkbox', 'name' => 'shuffle_questions', 'id' => 'shuffle_questions', 'label' => 'Shuffle Questions', 'defaultValue' => 0, // if unchecked case 'value' => $edit_data->shuffle_questions, 'col' => 4 ], [ 'type' => 'checkbox', 'name' => 'shuffle_options', 'id' => 'shuffle_options', 'label' => 'Shuffle Options', 'defaultValue' => 0, // if unchecked case 'value' => $edit_data->shuffle_options, 'col' => 4 ], ] ])