@extends('layouts.app') @section('title', 'Homework') @section('content') @php $accent = fn (string $s) => match ($s) { 'Past Due' => 'bg-amber-500/15 text-amber-700', 'Graded' => 'bg-sky-500/15 text-sky-700', default => 'bg-emerald-500/15 text-emerald-700', }; $toggle = function (string $key) use ($filters) { $current = $filters['sort']; $dir = $filters['dir']; if ($current === $key) { return route('online.homework', array_merge($filters, ['dir' => $dir === 'asc' ? 'desc' : 'asc'])); } return route('online.homework', array_merge($filters, ['sort' => $key, 'dir' => 'asc'])); }; $arrow = fn (string $key) => $filters['sort'] === $key ? ($filters['dir'] === 'asc' ? '↑' : '↓') : '↕'; @endphp

Assign, track submissions and grade homework for online classes

Homework

@include('partials.flashes')
@foreach ([ ['label' => 'Active Assignments', 'value' => $stats['Active Assignments']], ['label' => 'Pending Grading', 'value' => $stats['Pending Grading']], ['label' => 'Past Due', 'value' => $stats['Past Due']], ] as $stat)
{{ $stat['value'] }} {{ $stat['label'] }}
@endforeach
Clear
@forelse ($rows as $hw) @php $submitted = $hw->submittedCount(); $done = $hw->gradedCount(); $totalSubs = $hw->submissions()->count(); $pct = $totalSubs ? (int) round($done / $totalSubs * 100) : 0; @endphp @empty @endforelse
Title {{ $arrow('title') }} Subject {{ $arrow('subject') }} Class Due {{ $arrow('due') }} Marks Status Submissions Actions
{{ $hw->title }} {{ \Illuminate\Support\Str::limit($hw->instructions ?: 'No instructions', 60) }} @if ($hw->attachments->isNotEmpty()) {{ $hw->attachments->count() }} file(s) @endif
{{ $hw->subject }} {{ $hw->class_name }}
{{ $hw->isoDueDate() }} {{ $hw->due_time }}
{{ $hw->gradable ? $hw->total_marks.' pts' : '—' }} {{ $hw->status }}
{{ $done }}/{{ $submitted }}
View
@csrf @method('DELETE')
No homework matches your filters.
{{ $rows->total() }} assignments
@if ($detail)

{{ $detail->title }}

{{ $detail->class_name }} · {{ $detail->subject }}

Due {{ $detail->isoDueDate() }} {{ $detail->due_time }}
Marks {{ $detail->gradable ? $detail->total_marks.' pts' : 'Not graded' }}
Status {{ $detail->status }}
Late {{ $detail->allow_late ? 'Allowed' : 'Not allowed' }}
@if ($detail->instructions)

{{ $detail->instructions }}

@endif @if ($detail->attachments->isNotEmpty())
Attachments @foreach ($detail->attachments as $file)
{{ $file->name }} {{ \App\Support\Fmt::attachmentSize($file->size) }}
@endforeach
@endif
Submissions ({{ $detail->submissions->count() }}) {{ $detail->gradedCount() }} graded
@csrf @php $max = $detail->gradable ? ($detail->total_marks ?: 0) : 0; @endphp @foreach ($detail->submissions as $submission)
{{ $submission->student?->full_name ?? 'Unknown' }} {{ $submission->submitted_at ? 'Submitted '.$submission->submitted_at : 'Not submitted' }}
@if ($detail->gradable)
@if ($max > 0) /{{ $max }} @endif
@else {{ $submission->status === 'Graded' ? 'Graded' : 'Submitted' }} @endif
@endforeach
Close
@endif
any()) open @endif> Create Homework Assignment

Fields marked * are required.

@include('online.partials.homework-form', [ 'action' => route('online.homework.store'), 'method' => 'POST', 'prefix' => 'homework-new', 'row' => null, 'classCombos' => $classCombos, 'subjectMap' => $subjectMap, ])
@endsection @push('scripts') @endpush