@extends('layouts.staff_dashboard') @section('title', 'Allocate Coding Questions') @section('content')
{{ ($type ?? 'coding') === 'sql' ? 'SQL Coding' : 'Coding Bank' }}

Allocate {{ ($type ?? 'coding') === 'sql' ? 'SQL ' : '' }}Coding Questions

{{ $courseName ?? 'N/A' }} {{ $moduleName ?? 'N/A' }} {{ $topicName ?? 'N/A' }}
@csrf
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if(!$allocatedate)
Date Required: Please select an allocation date above to view and allocate coding questions.
@endif @if($allocatedate && $isPastDate)
View Only Mode: Viewing allocations for a past date ({{ \Carbon\Carbon::parse($allocatedate)->format('d M Y') }}). Past allocations cannot be modified—select today or a future date to allocate questions.
@endif @if($allocatedate)
{{ count($allocatedQuestionIds ?? []) }} of {{ $questions->total() ?? 0 }} selected @if(!$isPastDate) @endif
@csrf
@include($viewPartial, [ 'questions' => $questions, 'serialStart' => 1, 'allocatedQuestionIds' => $allocatedQuestionIds, 'disabledQuestionIds' => $disabledQuestionIds ?? [], 'isPastDate' => $isPastDate ?? false, 'pastAllocatedQuestions' => $pastAllocatedQuestions ?? [], 'questionAllocationDates' => $questionAllocationDates ?? [], 'allocatedate' => $allocatedate ?? '', 'type' => $type ])
@if($questions->hasPages())
@include('staff.pagination.coding', ['questions' => $questions])
@endif
@else

Select an Allocation Date

Choose a date from the picker at the top right to view available questions and allocate them to your batch.

@endif
@endsection