@php $lesson_history = App\Models\Watch_history::where('course_id', $course_details->id) ->where('student_id', auth()->user()->id) ->firstOrNew(); $completed_lesson_arr = json_decode($lesson_history->completed_lesson, true); $completed_lesson_arr = is_array($completed_lesson_arr) ? $completed_lesson_arr : array(); @endphp
@csrf @foreach ($questions as $key => $question)
{{ ++$key }} @if($question->type == 'fill_blanks')
@php $correct_answers = json_decode($question['answer'], true); $question_title = remove_js(htmlspecialchars_decode_($question['title'])); foreach($correct_answers as $correct_answer): $question_title = str_replace($correct_answer, ' _____ ', $question_title); endforeach; @endphp {{ $question_title; }}
@else
{!! $question->title !!}
@endif
@if ($question->type == 'mcq') @php $options = json_decode($question->options, true) ?? []; @endphp @foreach ($options as $index => $option)
@endforeach @elseif($question->type == 'fill_blanks') {{ get_phrase('You can keep multiple answers. Just put your answer and hit enter.') }} @elseif($question->type == 'true_false')
@endif
@endforeach
@if ($questions->count() > 0)
@if ($submits->count() < $quiz->retake) @endif
@endif @include('course_player.init')