import os import json from flask import Flask, session, request, redirect, url_for, render_template_string, flash, jsonify from openai import OpenAI from database import init_db, register_user, authenticate_user, get_db_connection app = Flask(__name__) # Secure session key app.secret_key = "examforge_nigerian_cbt_secure_secret" # Verify/Initialize the SQLite CBT database tables init_db() # BASE PREMIUM HTML/CSS LAYOUT BASE_LAYOUT = """
{% if current_role == 'student' %} Input custom ID format: STU-[CLASS]-[NAME]-[NUM] {% else %} Input custom ID format: TCH-[SUBJECT]-[NAME]-[NUM] {% endif %}
Need an offline CBT profile? Register Profile
Account registered successfully inside secure local SQLite database.
Write this ID down or copy it! It is required to log in along with your 4-digit PIN password.
Admin Custom ID: {{ user.id }}
Designated Specialty
{{ user.class_or_subject }}
This module utilizes NVIDIA cloud-accelerated Meta Llama 3.3 70B models inside security metrics. Exams generated adapt straight to West African Examination Syllabus metrics.
STUDENT CODESPACE PREVIEW: Registered students logging in can now view and write this exam on their portals.
{{ q.question }}
CBT Student ID: {{ user.id }}
Assigned Classroom
{{ user.class_or_subject }}
"Only absolute focus and dedication yields academic success. Make your parents proud and study with perfect discipline!"
There are currently no active exams launched inside our SQLite CBT server database. Wait for your specialty subject teacher to deploy a batch of questions using their dashboard.
Graded evaluation score from local CBT SQLite cache
"{{ speech }}"
Principal Mrs. Victoria Omotola
Llama 3.3 Engine{{ q.question }}
Correct Option: {{ q.correct }} | Your Choice: {{ user_answers[q.id|string] if user_answers[q.id|string] else 'Unanswered' }}
Requesting explanation from NVIDIA NIM...