@extends('layouts.app') @section('titlePage', 'Student Wise Reports') @section('content')
@if(session()->has('message.level')) @endif
Search Student
X
@if (request()->has('student_id'))
@endif
@if (request()->has('student_id'))
STUDENT DETAILS
@forelse ($students as $student) @empty @endforelse
Student Name Campus Details Batch Department Registration Number Student Email ID
{{ $student->fullname }} {{ $student->campus->campus_title }},
{{ $student->campus->campus_location }}
{{ $student->batch->batch_title }} {{ $student->department->d_name }} {{ $student->registration_number }} {{ $student->email }}
No results...
Tests/Assignments Details
Details Scheduled Attended
Monitored Tests {{ $scheduled["test"] }} {{ $attended["test"] }}
Company Specific Tests {{ $company["test"] }} {{ $company["assignment"] }}
Assignments {{ $scheduled["assignment"] }} {{ $attended["assignment"] }}
@if($attended["test"]>0)
Tests Report
@endif @else
STUDENT DETAILS
Student Name Campus Details Batch Department Registration Number Student Email ID
No results...
@endif
@endsection @push('script') @if (!empty($tests_attend)) @php $marks_obtained = $tests_attend->pluck('marks_obtained')->all(); $labels = $tests_attend->pluck('test.title')->all(); $subject_analysis = $tests_attend->pluck('subject_analysis')->all(); $subject_id = array(); $array_subject = array(); $bg_color = array('#B8255f','#DB4035','#ff9933','#fad000','#afb83b','#7ecc49','#299438','#158fad','#14aaf5','#4073ff','#884dff','#af38eb','#eb96eb','#e05194'); foreach($subject_analysis as $key => $subjects){ $json_subject = array_values(json_decode($subjects, true)); array_push($array_subject,$json_subject); foreach($json_subject as $value){ if(!in_array(($value['subject_id']),$subject_id)){ array_push($subject_id,$value['subject_id']); } } } /* collect all subjects ids */ $data_list = array(); $data_sub_label = array(); foreach($subject_id as $value){ $data = array(); $data_label = array(); foreach($test_attend_mark as $key => $val){ $score = null; $sub_label = null; if(array_key_exists($value,$val)){ $score = $val[$value]["score"]; $sub_label = $labels[$key]." - Mark: ".$val[$value]["sub_label"]; } array_push($data,$score); array_push($data_label,$sub_label); } $data_list[$value] = $data; $data_sub_label[] = $data_label; } //dd($data_sub_label); /* get all subject lables */ $datasets = ''; $label_section = ''; foreach($data_list as $key => $value){ $key_subject = array_search($key, array_column($subject, 'id')); $label_section .= "'".$subject[$key_subject]["subject_title"]."',"; } //dd($labels); /* select dataset based on test */ foreach($labels as $key => $value){ $color_key = $key%10; $datasets .= "{ label: ['".$value." ( Total marks ".$tests_attend[$key]->marks_obtained." / ".$tests_attend[$key]->total_marks." )'], data: ["; foreach($data_list as $data_mark){ if(!is_null($data_mark[$key])){ $datasets .= "'".round($data_mark[$key],1)."',"; }else{ $datasets .= "'null',"; } } $datasets .= "], backgroundColor: '".$bg_color[$color_key]."', minBarLength: 10, }, "; } @endphp @endif @endpush