@extends('layouts.full') @section('title') {!! trans('labels.LbTitleQuizs4',['name'=>$item->name]) !!} @endsection @section('content-main') @if(isset($errorMessage) && $errorMessage)
{!! config('dgc-icons.return') !!}
Erreur : {{ $errorMessage }}
@else @php $successCount = collect($data)->where('decision', 'success')->count(); $errorCount = collect($data)->where('decision', 'error')->count(); @endphp {{-- TITRE DE LA PAGE --}}
{!! config('dgc-icons.return') !!} @component('components.cards.card', ['class' => 'flex-fill dgc-header-decision-tree'])

{{ trans_choice('labels.LbQuestionDecisionTree', count($data), ['count' => count($data)]) }}

@if(count($data))
{{ trans_choice('labels.LbQuestionDecisionTreeSuccess',$successCount, ['count' => $successCount]) }}
{{ trans_choice('labels.LbQuestionDecisionTreeError', $errorCount, ['count' => $errorCount]) }}
@endif
@component('components.buttons.quiz_test',['quizId'=>$item->id,'survey'=>$item->survey,'questions_count'=>null])@endcomponent @component('components.buttons.quiz_export_structure',['quizId'=>$item->id])@endcomponent
@endcomponent
@foreach($data as $combinaison)
{{-- STATUS OPERATIONEL--}} @if($combinaison['decision']=='success')
Opérationnel
@endif {{-- STATUS Erreur--}} @if($combinaison['decision']=='error')
Erreur
@endif
{{-- ITEM QUESTION --}} @foreach($combinaison['path'] as $item) @if($item['isEndingQuestion']) {!! config('dgc-icons.ending_text') !!} @continue @endif @php // Définir les couleurs des badges en fonction des conditions $badgeColor = $item['required'] ? 'danger' : 'success'; $textColor = 'black'; $isRecentlyShowUnlocked=$item['initiallyHidden']? "dgc-icons.detail" : ''; $showQuestionIcon=isset($item['conditionShowItems'])? "dgc-icons.detail" : ''; if(isset($item['conditionShowItems'])){ $hiddenItemIcon= true ? "dgc-icons.eye-slash-fill" : ''; $badgeColor='gray-400'; } @endphp @php // Définir les couleurs des badges en fonction des conditions $badgeColor = $item['required'] ? 'danger' : 'success'; $textColor = 'black'; @endphp @if ($isRecentlyShowUnlocked) @php $foundItem = collect($item['recentlyUnlockedQuestions'])->firstWhere( 'unlocked_id', $item['id'], ); @endphp {!! $item['label'] !!} {!! config($isRecentlyShowUnlocked) !!} par @if($foundItem) {{ $quiz->getQuestionById($questions, $foundItem['unlocked_by'])['name'] }} @endif @else {!! $item['label'] !!} @endif @if(isset($item['conditionItems']) && $item['hasCondition'] && !isset($item['conditionShowItems'])) @php $itemNamesString = implode(' ou ', $item['conditionItems']); @endphp {!! ($itemNamesString) !!} {!! config('dgc-icons.arrow-right') !!} {{-- ITEMS REPONSES PAR DEFAULT SI CONDITIONS --}} @elseif(isset($item['defaultConditionItems']) && $item['hasCondition']) @php $defaultItemNamesString = implode(', ', $item['defaultConditionItems']); @endphp @if(!count($item['defaultConditionItems']) && !$item['required']) {{-- pas de réponse ou tout reponse --}} @else {!! $defaultItemNamesString !!} @endif @endif @if (isset($item['conditionShowItems'])) @php $values=is_array($item['conditionShowItems']['value'])?$quiz->getOptionsTitleFromQuestions($questions,$item['conditionShowItems']['value']):$item['conditionShowItems']['value']; $unlockedQuestionName=$quiz->getQuestionById($questions, $item['conditionShowItems']['unlocked_question'])['name']??''; @endphp {!! $values!!} {!! config("dgc-icons.detail") !!} {{ $unlockedQuestionName }} @endif @if (isset($item['hide_option'])) @php $conditionData = $item['hide_option']; $questionModel = $item['question']; $content = is_array($conditionData['value']) ? $quiz->getOptionsTitleFromQuestions($questions, $item['hide_option']['value']) : $conditionData['value']; $hidden_options_labels =$quiz->getOptionsTitleFromQuestions($questions,$conditionData['hidden_options']); $questionOfHiddenOption =$quiz->getQuestionById($questions,$conditionData['question_id']??0)['name']; @endphp {{-- @dump($quiz->getOptionById($item['question']['choices'],$item['hide_option']['value'])) --}} {!! $content !!} {!! config('dgc-icons.eye-slash-fill')!!} {{$questionOfHiddenOption.' | '.$hidden_options_labels}} @endif @if(isset($item['hasHiddenOptions'])) @foreach($item['hasHiddenOptions'] as $hiddenOption) @php $hiddenOptionsLabels= is_array($hiddenOption['answer'])?implode('et',$hiddenOption['answer']):$hiddenOption['answer']; @endphp {!! $hiddenOptionsLabels!!} {!! config('dgc-icons.eye-slash-fill')!!} par {{ $quiz->getQuestionById($questions, $hiddenOption['hidden_by'])['name'] }} @endforeach @endif {{-- @if($item['question']->isChoice()) --}} {{-- @endif --}} @endforeach {{-- Afficher le message de fin --}} @if($combinaison['decision'] == 'error')
{!! $combinaison['message'] !!} @endif
@endforeach
@endif @endsection