@extends('layouts.admin') @section('title','CSV Import') @section('page-title','CSV Question Import') @section('content')
{{-- Upload Form --}}
Upload CSV File
@csrf
@error('subject_id')
{{ $message }}
@enderror
Max size: 5MB. Must be a .csv file. @error('csv_file')
{{ $message }}
@enderror
{{-- Download Template --}}
Need the CSV template?
Download the official template with sample data
{{-- CSV Format Guide --}}
CSV Format Guide

Your CSV file must have these exact column headers in the first row:

ColumnRequiredNotes
topicNoTopic name — auto-created if not found
yearNo4-digit year e.g. 2023
instruction_textNoComprehension passage — leave blank if none
question_textYesSupports HTML: <sup>, <sub>
option_aYesOption A text
option_bYesOption B text
option_cYesOption C text
option_dYesOption D text
correct_answerYesMust be A, B, C or D
explanationNoSolution shown after exam
difficultyNoeasy / medium / hard (default: medium)
Comprehension tip: For multiple questions sharing the same passage, repeat the same instruction_text on each row. The system will group them automatically.
{{-- Recent Import Logs --}} @if($logs->isNotEmpty())
Recent Imports
View All
@foreach($logs as $log) @endforeach
FileSubjectOKFailedStatus
{{ $log->filename }} {{ $log->subject->name ?? '—' }} {{ $log->successful }} {{ $log->failed }} @php $sc = ['completed'=>'success','processing'=>'warning','failed'=>'danger'][$log->status] @endphp {{ ucfirst($log->status) }}
@endif
@endsection