Fill in the Blanks Question @include('dashboard.questions.tabs.add_question') @if (!isset($question))
! Note - Wrap the word or words you wish to make a blank with ##(DOUBLE HASH). E.g. ##BLANK_ITEM##. The system will automatically convert them to empty blanks, and users will be provided with text boxes to enter their responses.
@endif @if (isset($question)) @php // For edit: Use existing answers if available; for create: Default to 2 blank answers $defaultAnswers = old( 'answers', isset($question) && $question->questionAnswers->isNotEmpty() ? $question->questionAnswers->map(fn($qa) => ['answer' => $qa->answer->answer])->toArray() : [['answer' => ''], ['answer' => '']], ); @endphp @foreach ($defaultAnswers as $index => $answer)
@error('answers.' . $index . '.answer')
{{ $message }}
@endif
@endforeach @endif