<?php $pageTitle = 'Pending Marking'; ?>
<div class="mb-4"><p class="text-secondary">Exercise submissions awaiting your review</p></div>
<?php if (empty($submissions)): ?>
    <div class="empty-state"><i class="fas fa-check-double"></i><h5>All Caught Up</h5><p>No submissions pending marking.</p></div>
<?php else: ?>
<div class="card-cix">
    <div class="table-responsive">
        <table class="table-cix">
            <thead><tr><th>Student</th><th>Exercise</th><th>Course</th><th>Submitted</th><th>Action</th></tr></thead>
            <tbody>
            <?php foreach ($submissions as $s): ?>
            <tr>
                <td><strong><?= e($s['first_name'] . ' ' . $s['last_name']) ?></strong></td>
                <td><?= e($s['exercise_title']) ?></td>
                <td class="text-secondary"><?= e($s['course_title']) ?></td>
                <td class="text-secondary small"><?= time_elapsed($s['submitted_at']) ?></td>
                <td><a href="<?= base_url('teacher/grade-submission/' . $s['id']) ?>" class="btn-cix btn-cix-sm btn-cix-primary"><i class="fas fa-pen"></i> Grade</a></td>
            </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div>
<?php endif; ?>
