{% extends "base.html" %} {% block title %}{{ cls['name'] }} — Teacher View{% endblock %} {% block content %}
Class Enrol Code
{% if cls['enrol_code'] %}
{{ cls['enrol_code'] }}
{% if cls['code_active'] %} Active — students can join {% else %} Disabled — new joins paused {% endif %}
{% else %}
No code generated yet
{% endif %}
{% if cls['enrol_code'] %}
{% endif %}
Share this code with students. They go to Dashboard → Join Class and enter it.

🏅 Leaderboard Settings

Control what students see on the class leaderboard.

(unchecked = show program count only)

📢 Announcements

Manage announcements →
{% set active_anns = announcements | selectattr('expires_at', 'none') | list if announcements else [] %} {% if announcements %}
{% for a in announcements[:3] %}
{% if a['pinned'] %}📌{% else %}📢{% endif %}
{{ a['title'] }} {{ a['created_at'][:10] }}
{% endfor %} {% if announcements|length > 3 %}

+{{ announcements|length - 3 }} more — view all

{% endif %}
{% else %}

No announcements yet. Post one →

{% endif %}

📋 Assignments

Manage assignments →
{% if assignments %}
{% for a in assignments %} {% endfor %}
ProgramDue dateNote
#{{ a['program_n'] }} {{ a['due_date'] }} {% if a['due_date'] < now_date %} Overdue {% endif %} {{ a['note'] or '—' }}
{% else %}

No assignments yet. Create one →

{% endif %}
{% if quiz_summary %}

🏆 Quiz Results

{% for s in quiz_summary %} {% endfor %}
Student Modules passed Modules attempted Pass rate
{{ s['username'] }} {{ s['modules_passed'] }}/12 {{ s['modules_attempted'] }} {% if s['modules_attempted'] > 0 %}
{{ (s['modules_passed']/12*100)|round|int }}% {% else %} No attempts {% endif %}
{% endif %} {% if streaks %}

🔥 Streak Leaderboard

{% for s in streaks %} {% endfor %}
StudentCurrent streakBest streakStudied today
{{ s['username'] }} 🔥 {{ s['current_streak'] }} day{{ 's' if s['current_streak'] != 1 else '' }} 🏆 {{ s['longest_streak'] }} {% if s['studied_today'] %} ✓ Yes {% else %} ✗ Not yet {% endif %}
{% endif %}

Student Summary

{% if summary %}
{% for s in summary %} {% endfor %}
RankStudent Programs doneProgress Exercises solvedActions
{{ loop.index }} {{ s['username'] }} {{ s['prog_done'] }}/108
{{ (s['prog_done']/108*100)|round|int }}%
{{ s['ex_done'] }}/108 Detail →
{% else %}
No students in this class yet
Ask the admin to assign students.
{% endif %}
{% if heatmap %}

Progress Heatmap — All 108 Programs

Completed   Not done

{% for mod_name in mod_names %} {% set prog_count = all_programs | selectattr('mod','equalto',mod_name) | list | length %} {% endfor %} {% for p in all_programs %} {% endfor %} {% for row in heatmap %} {% for mod in row['mods'] %} {% for cell in mod['cells'] %} {% endfor %} {% endfor %} {% endfor %}
Student {{ mod_name|truncate(18,True,'…') }} Total
#{{ p['n'] }}
{{ row['student']['username'] }} {{ row['total'] }}
{% endif %}
{% endblock %}