@extends('layouts.teacher')
@section('title', 'Exams')
@section('content')
    <x-page-head title="Exams & Tests" subtitle="Schedule formal assessments"><x-slot:actions><a href="{{ route('teacher.exams.create') }}" class="btn btn-primary">Schedule Exam</a></x-slot:actions></x-page-head>
    <x-panel>
        @if($exams->isEmpty())<x-empty-state title="No exams scheduled" />
        @else<div class="table-wrap"><table><thead><tr><th>Title</th><th>Type</th><th>Class</th><th>Subject</th><th>Date</th><th>Max</th><th></th></tr></thead><tbody>
            @foreach($exams as $exam)<tr><td>{{ $exam->title }}</td><td>{{ str_replace('_',' ',$exam->assessment_type) }}</td><td>{{ $exam->schoolClass?->name }}</td><td>{{ $exam->subject?->name }}</td><td>{{ optional($exam->assessment_date)->format('d M Y') }}</td><td>{{ $exam->max_score }}</td><td><a href="{{ route('teacher.exams.edit', $exam) }}" class="btn btn-ghost btn-sm">Edit</a></td></tr>@endforeach
        </tbody></table></div>{{ $exams->links() }}@endif
    </x-panel>
@endsection
