@extends('backEnd.master')
@section('title')
@lang('exam.active_exams')
@endsection
@section('mainContent')
@php
$route = moduleStatusCheck('OnlineExam')==true ? 'om-take_online_exam' : 'take_online_exam' ;
@endphp
@foreach($record->OnlineExam as $online_exam)
@php
@$submitted_answer = $student->studentOnlineExam->where('online_exam_id',$online_exam->id)->first();
@endphp
@lang('exam.title')
@if(moduleStatusCheck('University'))
@lang('university::un.semester_label') (@lang('common.section'))
@else
@lang('common.class_Sec')
@endif
@lang('exam.subject')
@lang('exam.exam_date')
@lang('exam.duration')
@lang('common.status')
@endforeach
{{@$online_exam->title}}
@if(moduleStatusCheck('University'))
{{@$online_exam->unSemesterLabel->name.' ('.@$online_exam->section->section_name.')'}}
@else
{{@$online_exam->class->class_name.' ('.@$online_exam->section->section_name.')'}}
@endif
{{@$online_exam->subject !=""?@$online_exam->subject->subject_name:""}}
{{@$online_exam->date != ""? dateConvert(@$online_exam->date):''}}
@php
$totalDuration = $online_exam->end_time !='NULL' ? Carbon::parse($online_exam->end_time)->diffinminutes( Carbon::parse($online_exam->start_time) ) : 0;
@endphp
Time: {{date('h:i A', strtotime(@$online_exam->start_time)).' - '.date('h:i A', strtotime(@$online_exam->end_time))}}
{{ $online_exam->end_time !='NULL' ? gmdate($totalDuration) : 'Unlimited'}} @lang('exam.minutes')
{{--
{{ $online_exam->total_durations }} @lang('exam.minutes')
--}}
@php
$startTime = strtotime($online_exam->date . ' ' . $online_exam->start_time);
$endTime = strtotime($online_exam->date . ' ' . $online_exam->end_time);
$now = date('h:i:s');
$now = strtotime("now");
// dump($submitted_answer);
@endphp
@if( !empty( $submitted_answer))
@if(@$submitted_answer->status == 1)
@if($submitted_answer->student_done==1)
@lang('exam.already_submitted')
@elseif($startTime <= $now && $now <= $endTime)
@lang('exam.take_exam')
@elseif($startTime >= $now && $now <= $endTime)
Waiting
@elseif($now >= $endTime)
Closed
@else
@lang('exam.already_submitted')
@endif
@endif
@else
@if($startTime <= $now && $now <= $endTime)
@lang('exam.take_exam')
@elseif($startTime >= $now && $now <= $endTime)
@lang('common.waiting')
@elseif($now >= $endTime)
@lang('common.closed')
@endif
@endif