{% load i18n %}
<form id="exam-update-form" hx-post="{% url 'update_candidate_status' job.slug candidate.slug 'exam' 'Failed' %}" hx-swap='outerHTML' hx-target="#status-result-{{ candidate.pk }}"
    hx-on::after-request="const modal = bootstrap.Modal.getInstance(document.getElementById('candidateviewModal')); if (modal) { modal.hide(); }">
    <div class="d-flex justify-content-center align-items-center gap-2">
        <div class="form-check d-flex align-items-center gap-2">
            <input class="form-check-input" type="radio" name="exam_status" id="exam_passed" value="Passed" {% if candidate.exam_status == 'Passed' %}checked{% endif %}>
            <label class="form-check-label" for="exam_passed">
                <i class="fas fa-check me-1"></i> {% trans "Passed" %}
            </label>
        </div>
        <div class="form-check d-flex align-items-center gap-2">
            <input class="form-check-input" type="radio" name="exam_status" id="exam_failed" value="Failed" {% if candidate.exam_status == 'Failed' %}checked{% endif %}>
            <label class="form-check-label" for="exam_failed">
                <i class="fas fa-times me-1"></i> {% trans "Failed" %}
            </label>
        </div>
    </div>
    <div class="d-flex justify-content-center align-items-center mt-3 gap-2">
        <div class="w-25 text-end pe-none">
            <label for="exam_score" class="form-label small text-muted">{% trans "Exam Score" %}</label>
        </div>
    <div class="w-25">
        <input type="number" class="form-control form-control-sm" id="exam_score" name="exam_score" min="0" max="100" required value="{{ candidate.exam_score }}">
    </div>
    <div class="w-25 text-start ps-none">
    </div>
</div>
    <div class="text-center mt-3">
        <button type="submit" class="btn btn-success btn-sm">
            <i class="fas fa-check me-1"></i> {% trans "Update" %}
        </button>
    </div>
</form>

