@php($is_label = $item->isLabel()) @php($color = $is_label ? 'info' : 'success') @php($editing = $item->id == request('question_id')) @if (!$editing) @component('components.cards.status', [ 'color' => $color, 'class' => 'mb-4 quiz-element ' . ($editing ? 'in_progress_question' : ''), 'attributes' => 'data-type=' . $item->type . ' data-id=' . $item->id . ' data-ischoice=' . (int) $item->isChoice(), ])
{{-- content --}}
{!! config('dgc-icons.' . $item->type) !!} @if (!$is_label) {{ $item->getQuestionLabel() }} @else {{-- {{ $item->title ?? trans('labels.' . $item->type . '') }} --}} {{ trans('labels.' . $item->type . '') }} @endif @include('quiz.question-tags', ['item' => $item])
@if ($editing) {{ __('labels.in_progress') }} @endif
{{-- titre du question --}} @if (!$is_label)

{!! $item->title_with_trigger !!}

@endif {{-- answers --}} @php($has_table_questions = $item?->option('table_questions')) @php($table_questions_items = $item?->option('table_questions_items')) @if (isset($has_table_questions) && $has_table_questions == 1 && !empty($table_questions_items)) {{-- get the parent child questions collection --}} @php($child_questions = $item->childQuestions()->get())
@foreach ($table_questions_items as $id_child => $tb_val)
{{-- get a single child question from the collection --}} @php($child_question = $child_questions->where('id', (int) $id_child)->first())

{{ __('labels.LbQuestionTableItems', ['item' => $tb_val]) }}

@include('quiz.answers.answers', [ 'child_question' => $child_question, 'item' => $item, 'is_label' => $is_label, 'id_child' => $id_child, 'class' => 'dgc-form-input', ])
@endforeach
@else @include('quiz.answers.answers', [ 'item' => $item, 'is_label' => $is_label, 'id_child' => null, ]) @endif
{{-- params --}} @if (!in_array($quiz_status, config('constants.quizs_not_editable')))
{!! config('dgc-icons.gear') !!} {{-- pour l'element titre --}} @if ($is_label && $question_elements_count && $item?->option('display_in_question_screen') === '0') {!! config('dgc-icons.sort-numeric') !!} @endif @if (!$is_label) @if ($questions_count > 1 && !in_array($item->type, $item::$question_without_conditions)) {!! config('dgc-icons.diagram') !!} @endif {!! config('dgc-icons.duplicate') !!} @if ($questions_count > 1) {!! config('dgc-icons.sort-numeric') !!} @endif @if (in_array($item->type, $item::$mutable_elements) && $item->option('scale_type') != 'numeric_with_steps') {!! config('dgc-icons.substitute') !!} @endif @endif
@endif
@endcomponent @else {{-- ENCOURS D'EDITION --}}
{!! config('dgc-icons.' . $item->type) !!} {{ $item->getQuestionLabel() }} @if(isset($item->title) && !empty($item->title) && $item->getQuestionLabel() != $item->title) {!! strip_tags($item->title) !!} @endif
@endif