@extends('layouts.app')

@section('title', 'My Results')

@section('content')
    <h1 class="text-2xl font-bold mb-6">My Results</h1>
    <table class="w-full border-collapse">
        <thead>
            <tr class="bg-gray-200">
                <th class="p-2 text-left">Subject</th>
                <th class="p-2 text-left">1st Test</th>
                <th class="p-2 text-left">2nd Test</th>
                <th class="p-2 text-left">Exam</th>
                <th class="p-2 text-left">Total</th>
                <th class="p-2 text-left">Grade</th>
                <th class="p-2 text-left">Remarks</th>
            </tr>
        </thead>
        <tbody>
            @foreach($results as $result)
            <tr class="border-b">
                <td class="p-2">{{ $result->subject->name ?? 'N/A' }}</td>
                <td class="p-2">{{ $result->first_test ?? '-' }}</td>
                <td class="p-2">{{ $result->second_test ?? '-' }}</td>
                <td class="p-2">{{ $result->exam_score ?? '-' }}</td>
                <td class="p-2">{{ $result->total_score ?? '-' }}</td>
                <td class="p-2">{{ $result->grade ?? '-' }}</td>
                <td class="p-2">{{ $result->remarks ?? '-' }}</td>
            </tr>
            @endforeach
        </tbody>
    </table>
@endsection