@extends('admin.layout') @section('title','Class Tests') @section('page-title','Class Tests & Results') @section('content')

Create Test

@csrf
@forelse($tests as $test) @php $given = $test->results->whereNotNull('marks_obtained')->count(); $total = $test->results->count(); $avg = $given > 0 ? round($test->results->whereNotNull('marks_obtained')->avg('marks_obtained'), 1) : null; $passed = $test->results->filter(fn($r)=>$r->marks_obtained!==null && $r->marks_obtained>=$test->passing_marks)->count(); @endphp
{{ $test->title }}
{{ $test->course }} {{ $test->test_date->format('d M Y') }} @if($test->topic) · {{ $test->topic }} @endif · {{ $test->total_marks }} marks
@if($avg !== null) Avg: {{ $avg }}/{{ $test->total_marks }} @endif {{ $given }}/{{ $total }} entered
@empty
No tests created yet.
@endforelse @if($tests->hasPages())
{{ $tests->links() }}
@endif
@endsection @push('styles') @endpush