@extends('layouts.main_dashboard.app') @php $routePrefix = auth()->user()?->usesStaffPortal() ? 'teacher' : 'admin'; $isArabic = app()->getLocale() === 'ar'; $quizzesCollection = $quizzes instanceof \Illuminate\Contracts\Pagination\LengthAwarePaginator || $quizzes instanceof \Illuminate\Contracts\Pagination\Paginator ? $quizzes->getCollection() : collect($quizzes); @endphp @section('title', __('dashboard.All Quizzes')) @section('page_heading', __('dashboard.All Quizzes')) @section('page_subtitle', $course->name) @section('skip_page_hero', true) @section('content')
{{ $isArabic ? 'الاختبارات' : 'Quizzes' }} {{ $course->name }}

{{ $isArabic ? 'جميع الاختبارات' : 'All Quizzes' }}

{{ $isArabic ? 'صفحة أبسط لمتابعة اختبارات المقرر، حالتها، وقتها، والانتقال السريع إلى الأسئلة والإجابات.' : 'A simpler page to manage course quizzes, their status, schedule, and quick access to questions and answers.' }}

{{ __('dashboard.Create New Quiz') }}
{{ __('dashboard.Reset') }}
@if($quizzesCollection->isEmpty())

{{ __('dashboard.No quizzes found.') }}

{{ __('dashboard.There are no quizzes to display, try creating one!') }}

{{ __('dashboard.Create New Quiz') }}
@else
{{ __('dashboard.Select All') }}
@foreach($quizzesCollection as $quiz) @php $isLive = optional($quiz->start_time)->isPast() && optional($quiz->end_time)->isFuture(); $statusLabel = $quiz->is_published ? __('dashboard.Published') : __('dashboard.Unpublished'); @endphp

{{ $quiz->title }}

{{ $statusLabel }} @if($isLive) {{ $isArabic ? 'مباشر الآن' : 'Live now' }} @endif

{{ \Illuminate\Support\Str::limit((string) $quiz->description, 150) }}

{{ __('dashboard.Start Time') }}: {{ $quiz->start_time?->format('Y-m-d h:i A') ?? 'N/A' }}
{{ __('dashboard.End Time') }}: {{ $quiz->end_time?->format('Y-m-d h:i A') ?? 'N/A' }}
{{ __('dashboard.Duration') }}: {{ $quiz->duration }} {{ __('dashboard.Minutes') }}
{{ $isArabic ? 'المجموع:' : 'Total marks:' }} {{ $quiz->total_marks ?? $quiz->questions()->sum('score') }}
@endforeach
@if($quizzes instanceof \Illuminate\Contracts\Pagination\Paginator)
{{ $quizzes->appends(request()->query())->links() }}
@endif @endif
@endsection