@extends('layouts.app') @section('title', '練習考試') @section('content')

練習考試

選擇適合您的考試開始練習

@auth + 自建考試 @endauth
@include('components.pagination-bar', ['paginator' => $exams]) @if($exams->count() > 0)
@foreach($exams as $exam) @php $bestScore = $myResults[$exam->id] ?? null; $attempts = $myAttempts[$exam->id] ?? 0; @endphp
@if($exam->examCategory) {{ $exam->examCategory->name }} @endif @if($exam->subject) {{ $exam->subject->name }} @endif
{{ $exam->visibility_label }}

{{ $exam->title }}

@if($exam->description)

{{ Str::limit($exam->description, 80) }}

@endif
{{ $exam->questions_count }} 題 @if($exam->creator) {{ $exam->creator->name }} @endif
@if($bestScore !== null)
{{ $bestScore }}

最佳成績

已練習 {{ $attempts }} 次

@else 尚未練習 @endif {{ $bestScore !== null ? '再次練習' : '開始練習' }}
@endforeach
@include('components.pagination-bar', ['paginator' => $exams])
@else

目前沒有可用的考試

請等待老師發佈考試,或自行建立練習

@endif
@endsection