<?php $pageTitle = 'Grade Submission'; ?>
<div class="mb-3"><a href="<?= base_url('teacher/marking') ?>" class="text-secondary"><i class="fas fa-arrow-left me-1"></i> Back to Marking</a></div>
<div class="card-cix">
    <div class="card-cix-header"><h5 class="mb-0"><i class="fas fa-pen text-orange me-2"></i> Grade Submission #<?= $submission['id'] ?></h5></div>
    <div class="card-cix mb-3">
        <h6>Student Submission:</h6>
        <div class="lesson-content" style="background:var(--surface-2);"><?= nl2br(e($submission['submission_text'] ?? 'No text submitted')) ?></div>
        <?php if ($submission['attachment']): ?>
            <p class="mt-2"><a href="<?= asset_url('uploads/' . $submission['attachment']) ?>" target="_blank" class="btn-cix btn-cix-sm btn-cix-outline"><i class="fas fa-download"></i> View Attachment</a></p>
        <?php endif; ?>
    </div>
    <form method="POST" action="<?= base_url('teacher/grade-submission/' . $submission['id']) ?>">
        <?= csrf_field() ?>
        <div class="row g-3">
            <div class="col-md-6"><div class="form-group-cix"><label class="form-label-cix">Score (0-100)</label><input type="number" name="score" class="form-control-cix" min="0" max="100" required></div></div>
            <div class="col-12"><div class="form-group-cix"><label class="form-label-cix">Feedback</label><textarea name="feedback" class="form-control-cix" rows="4" placeholder="Provide feedback to the student..."></textarea></div></div>
        </div>
        <button type="submit" class="btn-cix btn-cix-accent"><i class="fas fa-save"></i> Submit Grade</button>
    </form>
</div>
