Windows PowerShell CBT Setup Guide 🇳🇬
Follow these simple, step-by-step instructions to save, run, and view your local offline CBT prototype on your laptop using Windows PowerShell and Python!
Step 1: Open Windows PowerShell
- On your Windows laptop, press the Windows Key on your keyboard.
- Type
PowerShellinto the search bar. - Click on Windows PowerShell to open it.
Step 2: Install Python (If you don't have it)
Check if you already have Python installed by typing the following command in PowerShell and pressing Enter:
python --version
If this command displays a version number (like Python 3.10.x or similar), Python is installed. If not, download and install Python from the official website: https://www.python.org/downloads/ (Make sure to check the box that says "Add Python to PATH" during installation).
Step 3: Install Flask & OpenAI Dependencies
To run the server and the AI features, you need to install Flask and the OpenAI Python SDK library. Type the following command in PowerShell and press Enter:
pip install flask openai
Step 4: Configure Your NVIDIA NIM API Key
To connect Llama 3.3 for generating questions, motivational principal speech evaluations, and explaining wrong answers, configure your NVIDIA NIM API Key by typing this command in PowerShell:
$env:NVIDIA_API_KEY="your_actual_nvidia_nim_api_key_here"
(Replace your_actual_nvidia_nim_api_key_here with your actual NIM credentials key. If you don't have one, the server will continue running and fallback to basic values for offline prototype tests!)
Step 5: Run the CBT Server
- Navigate to the folder containing
app.pyanddatabase.pyusing thecdcommand. For example, if your files are in a folder namedCBTon your Desktop:cd "$HOME\Desktop\CBT" - Start the local server by typing this command and pressing Enter:
python app.py - Once started, you should see a message in the terminal that says:
Running on http://127.0.0.1:3000orRunning on http://localhost:3000.
Step 6: View the Web Screen on Your Laptop Browser
- Open any web browser on your laptop (Google Chrome, Microsoft Edge, Mozilla Firefox, etc.).
- In the URL address bar at the top, type:
http://127.0.0.1:3000 - Press Enter. You are now in your beautiful, premium, offline CBT exam portal! You can register profiles, generate real secure IDs (
STU-...orTCH-...), write AI-loaded exams, view your Mrs. Victoria Omotola evaluation speech, and test live explanations instantly.