@extends('layouts.staff_dashboard') @section('title', 'Staff Dashboard') @section('content') @php $staffName = session('staff_data.name') ?? 'Faculty'; $staffDesg = session('staff_data.desg') ?? 'Faculty Member'; $deptLabel = $departmentName ?? ($staffEnhanced['dept_name'] ?? 'Department'); $batchLabel = $batchName ?? ($staffEnhanced['batch_name'] ?? 'Batch'); $courseList = collect($coursecounts ?? []); $totalCourses = $courseList->count(); $totalMaterials= $courseList->sum('materials'); $totalPqps = $courseList->sum('pqps'); $fbAvg = max(0, min(100, (float) ($feedbackData['average'] ?? 0))); $fbPctText = $feedbackData['percentage_formatted'] ?? number_format($fbAvg, 1); $fbCount = (int) ($feedbackData['count'] ?? 0); $fbStroke = $fbAvg >= 70 ? '#10b981' : ($fbAvg >= 50 ? '#f59e0b' : ($fbAvg > 0 ? '#f43f5e' : '#64748b')); $fbStatusText = $fbAvg >= 70 ? 'Excellent' : ($fbAvg >= 50 ? 'Good' : ($fbAvg > 0 ? 'Needs Focus' : 'No Reviews Yet')); $radius = 68; $circumference = 2 * pi() * $radius; $dashOffset = $circumference - ($fbAvg / 100) * $circumference; @endphp
Staff Avatar
{{ $deptLabel }} · Batch {{ $batchLabel }}

Welcome back, {{ $staffName }}

{{ $staffDesg }} — Manage your classes, track student mastery, and review feedback in real time.

Allocated Courses
{{ $totalCourses }}
Active for {{ $batchLabel }}
Study Materials
{{ $totalMaterials }}
Uploaded resources
Previous Question Papers
{{ $totalPqps }}
Published PQPs
Feedback Rating
{{ $fbPctText }}%
{{ $fbCount }} student {{ $fbCount === 1 ? 'review' : 'reviews' }}

Top Student Performers

By Course
@if(!empty($courseData) && count($courseData) > 0)
@foreach($courseData as $idx => $courseInfo) @endforeach
@foreach($courseData as $idx => $courseInfo)
@if($courseInfo['top_students']->count() > 0) @foreach($courseInfo['top_students'] as $rIdx => $student) @php $rank = $rIdx + 1; $medalClass = $rank === 1 ? 'st-rank-1' : ($rank === 2 ? 'st-rank-2' : ($rank === 3 ? 'st-rank-3' : 'st-rank-other')); @endphp
@if($rank === 1) @else #{{ $rank }} @endif
{{ $student->name }} {{ $student->regno }}
{{ $student->completed_questions }} Qs {{ gmdate('H:i:s', (int) $student->total_time) }}
@endforeach @else

No student activity recorded for this course yet.

@endif
@endforeach @else

Rankings will appear here once courses are allocated and students begin practicing.

@endif

Student Feedback

{{ $fbStatusText }}
{{ $fbPctText }}% {{ $fbCount }} {{ $fbCount === 1 ? 'feedback' : 'feedbacks' }}
Average Score
{{ $fbPctText }}%
Total Reviews
{{ $fbCount }}
70%+ Excellent 50–70% Good <50% Low
@endsection