72 lines
3.5 KiB
PHP
72 lines
3.5 KiB
PHP
@extends('admin.layouts.app')
|
|
|
|
@section('content')
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h4 class="mb-0">مدیریت آزمونها</h4>
|
|
<a href="{{ route('quizzes.create') }}" class="btn btn-primary">+ تعریف آزمون جدید</a>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover align-middle">
|
|
<thead>
|
|
<tr>
|
|
<th>عنوان آزمون</th>
|
|
<th>دستهبندی</th>
|
|
<th>سال</th>
|
|
<th>نوع</th>
|
|
<th>تعداد سوالات</th>
|
|
<th>مدت (دقیقه)</th>
|
|
<th>وضعیت</th>
|
|
<th>عملیات</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($quizzes as $quiz)
|
|
<tr>
|
|
<td><strong>{{ $quiz->title }}</strong></td>
|
|
<td><span class="badge bg-soft-info text-info">{{ optional($quiz->category)->title }}</span></td>
|
|
<td>{{ $quiz->year ?? '-' }}</td>
|
|
<td>
|
|
@if($quiz->type === 'multiple_choice')
|
|
<span class="badge bg-primary">چهار گزینهای</span>
|
|
@elseif($quiz->type === 'descriptive')
|
|
<span class="badge bg-warning">تشریحی</span>
|
|
@else
|
|
<span class="badge bg-secondary">ترکیبی</span>
|
|
@endif
|
|
</td>
|
|
<td>{{ $quiz->questions_count }} سوال</td>
|
|
<td>{{ $quiz->duration_minutes }} دقیقه</td>
|
|
<td>
|
|
@if($quiz->is_published)
|
|
<span class="badge bg-success">منتشر شده</span>
|
|
@else
|
|
<span class="badge bg-secondary">پیشنویس</span>
|
|
@endif
|
|
</td>
|
|
<td>
|
|
<a href="{{ route('quizzes.questions.index', $quiz->id) }}" class="btn btn-sm btn-info me-1">مدیریت سوالات</a>
|
|
<form action="{{ route('quizzes.destroy', $quiz->id) }}" method="POST" class="d-inline" onsubmit="return confirm('آیا از حذف این آزمون اطمینان دارید؟')">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button class="btn btn-sm btn-danger">حذف</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="8" class="text-center py-4">هیچ آزمونی ثبت نشده است.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="mt-3">
|
|
{{ $quizzes->links() }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|