@extends('layouts.teacher') @section('title', $homework->title.' · Homework · '.config('brand.name')) @section('content')
Back Edit @if (session('status'))
{{ session('status') }}
@endif @if ($errors->any())
{{ $errors->first() }}
@endif

Status: {{ $homework->assigned_status?->label() ?? 'Assigned' }}

Submit: {{ $homework->submissionLabel() }}@if ($homework->total_marks) · {{ $homework->total_marks }} marks @endif

@if ($homework->details)
Details
{!! nl2br(e($homework->details)) !!}
@endif @if ($homework->instructions)
Instructions
{!! nl2br(e($homework->instructions)) !!}
@endif @include('lessons.partials.homework-files', ['homework' => $homework, 'downloadRoute' => 'teacher.homework.file']) @if (! $homework->isAssigned())
@csrf
@endif
Students
Awaiting marking
@if ($homework->assignees->isEmpty())

Assigned to all students currently enrolled in this subject.

@endif @if ($recipients->isEmpty())

No enrolled students yet. A parent must enrol the child in this subject first.

@else
@foreach ($recipients as $student) @php $submission = $homework->submissions->firstWhere('student_user_id', $student->id); @endphp @endforeach
Student Status
{{ $student->full_name }} @if ($submission?->status?->value === 'marked') Marked · {{ $submission->score }} / {{ $submission->total_marks ?: $homework->total_marks }} @elseif ($submission) {{ $submission->isResubmission() ? 'Resubmitted — awaiting marking' : 'Submitted — awaiting marking' }} @else To do @endif @if ($submission) {{ $submission->isAwaitingMark() ? 'Mark' : 'View mark' }} @endif
@endif
@endsection