@props([ 'question', 'number', 'sectionKey', 'value' => null, 'meta' => null, 'prompts', 'citations', 'exhibitByItem', 'validationRequested' => false, 'touched' => [], ]) @php $model = "answers.$sectionKey.{$question->key}"; $fieldId = "wq-$sectionKey-{$question->key}"; $key = "$sectionKey.{$question->key}"; $isRequiredMissing = $question->required && ! $question->isAnswered($value); $showError = $isRequiredMissing && ($validationRequested || in_array($key, $touched, true)); $describedBy = collect([$question->help ? "$fieldId-help" : null, $showError ? "$fieldId-error" : null])->filter()->implode(' '); $openPrompts = $prompts->filter(fn ($p) => $p->isOpen() || $p->isDeferred()); $handledPrompts = $prompts->filter(fn ($p) => $p->isResolved() || $p->isIrrelevant()); @endphp
@if($question->why)
{{ $question->why }}
@endif @if($question->help)
{{ $question->help }}
@endif
@switch($question->type) @case('long_text') @break @case('date') @break @case('select') @break @case('boolean') @case('declaration')
@break @case('multiselect')
@foreach($question->options as $opt) @endforeach
@break @case('repeater') @php $rows = is_array($value) ? $value : []; @endphp
@forelse($rows as $rowIndex => $row)
@foreach($question->fields as $sub)
@endforeach
@empty

No entries yet.

@endforelse
@break @default @endswitch @if($showError)
This answer is required before the statement can be generated.
@endif {{-- Cited exhibits (relations — not text in the answer) --}} @if($citations->isNotEmpty())
Exhibits: @foreach($citations as $c) {{ $c['exhibit']->exhibit_ref }} @endforeach
@endif {{-- Evidence prompts — questions to ask, never answers --}} @if($openPrompts->isNotEmpty())
@foreach($openPrompts as $prompt) @endforeach
@endif @if($handledPrompts->isNotEmpty())
{{ $handledPrompts->count() }} handled evidence prompt{{ $handledPrompts->count() === 1 ? '' : 's' }}
@foreach($handledPrompts as $prompt) @endforeach
@endif