@extends('layouts.app') @push('css') @endpush @section('content')

Question Preview

@foreach ($setquestion as $key=>$item)
{{$key+1}}. {{$item->question}}
{{$item->mark}}
@php $allanswer=DB::table('question_answers')->where('setquestion_id',$item->id)->first(); $options=DB::table('question_mcqs')->where('setquestion_id',$item->id)->get(); $answers=DB::table('question_answers') ->select('question_answers.id','question_mcqs.option') ->join('question_mcqs','question_mcqs.id','=','question_answers.answer') ->where('question_answers.setquestion_id',$item->id)->first(); @endphp
@if(!$options->isEmpty()) @foreach ($options as $key=>$option)
{{$key+1}}.{{$option->option}}
@endforeach @if (isset($answers->option)) Answer:{{ $answers->option}} @endif @else @endif
@endforeach
@endsection @push('js') @endpush