import os, zipfile, textwrap, shutil
base = "/mnt/data/Sonshine_Online_Examination"
os.makedirs(base, exist_ok=True)
shutil.copy2("/mnt/data/Periodic-table.jpg", os.path.join(base, "Periodic-table.jpg"))
html = r'''
Sonshine Online Examination
☀ SONSHINE ONLINE EXAMINATION
SONSHINE SECONDARY SCHOOL · DIGITAL ASSESSMENT
Examine · Assess · Learn · Improve
Welcome to Sonshine Online Examination
A school examination and learning platform for students, teachers, parents and administrators.
Demonstration prototype: This version runs in your browser. Do not enter real student passwords or confidential examination material. Production authentication, AI marking and secure timing require a server.
🎓
Student Portal
Enter your full name and teacher-issued examination code.
📚
Teacher Portal
Create examinations, generate access codes and configure tools.
👨👩👧
Parent Portal
View released learner results and feedback.
🛡️
Admin Portal
Manage accounts, roles and school examination settings.
'''
with open(os.path.join(base, "index.html"), "w", encoding="utf-8") as f:
f.write(html)
readme = """SONSHINE ONLINE EXAMINATION — PROTOTYPE
========================================
OPEN
1. Extract the ZIP file.
2. Keep index.html and Periodic-table.jpg in the same folder.
3. Open index.html in a modern browser (Chrome or Edge recommended).
DEMO SIGN-IN
Student: enter any full name and a valid examination code shown in the Teacher portal.
Teacher: username teacher / password demo123
Parent: username parent / password demo123
Admin: username admin / password demo123
TEACHER FLOW
- Sign in as teacher.
- Create an examination, set duration, questions, marking guide and permitted tools.
- Share the generated subject code with students through Google Classroom.
- Students must enter their full names and the valid code to access the paper.
ADMIN FLOW
- Sign in as admin.
- Create demonstration user records and issue password-reset flags.
- Passwords are intentionally never displayed to administrators.
IMPORTANT LIMITATIONS
This is a browser-only demonstration, not a production examination system.
- Data is stored in the browser's localStorage and is not synchronised between devices.
- Demo usernames/passwords are hard-coded and are NOT secure.
- Examination code validation and timer are client-side and can be bypassed.
- Marking in this version is teacher-entered; it is not real AI marking.
- Google Classroom sharing is manual (copy the code/link).
- Calculator is a basic prototype, not a certified examination calculator.
- The uploaded periodic-table image is displayed as the supplied ECZ reference.
- Do not use real student personal data, passwords or live high-stakes examinations.
PRODUCTION REQUIREMENTS
A production deployment needs a secure backend, database, encrypted transport,
role-based access control, password hashing, one-time/controlled examination codes,
server-authoritative timers, server-side autosave, audit logs, file scanning,
backups, privacy controls, accessible document annotation, reliable handwriting OCR,
teacher-approved AI marking with moderation, and Google Classroom integration.
"""
with open(os.path.join(base, "README.txt"), "w", encoding="utf-8") as f:
f.write(readme)
zip_path = "/mnt/data/Sonshine_Online_Examination_Prototype.zip"
with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED) as z:
for fn in ["index.html", "Periodic-table.jpg", "README.txt"]:
z.write(os.path.join(base, fn), arcname="Sonshine_Online_Examination/" + fn)
print(zip_path, os.path.getsize(zip_path))