@php use App\Models\Category; use App\Models\EnrollTestSeries; use App\Models\Group; $enrolltestSeries = EnrollTestSeries::where('testseries_id', $testSeries->id) ->first(); $group = Group::where('id', $enrolltestSeries->group_id ?? 0) ->first(); // Fetch Subject name from Category table using category_level = 'subject' $categoryIds = array_map('intval', explode(',', $testSeries->category_id)); $subjects = Category::whereIn('id', $categoryIds) ->where('category_level', 'subject') ->take(3) ->pluck('category_name') ->toArray(); $subjectName = !empty($subjects) ? implode(' / ', $subjects) : 'N/A'; $className = Category::whereIn('id', $categoryIds) ->where('category_level', 'class') ->first(); $className = $className->category_name ?? 'N/A'; // Ensure instructions are available $instructions = $testSeries->instructions ?? 'Read all questions carefully.'; // Current date for the exam $examDate = date('d-m-Y'); @endphp
| Date: {{ $examDate }} |
{{ $school_info->school_name ?? 'Achievam Institute' }}
{{ $testSeries->name }}
Class: {{ $className }}
Subject: {{ $subjectName }}
|
Roll No: ________________
|
| Time: {{ $testSeries->total_time }} Minutes | Max Marks: {{ $total_max_marks }} |
| {{ $globalIndex }}. | {!! $question['question_text'] !!}({{ $question['question_mark'] }}) |
|
{{ chr(65 + $i) }})
{!! $opts[$i]['option_text'] !!}
|
@if ($i + 1 < $count)
{{ chr(65 + $i + 1) }})
{!! $opts[$i + 1]['option_text'] !!}
|
@else
@endif |