@if(!$question->contentType)

ERROR: Content type is missing for question "{{ $question->name }}" (ID: {{ $question->id }})

@else @switch($question->contentType->slug) @case('free_form_text') @case('string') @case('hyperlink') @case('text') @case('rich_text') required ? 'required' : '' }}> @break @case('inline_html') @case('text_area') @case('long_text') @break @case('decimal_number') @case('integer_number') @case('currency') @case('percent') required ? 'required' : '' }}> @break @case('date') @case('date_time') required ? 'required' : '' }}> @break @case('email_address') required ? 'required' : '' }}> @break @case('password') required ? 'required' : '' }}> @break @case('phone_number') required ? 'required' : '' }}> @break @case('check_box')
@break @case('list') @php // options is already cast to array in the model, so no need for json_decode $options = is_array($question->options) ? $question->options : []; @endphp @if(count($options) > 0) @else @endif @break @case('multiple_select') @php // options is already cast to array in the model, so no need for json_decode $options = is_array($question->options) ? $question->options : []; // Prepare options array for JavaScript - ensure proper format $jsOptions = []; foreach ($options as $option) { $optionId = is_array($option) ? ($option['id'] ?? $option['value'] ?? '') : $option; $optionValue = is_array($option) ? ($option['value'] ?? $option['label'] ?? $optionId) : $option; $jsOptions[] = ['id' => (string)$optionId, 'value' => (string)$optionValue]; } $jsOptionsJson = json_encode($jsOptions, JSON_HEX_APOS | JSON_HEX_QUOT); @endphp @if(count($jsOptions) > 0)
{{-- Add a hidden input for the counter to detect this as an answerable field --}} {{-- This MUST be inside the container and have name containing [answer] --}} {{-- Container for dynamic hidden inputs --}} {{-- Display selected options as badges --}}
{{-- Dropdown with options --}}
@else @endif @break @case('time_of_day') required ? 'required' : '' }}> @break @case('document')

Uploading... %

File uploaded successfully

@break @case('image')
Preview

Uploading... %

Image uploaded successfully

@break @case('timeduration')
required ? 'required' : '' }}> hrs
required ? 'required' : '' }}> min
@break @default @break @endswitch @endif