@extends('student.layouts.app') @section('title', app()->getLocale() === 'ar' ? 'اختبارات المادة' : 'Course Quizzes') @section('content') @php $isArabic = app()->getLocale() === 'ar'; @endphp
@include('student.courses.inc.overview', ['course' => $course]) @include('student.courses.inc.tabs', ['course' => $course])

{{ $isArabic ? 'اختبارات المادة' : 'Course quizzes' }}

{{ $isArabic ? 'كل اختبار مع حالة التقديم والنتيجة وعدد الأسئلة.' : 'Each quiz with submission status, score, and question count.' }}

{{ $isArabic ? 'إجمالي الاختبارات' : 'Total quizzes' }}
{{ $quizzes->count() }}
@foreach($quizzes as $quiz) @php $attempt = $quiz->answers->first(); $isSubmitted = $attempt && ! $attempt->status; $isActive = $attempt && $attempt->status; $statusLabel = $isSubmitted ? ($attempt->corrected_manually ? ($isArabic ? 'بانتظار التصحيح' : 'Pending review') : ($isArabic ? 'تم التسليم' : 'Submitted')) : ($isActive ? ($isArabic ? 'قيد الحل' : 'In progress') : ($isArabic ? 'جاهز للبدء' : 'Ready to start')); @endphp
{{ $statusLabel }}

{{ $quiz->title }}

@if ($quiz->description)

{{ $quiz->description }}

@endif
{{ $quiz->questions_count }} {{ $isArabic ? 'سؤال' : 'questions' }} {{ $quiz->duration }} {{ $isArabic ? 'دقيقة' : 'min' }} {{ $quiz->total_marks }} {{ $isArabic ? 'درجة' : 'marks' }}
{{ $isArabic ? 'موعد البداية' : 'Starts' }} {{ optional($quiz->start_time)->format('Y-m-d h:i A') }}
@if ($attempt)
{{ $isArabic ? 'النتيجة الحالية' : 'Current result' }} {{ (int) $attempt->student_score }}/{{ (int) $quiz->total_marks }}
@endif
@endforeach @if(($quizzes)->isEmpty())

{{ $isArabic ? 'لا توجد اختبارات مضافة بعد' : 'No quizzes added yet' }}

{{ $isArabic ? 'ستظهر هنا الاختبارات المنشورة لهذه المادة.' : 'Published quizzes for this course will appear here.' }}

@endif
@endsection