|
4 | 4 | <head> |
5 | 5 | <meta charset="UTF-8"> |
6 | 6 | <title>Training Auswertung</title> |
| 7 | + <!-- Tailwind CSS via CDN --> |
7 | 8 | <script src="https://cdn.tailwindcss.com"></script> |
8 | 9 | </head> |
9 | 10 |
|
10 | 11 | <body class="bg-gray-100"> |
11 | 12 | <div class="max-w-5xl mx-auto p-6"> |
12 | | - <!-- Header mit Logos --> |
| 13 | + {{-- Header with institution logos and summary title --}} |
13 | 14 | <div class="flex items-center justify-between mb-6"> |
14 | 15 | <img src="{{ asset('images/fhp-logo.png') }}" alt="FHP Logo" class="h-16"> |
15 | 16 | <h1 class="text-3xl font-bold text-center">Training 1: Auswertung</h1> |
16 | 17 | <img src="{{ asset('images/gfz-logo-en.png') }}" alt="GFZ Logo" class="h-16"> |
17 | 18 | </div> |
| 19 | + |
18 | 20 | <div class="bg-white shadow-lg rounded-lg p-6"> |
| 21 | + {{-- Loop through each question and display its results --}} |
19 | 22 | @foreach($questions as $question) |
20 | 23 | <div class="mb-8 border-b pb-4"> |
| 24 | + {{-- Question text --}} |
21 | 25 | <h2 class="text-2xl font-semibold mb-2">{{ $question->question_text }}</h2> |
| 26 | + |
22 | 27 | <div class="space-y-2"> |
| 28 | + {{-- Loop through options and show count and correctness --}} |
23 | 29 | @foreach($question->options as $option) |
24 | 30 | @php |
25 | 31 | $result = $question->results->firstWhere('letter', $option->letter); |
26 | 32 | $count = $result ? $result->count : 0; |
27 | 33 | @endphp |
28 | 34 | <div class="p-4 bg-gray-50 rounded shadow flex items-center justify-between"> |
| 35 | + {{-- Option text and correct marker --}} |
29 | 36 | <span class="font-medium"> |
30 | 37 | {{ $option->letter }}: {{ $option->option_text }} |
31 | 38 | @if($option->is_correct) |
32 | 39 | <span class="text-green-600">(richtig)</span> |
33 | 40 | @endif |
34 | 41 | </span> |
| 42 | + {{-- Display vote count --}} |
35 | 43 | <span class="text-xl font-bold text-blue-600">{{ $count }}</span> |
36 | 44 | </div> |
37 | 45 | @endforeach |
38 | 46 | </div> |
39 | 47 | </div> |
40 | 48 | @endforeach |
41 | 49 |
|
| 50 | + {{-- Navigation: back to quiz and reset quiz --}} |
42 | 51 | <div class="flex justify-between mt-6"> |
43 | | - <!-- Button "Zurück" --> |
44 | 52 | <a href="{{ route('quiz.index') }}" |
45 | 53 | class="bg-gray-500 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded"> |
46 | 54 | Zurück |
47 | 55 | </a> |
48 | | - <!-- Button "Quiz zurücksetzen" --> |
49 | 56 | <form action="{{ route('quiz.reset') }}" method="POST"> |
50 | 57 | @csrf |
51 | 58 | <button type="submit" class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded"> |
|
0 commit comments