Added quiz features

This commit is contained in:
m.razaghi
2026-08-06 14:31:46 +03:30
parent 0fffd2eb3d
commit 768a0aaeb0
4 changed files with 145 additions and 10 deletions

View File

@@ -36,15 +36,6 @@
</a>
</li>
<li>
<a href="{{ route('quizzes.index') }}" class="waves-effect">
<i class="mdi mdi-format-list-checks"></i>
<span>مدیریت آزمون‌ها</span>
</a>
</li>
<li>
<a href="javascript:%20void(0);" class="has-arrow waves-effect">
<i class="mdi mdi-account-circle-outline"></i>
@@ -55,6 +46,20 @@
</ul>
</li>
<li>
<a href="{{ route('quizzes.index') }}" class="waves-effect">
<i class="mdi mdi-format-list-checks"></i>
<span>مدیریت آزمون‌ها</span>
</a>
</li>
<li>
<a href="{{ route('quiz-categories.index') }}" class="waves-effect">
<i class="mdi mdi-shape-plus"></i>
<span>دسته‌بندی آزمون‌ها</span>
</a>
</li>
<li>
<a href="javascript:%20void(0);" class="has-arrow waves-effect">

View File

@@ -0,0 +1,82 @@
@extends('admin.layouts.app')
@section('content')
<div class="row">
<!-- Form to Add Category -->
<div class="col-lg-4">
<div class="card">
<div class="card-header bg-primary text-white">
<h6 class="mb-0 text-white">افزودن دسته‌بندی جدید</h6>
</div>
<div class="card-body">
<form action="{{ route('quiz-categories.store') }}" method="POST">
@csrf
<div class="mb-3">
<label class="form-label">عنوان دسته‌بندی <span class="text-danger">*</span></label>
<input type="text" name="title" class="form-control" placeholder="مثال: کانون وکلا" required>
</div>
<div class="mb-3">
<label class="form-label">توضیحات (اختیاری)</label>
<textarea name="description" class="form-control" rows="3"></textarea>
</div>
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" name="is_active" id="isActive" checked>
<label class="form-check-label" for="isActive">فعال باشد</label>
</div>
<button type="submit" class="btn btn-success w-100">ثبت دسته‌بندی</button>
</form>
</div>
</div>
</div>
<!-- List of Categories -->
<div class="col-lg-8">
<div class="card">
<div class="card-body">
<h5 class="card-title mb-4">دسته‌بندی‌های موجود</h5>
<div class="table-responsive">
<table class="table table-hover align-middle">
<thead>
<tr>
<th>عنوان</th>
<th>تعداد آزمون‌ها</th>
<th>وضعیت</th>
<th>عملیات</th>
</tr>
</thead>
<tbody>
@forelse($categories as $category)
<tr>
<td><strong>{{ $category->title }}</strong></td>
<td>{{ $category->quizzes_count }} آزمون</td>
<td>
@if($category->is_active)
<span class="badge bg-success">فعال</span>
@else
<span class="badge bg-danger">غیرفعال</span>
@endif
</td>
<td>
<form action="{{ route('quiz-categories.destroy', $category->id) }}" method="POST" class="d-inline" onsubmit="return confirm('آیا از حذف این دسته‌بندی اطمینان دارید؟')">
@csrf
@method('DELETE')
<button class="btn btn-sm btn-outline-danger">حذف</button>
</form>
</td>
</tr>
@empty
<tr>
<td colspan="4" class="text-center py-3">هیچ دسته‌بندی یافت نشد.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection