Quizzes List

@foreach ($groups as $key => $group)

{{-- @forelse ($topics as $key=>$topic)
{{$topic->name}}
--}}
{{-- begin:quiz --}} {{-- other quiz students don't have attempts --}} @foreach ($quizzes as $key => $quiz) @if ($quiz->gid == $group->gid) @php $found = 0; $now = now(); $start = new \Carbon\Carbon( date('Y-m-d H:i:s', strtotime("$quiz->start_date $quiz->start_time")), ); $end = new \Carbon\Carbon( date('Y-m-d H:i:s', strtotime("$quiz->end_date $quiz->end_time")), ); @endphp @if ($now >= $start && $quiz->allow_submit_after_end_time) @php $found = 1; @endphp @elseif ($quiz->is_posted == 0 && $now >= $start && $now <= $end) @php $found = 1; @endphp @else @php $found = 0; @endphp @endif @endif @endforeach {{-- end:quiz from question bank --}} {{-- begin:quiz from file --}} {{-- Quiz file attempts --}} {{-- {{ dd($quiz_file_attempts_composed_group); }} --}} @foreach ($quiz_file_attempts as $key => $quiz) @if ($quiz->gid == $group->gid) @php $found = 0; $now = now(); $start = new \Carbon\Carbon(date('Y-m-d H:i:s',strtotime("$quiz->attempt_start_date $quiz->attempt_start_time"))); $end = new \Carbon\Carbon(date('Y-m-d H:i:s',strtotime("$quiz->attempt_end_date $quiz->attempt_end_time"))); @endphp @if ($now >= $start && $quiz->allow_submit_after_end_time && $quiz->is_submit == 0) @php $found = 1; @endphp @elseif ($quiz->is_posted == 0 && $now >= $start && $now <= $end && $quiz->attempts_remainder > 0 ) @php $found = 1; @endphp @else @php $found = 0; @endphp @endif @if ($quiz->is_graded && $quiz->is_posted)

Feedback

{{$quiz->feedback ? strip_tags($quiz->feedback) : '-----'}}

Grade

{{$quiz->grade}}

Ratio

{{$quiz->ratio}} %

Feedback atachment

@forelse ($quiz_feedback_attachments->where('quiz_id',$quiz->id) as $attachment) @if(is_null($attachment->url)) File Not Found @else {{$attachment->file_name}} @endif @empty No attachments @endforelse

Mark scheme

@forelse ($quiz_markscheme->where('quiz_id',$quiz->id) as $attachment) @if(is_null($attachment->url)) File Not Found @else {{$attachment->file_name}} @endif @empty No attachments @endforelse

@endif @endif @endforeach {{-- other quiz students don't have attempts --}} @foreach ($quiz_files as $key => $quiz) @if ($quiz->gid == $group->gid) @php $found = 0; $now = now(); $start = new \Carbon\Carbon( date('Y-m-d H:i:s', strtotime("$quiz->start_date $quiz->start_time")), ); $end = new \Carbon\Carbon( date('Y-m-d H:i:s', strtotime("$quiz->end_date $quiz->end_time")), ); @endphp @if ($now >= $start && $quiz->allow_submit_after_end_time) @php $found = 1; @endphp @elseif ($quiz->is_posted == 0 && $now >= $start && $now <= $end) @php $found = 1; @endphp @else @php $found = 0; @endphp @endif @endif @endforeach {{-- end:quiz from file --}} {{-- begin:hyperlink quiz --}} {{-- Quiz attempts --}} @foreach ($hyperlink_quiz_attempts as $key => $quiz) @if ($quiz->gid == $group->gid) @php $found = 0; $now = now(); $start = new \Carbon\Carbon(date('Y-m-d H:i:s',strtotime("$quiz->attempt_start_date $quiz->attempt_start_time"))); $end = new \Carbon\Carbon(date('Y-m-d H:i:s',strtotime("$quiz->attempt_end_date $quiz->attempt_end_time"))); @endphp @if ($now >= $start && $quiz->allow_submit_after_end_time && $quiz->is_submit == 0) @php $found = 1; @endphp @elseif ( $quiz->is_posted == 0 && $now >= $start && $now <= $end && $quiz->attempts_remainder > 0 ) @php $found = 1; @endphp @else @php $found = 0; @endphp @endif @if ($quiz->is_graded && $quiz->is_posted)

Feedback

{{$quiz->feedback ? strip_tags($quiz->feedback) : '-----'}}

Grade

{{$quiz->grade}}

Ratio

{{$quiz->ratio}} %

Feedback atachment

@forelse ($hyperlink_quiz_feedback_attachments->where('quiz_id',$quiz->id) as $attachment) @if(is_null($attachment->url)) File Not Found @else {{$attachment->file_name}} @endif @empty No attachments @endforelse

Mark scheme

@forelse ($hyperlink_quiz_markscheme->where('quiz_id',$quiz->id) as $attachment) @if(is_null($attachment->url)) File Not Found @else {{$attachment->file_name}} @endif @empty No attachments @endforelse

@endif @endif @endforeach {{-- other quiz students don't have attempts --}} @foreach ($hyperlink_quizzes as $key => $quiz) @if ($quiz->gid == $group->gid) @php $found = 0; $now = now(); $start = new \Carbon\Carbon( date('Y-m-d H:i:s', strtotime("$quiz->start_date $quiz->start_time")), ); $end = new \Carbon\Carbon( date('Y-m-d H:i:s', strtotime("$quiz->end_date $quiz->end_time")), ); @endphp @if ($now >= $start && $quiz->allow_submit_after_end_time) @php $found = 1; @endphp @elseif ($quiz->is_posted == 0 && $now >= $start && $now <= $end) @php $found = 1; @endphp @else @php $found = 0; @endphp @endif @endif @endforeach {{-- end:hyperlink quiz --}} @if ( $quiz_files->count() == 0 && $quiz_file_attempts->count() == 0 && $quizzes->count() == 0 && $hyperlink_quiz_attempts->count() == 0 && $hyperlink_quizzes->count() == 0)

No data been found

@endif {{-- end:quiz --}}
{{-- @empty @endforelse --}}
@endforeach @php $gkey = 1000; @endphp @foreach ($composed_groups as $group) @php $gkey += 1; @endphp

{{-- {{ dd($quiz_file_attempts_composed_group); }} --}} @foreach ($quiz_file_attempts_composed_group as $key => $quiz) @if ($quiz->compose_group_id == $group->compose_group_id) @php $found = 0; $now = now(); $start = new \Carbon\Carbon( date('Y-m-d H:i:s', strtotime("$quiz->start_date $quiz->start_time")) ); $end = new \Carbon\Carbon( date('Y-m-d H:i:s', strtotime("$quiz->end_date $quiz->end_time")) ); @endphp @if ($now >= $start && $quiz->allow_submit_after_end_time && $quiz->is_submit == 0) @php $found = 1; @endphp @elseif ($quiz->is_posted == 0 && $now >= $start && $now <= $end && AppHelper::instance()->getAttemptsQuiz($quiz->quiz_files_quiz_id) != 0) @php $found = 1; @endphp @else @php $found = 0; @endphp @endif @if ($quiz->is_graded && $quiz->is_posted)

Feedback

{{ $quiz->feedback ? strip_tags($quiz->feedback) : '-----' }}

Grade

{{ $quiz->grade }}

Ratio

{{ $quiz->ratio }} %

Feedback atachment

@forelse ($quiz_feedback_attachments->where('quiz_id',$quiz->id) as $attachment) @empty No attachments @endforelse

Mark scheme

@forelse ($quiz_markscheme->where('quiz_id',$quiz->id) as $attachment) @empty No attachments @endforelse

@endif @endif @endforeach {{-- other quiz students don't have attempts --}} @foreach ($hyperlink_quizzes_composed_group as $key => $quiz) @if ($quiz->compose_group_id == $group->compose_group_id) @php $found = 0; $now = now(); $start = new \Carbon\Carbon( date('Y-m-d H:i:s', strtotime("$quiz->start_date $quiz->start_time")), ); $end = new \Carbon\Carbon( date('Y-m-d H:i:s', strtotime("$quiz->end_date $quiz->end_time")), ); @endphp @if ($now >= $start && $quiz->allow_submit_after_end_time) @php $found = 1; @endphp @elseif ($quiz->is_posted == 0 && $now >= $start && $now <= $end) @php $found = 1; @endphp @else @php $found = 0; @endphp @endif @endif @endforeach {{-- end:hyperlink quiz --}}
@endforeach