Chapter study sheet
{{ $chapter['title'] }}
@if (count($crumbs))
{{ implode(' / ', $crumbs) }}
@endif
@if (! empty($chapter['chapter_no']))
Chapter {{ $chapter['chapter_no'] }}
@endif
@if (! empty($chapter['page_no_start']))
Pages {{ $chapter['page_no_start'] }}@if(! empty($chapter['page_no_end']))โ{{ $chapter['page_no_end'] }}@endif
@endif
{{ $totals['mcqs'] }} {{ \Illuminate\Support\Str::plural('MCQ', $totals['mcqs']) }}
{{ $totals['two_marks'] }} two-mark {{ \Illuminate\Support\Str::plural('question', $totals['two_marks']) }}
{{ $totals['summaries'] }} {{ \Illuminate\Support\Str::plural('summary', $totals['summaries']) }}
@php
$hasAnyContent = $totals['mcqs'] > 0 || $totals['two_marks'] > 0 || $totals['summaries'] > 0;
// Only headings that actually render a body get a TOC entry, so no
// link points at a section suppressed below (dead anchor).
$tocSections = array_values(array_filter(
$sheet['sections'],
fn ($section) => $section['summary'] || count($section['two_marks']) || count($section['mcqs'])
));
$navTargetCount = count($tocSections) + ($sheet['unsectioned'] ? 1 : 0);
@endphp
@if (! $hasAnyContent)
No approved summaries, two-mark questions, or MCQs are available for this chapter yet.
@else
@if ($navTargetCount > 1)
Sections
@foreach ($tocSections as $section)
{{ $section['name'] }}
โ {{ count($section['mcqs']) }} MCQ, {{ count($section['two_marks']) }} two-mark{{ $section['summary'] ? ', summary' : '' }}
@endforeach
@if ($sheet['unsectioned'])
Other questions
โ {{ count($sheet['unsectioned']['mcqs']) }} MCQ, {{ count($sheet['unsectioned']['two_marks']) }} two-mark
@endif
@endif
@foreach ($sheet['sections'] as $section)
@php
$sectionHasContent = $section['summary'] || count($section['two_marks']) || count($section['mcqs']);
@endphp
@if ($sectionHasContent)
@if (! empty($section['heading_no']))
H{{ $section['heading_no'] }}
@endif
{{ $section['name'] }}
@if ($section['summary'])
Summary
@include('student.partials.study-summary', ['summary' => $section['summary']])
@endif
@if (count($section['two_marks']))
Two-mark questions
@foreach ($section['two_marks'] as $q)
@include('student.partials.study-two-mark', ['q' => $q])
@endforeach
@endif
@if (count($section['mcqs']))
Multiple-choice questions
@foreach ($section['mcqs'] as $q)
@include('student.partials.study-mcq', ['q' => $q, 'optionLabels' => $optionLabels])
@endforeach
@endif
@endif
@endforeach
@if ($sheet['unsectioned'])
Other questions
@if (count($sheet['unsectioned']['two_marks']))
Two-mark questions
@foreach ($sheet['unsectioned']['two_marks'] as $q)
@include('student.partials.study-two-mark', ['q' => $q])
@endforeach
@endif
@if (count($sheet['unsectioned']['mcqs']))
Multiple-choice questions
@foreach ($sheet['unsectioned']['mcqs'] as $q)
@include('student.partials.study-mcq', ['q' => $q, 'optionLabels' => $optionLabels])
@endforeach
@endif
@endif
@endif