Module {{ $moduleStatus }}
| Step {{ $stepCount }} | @php $stepCount++; @endphp
Read Book
|
@if ($status1 == 'complete') @elseif($status1 == 'inprogress') @if($allPdfsRead) @else @endif @elseif($status1 === 'pending') @endif |
@if ($status1 == 'complete')
Completed
@else
@endif
|
| Read PDF {{ $index + 1 }} | {{-- COMPLETED --}} @if($isCompleted) Read {{-- READING (PAGE REFRESH SAFE) --}} @elseif($isReading) Read {{-- NOT STARTED --}} @else Read @endif |
@if($isCompleted)
Completed
@else
Pending
@endif
|
|
| Step {{$stepCount}} | @php $stepCount++; @endphp
Watch Video
|
@if($status2 === 'complete') @else @if($status2 === 'pending') @else @endif @endif |
@if($status2 === 'complete')
Completed
@else
@endif
|
| Watch Video {{ $index + 1 }} |
@if ($watched)
@endif
0) disabled @endif>
{{ $watched ? 'Rewatch' : 'View' }}
|
@if ($watched)
Completed
@else
Pending
@endif
|
|
| Step {{$stepCount}} | @php $stepCount++; @endphp
MCQ
|
@php // Your existing MCQ enable logic remains $videoStepEnabled = $hasVideo && $checkCoursePurchase->course->is_government_course == 0; // $mcqEnabled = $canStartTopic && // ($status1 === 'complete') && // (!$hasVideo || $status2 === 'complete'); $mcqEnabled = $canStartTopic && ($status1 === 'complete') && (!$videoStepEnabled || $status2 === 'complete' ); // Check if any attempt passed (≥60) $currentTopicId = $courseTopic->topic->id; // $hasPassingScore = isset($examScores[$currentTopicId]) && // $examScores[$currentTopicId] >= env('EXAM_PASS_SCORE'); $hasPassingScore = isset($examAttempts[$currentTopicId]) && $examAttempts[$topicId]->firstWhere('status', 'pass') !== null; $latestScore = 0; if (isset($examAttempts[$currentTopicId]) && $examAttempts[$currentTopicId]->isNotEmpty()) { $latestScore = $examAttempts[$currentTopicId]->first()['score']; } @endphp @if ($status3 === 'complete') @if($hasPassingScore) {{-- Passed state (your existing code) --}} @if($checkCoursePurchase->course_status != 'completed') @endif @else {{-- NEW: Failed state --}} @endif @else {{-- Your existing first attempt button --}} @endif |
@if ($status3 == 'complete')
@if($hasPassingScore)
Completed
@else
{{ $examScores[$courseTopic->topic->id] ?? 0 }}%
@endif
@else
@endif
|