<?php $pageTitle = 'Exercises'; ?>
<div class="mb-4"><p class="text-secondary">Manage exercises across all modules</p></div>
<?php if (empty($exercises)): ?>
    <div class="empty-state"><i class="fas fa-dumbbell"></i><h5>No Exercises</h5><p>Create exercises from the module builder.</p></div>
<?php else: ?>
<div class="card-cix">
    <div class="table-responsive">
        <table class="table-cix"><thead><tr><th>#</th><th>Exercise</th><th>Module</th><th>Max Score</th><th>Pass Mark</th><th>Status</th></tr></thead>
        <tbody><?php foreach ($exercises as $i => $ex): ?>
        <tr><td><?= $i + 1 ?></td><td><strong><?= e($ex['title']) ?></strong></td><td class="text-secondary"><?= e($ex['module_title'] ?? '') ?></td>
        <td><?= (int)$ex['max_score'] ?></td><td><?= (int)$ex['pass_mark'] ?>%</td>
        <td><span class="badge-cix <?= $ex['is_published'] ? 'badge-active' : 'badge-pending' ?>"><?= $ex['is_published'] ? 'Published' : 'Draft' ?></span></td></tr>
        <?php endforeach; ?></tbody></table>
    </div>
</div>
<?php endif; ?>
