@extends('student.layouts.default') @section('content')
...
{{ $chapter_name }}
{{ $unit_name }}
@foreach($chapters as $key=>$chapter)
@php $units = App\Models\Unit::where('chapter_id',$chapter->id)->get(); @endphp
    @foreach($units as $key=>$unit) @php $lastAttemptArray = App\Models\StudentVideoQuiz::where('unit_id',$unit->id) ->where('student_id',STUDENT_ID) ->latest()->first(); if($lastAttemptArray) $lastAttempt = $lastAttemptArray->attempt; else $lastAttempt = 0; $quizPoint = App\Models\Question::where('unit_id',$unit->id)->sum('mark'); $point = App\Models\StudentVideoQuiz::where('unit_id',$unit->id) ->where('student_id',STUDENT_ID) ->where('attempt',$lastAttempt) ->where('is_correct',1)->count(); if($quizPoint>0) $percentage = ($point/$quizPoint)*100; else $percentage = 0; $quiz_complete = 0 ; if($point == $quizPoint) $quiz_complete = 1; @endphp
  • @endforeach
@endforeach
@if(@$quizes->enable_video && $video)
@endif
@endsection @section('pagecss') @endsection @section('pagescripts') @endsection @push('page-scripts') @endpush