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

{% if mode == 'students' %} Student Upload {% else %} Results Upload {% endif %}

{{ school.name }} ({{ school.school_code }}) | {{ project.name }} ({{ project.year }})

Back to Projects
Security Notice: This upload is restricted to {{ school.name }} ({{ school.school_code }}). Only data for this school will be accepted.
{% if mode == 'students' %} Upload Students {% else %} Upload Results {% endif %}
{% if mode == 'students' %}
Student Upload Instructions:
  • Download the student template for your school
  • Fill in student information (student_number, full_name, sex)
  • Optional: Add combination (e.g., HGK, PCM, etc.)
  • Upload the completed Excel file
  • Students will be added or updated automatically
Required columns:
school_code | student_number | full_name | sex | comb (optional)
                            
  • school_code - Will be validated against {{ school.school_code }}
  • student_number - Unique identifier
  • full_name - Student's full name
  • sex - M or F only
  • comb - Combination code (e.g., HGK, PCM, CBG, etc.)
{% else %}
Score Upload Instructions:
  • Download the score template for your school
  • Enter scores (0-100) or X for absent
  • Only modify score columns, keep student information intact
  • Upload the completed Excel file
  • Scores will be processed with grading rules
Template format:
Row 1: School Code | Student Number | Student Name | Sex | Subject codes
Row 2: (Empty or descriptions)
Row 3+: Student Number | Subject scores (0-100 or X)
                            
  • School Code is validated - Must match {{ school.school_code }}
  • Student numbers must exist in the system for this school
  • Scores: 0-100 (numeric) or X (absent)
{% endif %}
{% csrf_token %}
Only .xlsx files are accepted
{% if mode == 'students' %} Existing Students {% else %} Existing Results {% endif %}
{% if mode == 'students' %}
{{ total_students }}
Total Students
{{ male_count }}
Male
{{ female_count }}
Female
{% for student in students %} {% empty %} {% endfor %}
# Student No Full Name Sex
{{ forloop.counter0|add:students.start_index }} {{ student.student_number }} {{ student.full_name }} {% if student.sex == 'M' %} Male {% else %} Female {% endif %}
No students found. Use the form to upload students.
{% if students.has_other_pages %} {% endif %} {% else %}
{{ student_count }}
Registered Students
{{ page_obj.paginator.count }}
Score Records
{% if report %}
Last upload report:
{{ report|truncatechars:500 }}
{% endif %}
{% for subject in subjects %} {% endfor %} {% for student_key, data in table.items %} {% for subject in subjects %} {% endfor %} {% empty %} {% endfor %}
Student No Student Name Sex{{ subject }}
{{ data.student_number }} {{ data.student_name|truncatechars:30 }} {% if data.sex == 'M' %} M {% else %} F {% endif %} {% with score=data.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 results uploaded yet. Use the form to upload results.
{% if page_obj.has_other_pages %} {% endif %} {% endif %}
{% endblock %}