@php $time_spent = 0; $answerOld = []; if (isset($last_answer) && !is_null($last_answer)) { $current_state = json_decode($last_answer->current_state, true); $answerOld = $current_state[$question->id]['answers'] ?? []; $time_spent = $current_state[$question->id]['time_spent'] ?? 0; } $verifiedBackground = ""; if(isset($preview) && $question->verified == 1){ $verifiedBackground = ' style="background-color:#4DEEEA" ; color:"black"'; } @endphp {{--
{{var_dump($current_state)}}
--}}
  • Question : {{addZero($numberQuestion)}}
  • {{--@if($question->question_type != 'para') --}}
  • Weight : +{{$question->marks ?? 0}} @if(!in_array($question->question_type,array("essay","coding","coding_student"))) -{{isset($test->having_negative_mark) && $test->having_negative_mark == 1 ? $test->negative_mark : 0}} @endif
  • {{-- @endif --}}
@if (!isset($preview))
@endif
@if (!empty($question->has_graph) && !is_null($question->graph)) @include('student.test.exam.questions.load_chart')

{!! $question->question !!}

@else

{!! $question->question !!}

@endif
@if( $question->question_type != 'para' && $question->question_type != 'audio' && $question->question_type != 'video' && $question->question_type != 'video_embed' && $question->question_type != 'audio_embed' && !empty($question->question_file) )
@else @if($question->question_type == 'audio')
@elseif($question->question_type == 'video') @php $video_path= $question->question_file; if($question->question_file_is_url){ $video_path= $question->question_file; } @endphp
@elseif($question->question_type == 'video_embed')
@elseif($question->question_type == 'audio_embed')
@elseif($question->question_type == 'para') @if($question->question_file_is_url == 1 && !empty($question->question_file))
@endif @endif @endif @isset ($preview) @php // $explanation = strip_tags($question->explanation ?? null); $explanation = strpos($question->explanation,"img") ? $question->explanation : strip_tags($question->explanation); @endphp @if (!empty($explanation))

Explanation:

{!! $question->explanation !!}
@endif @endisset
@if (in_array($question->question_type, ['para','video','audio', 'video_embed','audio_embed'])) @include('student.test.exam.questions.question_para', [ 'answerOld' => $answerOld, 'numberQuestion' => $numberQuestion, ]) @else @if ($question->question_type === "radio") @php $answers = json_decode($question->answers, true); $i=1; @endphp @if (is_array($answers) && count($answers) > 0) @foreach($answers as $answer)
@php $option_value = $answer['option_value'] ?? null; if (is_array($option_value)) { $option_value = json_encode($option_value); } $option_value = trim($option_value); $nameInput = $question->id.'[]'; $checked = ""; if (is_array($answerOld)) { $collection = collect($answerOld); $collection->where('name', $nameInput); $record = $collection->first(); if ( isset($isTest) && isset($record['answer']) && $record['name'] == $nameInput && $record['answer'] == $i ) { $checked = "checked"; } } @endphp
@php $i = $i +1; @endphp @endforeach @endif @elseif(in_array($question->question_type, ['coding', 'coding_student'])) @include('student.test.exam.questions.question_coding', [ 'answerOld' => $answerOld, 'numberQuestion' => $numberQuestion, ]) @else @include('student.test.exam.questions.question_'.$question->question_type, [ 'answerOld' => $answerOld, 'numberQuestion' => $numberQuestion, ]) @endif @endif @push("styles") @endpush