{% extends "base.html" %} {% block title %}Results - HM QC{% endblock %} {% block extra_head %} {% endblock %} {% block content %}

QC Results

Run Another QC
{% if is_batch is defined and is_batch %} {# === BATCH RESULTS === #} {% if reports or (batch_results is defined and batch_results) %} {# Compute summary from DB reports (always available) #} {% set total = reports|length if reports else (batch_results.summary.total if batch_results else 0) %} {% set ns = namespace(passed=0, failed=0, warnings=0, score_sum=0, score_count=0) %} {% if reports %} {% for r in reports %} {% if r.status == 'passed' %}{% set ns.passed = ns.passed + 1 %}{% endif %} {% if r.status in ['failed', 'error'] %}{% set ns.failed = ns.failed + 1 %}{% endif %} {% if r.status == 'warning' %}{% set ns.warnings = ns.warnings + 1 %}{% endif %} {% if r.score is not none %}{% set ns.score_sum = ns.score_sum + r.score %}{% set ns.score_count = ns.score_count + 1 %}{% endif %} {% endfor %} {% endif %} {% set avg_score = (ns.score_sum / ns.score_count)|round(1) if ns.score_count > 0 else 0 %}
Batch QC completed: {{ total }} files processed

Batch Summary

{{ total }}
Total Files
{{ ns.passed }}
Passed
{{ ns.failed }}
Failed
{{ ns.warnings }}
Warnings
{{ avg_score }}
Avg Score
{% if reports %}
{% if batch_id %} Download All (ZIP) {% endif %}
{% endif %}

Per-File Results

{% if reports %} {% for report in reports %}
{{ report.filename }}
{% if report.score is not none %} {{ report.score|round(1) }} {% endif %} {{ report.status|upper }}
{% endfor %} {% endif %} {% else %} {# Batch in progress #}
{% endif %} {% elif report %} {# === SINGLE FILE RESULTS === #}
QC execution completed successfully!

{{ report.score|round(1) }}

Overall Score

{{ report.status|upper }}
Report Details

Filename: {{ report.filename }}

Job Number: {{ report.job_number or 'N/A' }}

Created: {{ report.created_at.strftime('%Y-%m-%d %H:%M:%S') }}

Full Report
{% else %} {# === PROGRESS VIEW (single file in progress) === #}
{% endif %}
{% endblock %} {% block extra_scripts %} {% if not report and not (reports is defined and reports) and not (batch_results is defined and batch_results) %} {% endif %} {% if is_batch is defined and is_batch and (reports is defined and reports) %} {% endif %} {% endblock %}