{% extends "exams/base.html" %} {% load static %} {% block title %} {% if mode == 'students' %} Upload Students - {{ project.name }} {% else %} Upload Scores - {{ project.name }} {% endif %} {% endblock %} {% block content %}

{% if mode == 'students' %} Upload Students {% else %} Upload Scores {% endif %}

{{ project.name }} ({{ project.year }})

{% if mode == 'students' %}
Student Upload Instructions:
  • Download the student template
  • Fill in student information (school_code, student_number, full_name, sex)
  • Upload the completed Excel file
  • Students will be added or updated automatically
{% with level_name=project.academic_level.name|upper %} {% if 'O' in level_name and 'LEVEL' in level_name %} Download - O-Level Template {% elif 'A' in level_name and 'LEVEL' in level_name %} Download - A-Level Template {% elif 'PRIMARY' in level_name %} Download - Primary Level Template {% else %} Download Template {% endif %} {% endwith %}
Required columns:
school_code | student_number | full_name | sex | comb
                            
  • school_code - Must exist in schools table
  • student_number - Unique identifier
  • full_name - Student's full name
  • sex - M or F only
  • comb - i.e HGK etc or leave Blank
{% else %}
Score Upload Instructions:
  • Download the score template
  • Fill in student scores (0-100 or X for absent)
  • Upload the completed Excel file
  • Scores will be processed with grading rules
Template format:
Row 1: Student Details | Subject codes (e.g., 011, 012, 013)
Row 2: (Empty or descriptions)
Row 3+: Student Number | Subject scores (0-100 or X)
                            
  • Column 2 contains student numbers
  • Column 6+ contain subject scores
  • First row contains subject codes
  • Scores: 0-100 (numeric) or X (absent)
{% endif %}
{% csrf_token %}
Only .xlsx files are accepted

{% if mode == 'students' %} Existing Students {% else %} Processed Scores {% endif %}

{% if mode == 'students' %}
{{ total_students }}
Total Students
{{ schools_count }}
Schools
{{ male_count }}
Male
{{ female_count }}
Female
{% for student in students %} {% empty %} {% endfor %}
# Student No Full Name Sex School
{{ forloop.counter0|add:students.start_index }} {{ student.student_number }} {{ student.full_name }} {% if student.sex == 'M' %} Male {% else %} Female {% endif %} {{ student.school.school_code }} - {{ student.school.name|truncatechars:30 }}
No students uploaded yet. Use the form to upload student data.
{% if students.has_other_pages %} {% endif %} {% else %}
{% if report %}
Last upload report:
{{ report }}
{% endif %}
{% for subject in subjects %} {% endfor %} {% for student, scores in table.items %} {% for subject in subjects %} {% endfor %} {% empty %} {% endfor %}
Student No Student Name{{ subject }}
{{ student.student_number }} {{ student.full_name }} {% with score=scores|get_item:subject %} {% if score %} {% if score == 'X' %} X {% else %} {% with score_num=score|floatformat:0|add:0 %} {{ score_num }} {% endwith %} {% endif %} {% else %} - {% endif %} {% endwith %}
No scores processed yet. Upload scores to see results.
{% if page_obj.has_other_pages %} {% endif %} {% endif %}
{% block extra_js %} {% endblock %} {% endblock %}