Files
alrahma_sunday_school/app/Views/assessments/forms.php
T
root 4b2dd4bdf8
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 48s
Tests / PHPUnit (push) Successful in 1m26s
add assessment guide
2026-09-10 06:49:53 -04:00

56 lines
4.3 KiB
PHP

<?= $this->extend('layout/management_layout') ?>
<?= $this->section('content') ?>
<div class="container-fluid py-3">
<div class="d-flex flex-wrap justify-content-between align-items-center gap-2 mb-3">
<div><h2 class="mb-1">Assessment Forms</h2><p class="text-muted mb-0">Build, publish, preview, and track individual assessments.</p></div>
<div class="d-flex gap-2">
<a class="btn btn-outline-secondary" href="<?= site_url('administrator/assessments/students') ?>">New Students</a>
<a class="btn btn-outline-primary" href="<?= site_url('administrator/assessments/pools') ?>">Question Pool</a>
<a class="btn btn-primary" href="<?= site_url('administrator/assessments/forms/new') ?>">Create Form</a>
</div>
</div>
<?= $this->include('assessments/_alerts') ?>
<div class="card border-primary-subtle shadow-sm mb-3">
<div class="card-header bg-primary-subtle"><strong>How to use assessments</strong></div>
<div class="card-body">
<div class="row g-3 small">
<div class="col-md"><span class="badge bg-primary me-1">1</span><strong>Questions</strong><div class="text-muted mt-1">Add or reorder questions in the shared <a href="<?= site_url('administrator/assessments/pools') ?>">Question Pool</a>.</div></div>
<div class="col-md"><span class="badge bg-primary me-1">2</span><strong>Create</strong><div class="text-muted mt-1">Create a form, choose its school year and questions, then publish it.</div></div>
<div class="col-md"><span class="badge bg-primary me-1">3</span><strong>Assess</strong><div class="text-muted mt-1">Open <a href="<?= site_url('administrator/assessments/students') ?>">New Students</a>, assign a form, and enter responses. Changes save automatically.</div></div>
<div class="col-md"><span class="badge bg-primary me-1">4</span><strong>Complete</strong><div class="text-muted mt-1">Add the student-specific Education Committee Note and complete the assessment.</div></div>
<div class="col-md"><span class="badge bg-primary me-1">5</span><strong>Review</strong><div class="text-muted mt-1">Review responses and edit the committee note at any time. Assessments are not scored.</div></div>
</div>
</div>
</div>
<div class="card shadow-sm"><div class="card-body"><div class="table-responsive">
<table class="table align-middle no-mgmt-sticky" data-no-mgmt-sticky>
<thead><tr><th>Name</th><th>School Year</th><th>Pool</th><th>Education Committee Note</th><th>Status</th><th>Questions</th><th>Assignments</th><th>Actions</th></tr></thead>
<tbody>
<?php if (empty($forms)): ?><tr><td colspan="8" class="text-muted text-center">No assessment forms yet.</td></tr><?php endif; ?>
<?php foreach ($forms as $form): ?>
<tr>
<td><?= esc($form['name']) ?></td>
<td><?= esc($form['school_year'] ?: '—') ?></td>
<td><?= esc($form['pool_name']) ?></td>
<td style="max-width:280px;white-space:pre-wrap"><?= esc($form['education_committee_note'] ?: '—') ?></td>
<td><span class="badge <?= $form['status'] === 'published' ? 'bg-success' : ($form['status'] === 'archived' ? 'bg-secondary' : 'bg-warning text-dark') ?>"><?= esc(ucfirst($form['status'])) ?></span></td>
<td><?= (int) $form['question_count'] ?></td>
<td><?= (int) $form['assignment_count'] ?></td>
<td><div class="d-flex flex-wrap gap-1">
<a class="btn btn-sm btn-outline-primary" href="<?= site_url('administrator/assessments/forms/' . $form['id'] . '/edit') ?>">Edit</a>
<a class="btn btn-sm btn-outline-secondary" href="<?= site_url('administrator/assessments/forms/' . $form['id'] . '/preview') ?>">Preview</a>
<?php if ($form['status'] !== 'published'): ?>
<form method="post" action="<?= site_url('administrator/assessments/forms/' . $form['id'] . '/publish') ?>" onsubmit="return confirm('Publish this assessment form?')">
<?= csrf_field() ?>
<button class="btn btn-sm btn-success" <?= (int)$form['question_count'] === 0 ? 'disabled title="Add questions before publishing"' : '' ?>>Publish</button>
</form>
<?php endif; ?>
</div></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div></div></div>
</div>
<?= $this->endSection() ?>