@include('admin.crud.form', [ 'action' => route('admin.exams.update', $edit_data->id), 'formId' => 'edit-exam-form', 'submitText' => 'Update Exam', 'class' => 'ajax-crud-form', 'redirect' => route('admin.exams.index'), 'method' => 'PUT', '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' => 'mark_correct', 'id' => 'mark_correct', 'label' => 'Marks for Correct Answer', 'placeholder' => '1.00', 'min' => 0, 'step' => 0.01, 'value' => $edit_data->mark_correct, 'col' => 3 ], [ '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' => 3 ], [ '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 ], [ 'type' => 'checkbox', 'name' => 'publish_results', 'id' => 'publish_results', 'label' => 'Publish Results', 'defaultValue' => 0, // if unchecked case 'value' => $edit_data->publish_results, 'col' => 4 ], [ 'type' => 'datetime-local', 'name' => 'start_time', 'id' => 'start_time', 'label' => 'Start Time', 'value' => $edit_data->start_time ? date('Y-m-d\TH:i', strtotime($edit_data->start_time)) : '', 'col' => 6 ], [ 'type' => 'datetime-local', 'name' => 'end_time', 'id' => 'end_time', 'label' => 'End Time', 'value' => $edit_data->end_time ? date('Y-m-d\TH:i', strtotime($edit_data->end_time)) : '', 'col' => 6 ], ] ])