---
type: "Source File"
title: "<div class=\"container-wide\">"
description: "{% extends \"base.html\" %} {% block title %}Leaderboard — CopeCheck Quiz{% endblock %} {% block content %} <div class=\"container-wide\"> <h1."
resource: "https://quiz.copecheck.com"
tags: ["copecheck", "quiz", "source-file", "html"]
timestamp: "2026-05-03T21:35:11Z"
site: "quiz"
source_path: "copecheck-quiz/templates/leaderboard.html"
---

# <div class="container-wide">

Source path: `copecheck-quiz/templates/leaderboard.html`  
Index snapshot generated: `2026-11-24T13:27:52Z`  
File modified: `2026-05-03T21:35:11Z`

```html
{% extends "base.html" %}
{% block title %}Leaderboard — CopeCheck Quiz{% endblock %}

{% block content %}
<div class="container-wide">
    <h1 style="color:var(--text-bright);margin-bottom:2rem;text-align:center">Leaderboard</h1>

    <div style="display:grid;grid-template-columns:1fr 1fr;gap:1.5rem">
        <div class="card">
            <h3 style="color:var(--red);margin-bottom:1rem">Most Coped</h3>
            <table class="lb-table">
                <thead><tr><th>#</th><th>Name</th><th>Score</th><th>Date</th></tr></thead>
                <tbody>
                {% for r in most_coped %}
                <tr>
                    <td>{{ loop.index }}</td>
                    <td>{{ r.display_name or 'Anonymous' }}</td>
                    <td style="color:var(--red);font-weight:700">{{ r.cope_score|int }}</td>
                    <td style="color:var(--text-dim);font-size:0.8rem">{{ r.completed_at[:10] if r.completed_at else '' }}</td>
                </tr>
                {% endfor %}
                {% if not most_coped %}<tr><td colspan="4" style="color:var(--text-dim)">No results yet. Be the first!</td></tr>{% endif %}
                </tbody>
            </table>
        </div>

        <div class="card">
            <h3 style="color:var(--teal);margin-bottom:1rem">Most Lucid</h3>
            <table class="lb-table">
                <thead><tr><th>#</th><th>Name</th><th>Score</th><th>Date</th></tr></thead>
                <tbody>
                {% for r in most_lucid %}
                <tr>
                    <td>{{ loop.index }}</td>
                    <td>{{ r.display_name or 'Anonymous' }}</td>
                    <td style="color:var(--teal);font-weight:700">{{ r.cope_score|int }}</td>
                    <td style="color:var(--text-dim);font-size:0.8rem">{{ r.completed_at[:10] if r.completed_at else '' }}</td>
                </tr>
                {% endfor %}
                {% if not most_lucid %}<tr><td colspan="4" style="color:var(--text-dim)">No results yet.</td></tr>{% endif %}
                </tbody>
            </table>
        </div>
    </div>

    <div style="display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-top:1.5rem">
        <div class="card">
            <h3 style="color:var(--text-bright);margin-bottom:1rem">Cope Type Distribution</h3>
            <canvas id="typeDistChart" height="250"></canvas>
        </div>
        <div class="card">
            <h3 style="color:var(--text-bright);margin-bottom:1rem">Average Score Over Time</h3>
            <canvas id="timeChart" height="250"></canvas>
        </div>
    </div>
</div>
{% endblock %}

{% block scripts %}
<script>
document.addEventListener('DOMContentLoaded', function() {
    const typeCounts = {{ type_counts|tojson }};
    const dailyStats = {{ daily_stats|tojson }};

    if (typeCounts.length && document.getElementById('typeDistChart')) {
        new Chart(document.getElementById('typeDistChart'), {
            type: 'bar',
            data: {
                labels: typeCounts.map(t => t.cope_type.replace(/_/g,' ')),
                datasets: [{
                    data: typeCounts.map(t => t.cnt),
                    backgroundColor: '#2a9d8f',
                    borderRadius: 4
                }]
            },
            options: {
                responsive: true,
                indexAxis: 'y',
                plugins: {legend:{display:false}},
                scales: {
                    x: {ticks:{color:'#8a8fa8'}, grid:{color:'rgba(42,157,143,0.1)'}},
                    y: {ticks:{color:'#8a8fa8',font:{size:10}}, grid:{display:false}}
                }
            }
        });
    }

    if (dailyStats.length && document.getElementById('timeChart')) {
        const sorted = [...dailyStats].reverse();
        new Chart(document.getElementById('timeChart'), {
            type: 'line',
            data: {
                labels: sorted.map(d => d.date),
                datasets: [{
                    label: 'Avg Score',
                    data: sorted.map(d => d.avg_cope_score),
                    borderColor: '#e63946',
                    backgroundColor: 'rgba(230,57,70,0.1)',
                    fill: true,
                    tension: 0.3
                }]
            },
            options: {
                responsive: true,
                plugins: {legend:{display:false}},
                scales: {
                    x: {ticks:{color:'#8a8fa8',maxRotation:45}, grid:{color:'rgba(42,157,143,0.1)'}},
                    y: {min:0,max:100,ticks:{color:'#8a8fa8'}, grid:{color:'rgba(42,157,143,0.1)'}}
                }
            }
        });
    }
});
</script>
{% endblock %}
```
