|
1 | 1 | <div> |
2 | 2 | @if($entry) |
3 | | - @livewire('view-graded-entry', ['test' => $test, 'entry' => $entry]) |
| 3 | + <div class="mb-8"> |
| 4 | + @livewire('view-graded-entry', ['test' => $test, 'entry' => $entry]) |
| 5 | + </div> |
| 6 | + |
| 7 | + @if(!$testPassed && $step->require_perfect_score) |
| 8 | + <x-filament::section class="mt-8"> |
| 9 | + <div class="space-y-4"> |
| 10 | + <div class="rounded-lg bg-danger-50 dark:bg-danger-900/20 p-4"> |
| 11 | + <div class="flex"> |
| 12 | + <div class="flex-shrink-0"> |
| 13 | + <x-filament::icon |
| 14 | + icon="heroicon-o-exclamation-triangle" |
| 15 | + class="h-5 w-5 text-danger-600 dark:text-danger-400" |
| 16 | + /> |
| 17 | + </div> |
| 18 | + <div class="ml-3"> |
| 19 | + <h3 class="text-sm font-medium text-danger-800 dark:text-danger-200"> |
| 20 | + Test Not Passed |
| 21 | + </h3> |
| 22 | + <div class="mt-2 text-sm text-danger-700 dark:text-danger-300"> |
| 23 | + <p> |
| 24 | + You must answer all questions correctly to proceed. Please review the material and try again. |
| 25 | + </p> |
| 26 | + </div> |
| 27 | + <div class="mt-4 flex gap-3"> |
| 28 | + @if($step->retryStep) |
| 29 | + @php |
| 30 | + $retryStep = $step->retryStep; |
| 31 | + if (!$retryStep->relationLoaded('lesson')) { |
| 32 | + $retryStep->load('lesson.course'); |
| 33 | + } |
| 34 | + $retryStepUrl = '/lms/courses/' . $retryStep->lesson->course->slug . '/' . $retryStep->lesson->slug . '/' . $retryStep->slug; |
| 35 | + @endphp |
| 36 | + <x-filament::button |
| 37 | + tag="a" |
| 38 | + :href="$retryStepUrl" |
| 39 | + color="danger" |
| 40 | + outlined |
| 41 | + > |
| 42 | + Review Material |
| 43 | + </x-filament::button> |
| 44 | + @endif |
| 45 | + <x-filament::button |
| 46 | + wire:click="retakeTest" |
| 47 | + color="primary" |
| 48 | + > |
| 49 | + Retake Test |
| 50 | + </x-filament::button> |
| 51 | + </div> |
| 52 | + </div> |
| 53 | + </div> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + </x-filament::section> |
| 57 | + @endif |
4 | 58 | @else |
5 | 59 | @livewire('create-test-entry', ['test' => $test]) |
6 | 60 | @endif |
7 | 61 |
|
8 | | - <div class="fixed bottom-0 right-0 p-4 md:p-6 lg:p-8"> |
9 | | - <x-filament::button color="gray" wire:click="$dispatch('complete-step')" :disabled="!$step->is_optional && !$entry" class="next-button"> |
10 | | - Next |
11 | | - </x-filament::button> |
12 | | - </div> |
| 62 | + <x-filament-lms::next-button :disabled="!$step->is_optional && (!$entry || ($step->require_perfect_score && !$testPassed))" /> |
13 | 63 | </div> |
0 commit comments