@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
| 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 }}
|
|
| @include('online.partials.homework-form', [ 'action' => route('online.homework.update', $hw), 'method' => 'PUT', 'prefix' => 'homework-'.$hw->id, 'row' => $hw, 'classCombos' => $classCombos, 'subjectMap' => $subjectMap, ]) | |||||||
| No homework matches your filters. | |||||||
{{ $detail->class_name }} · {{ $detail->subject }}
{{ $detail->instructions }}
@endif @if ($detail->attachments->isNotEmpty())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, ])