Skip to content

ashankgupta/maths-exam-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js
React
Express
TailwindCSS
Gemini API
License: MIT
PRs Welcome

AI Exam Paper Generator

A simple full-stack web application for primary school math teachers to generate AI-powered exam papers. Teachers can specify a math topic and number of questions, and the app generates an exam using the Gemini AI API.

Demo

Features

  • Generate math exam papers for primary school students

  • Input topic and number of questions

  • Powered by Google Gemini AI

  • Loading state with spinner while generating

  • Error handling (e.g., "Failed to generate exam. Please try again.")

  • Modern & responsive UI with Tailwind CSS

  • Input validation (no empty fields or invalid values)

  • Option to generate answer key

  • Copy exam paper to clipboard

Tech Stack

  • Frontend: React + Tailwind CSS

  • Backend: Node.js + Express

  • AI Integration: Google Gemini API

Setup & Installation

Clone the Repository

git clone https://github.com/ashankgupta/maths-exam-generator.git
cd maths-exam-generator

Backend Setup

cd backend
npm install
  • Create a .env file inside backend/ and add:
GEMINI_API_KEY=your_api_key_here
  • Start backend:
npm start

Frontend Setup

cd frontend
npm install
  • Start frontend:
npm start

The frontend will run on http://localhost:3000 and backend on http://localhost:5000

Project Structure

ai-exam-generator/
├── backend/
│   ├── server.js
│   ├── routes/
│   │   └── exam.js
│   ├── package.json
│   ├── package-lock.json
│   └── .env
├── demo.gif
├── frontend/
│   ├── public
│   │   ├── favicon.ico
│   │   ├── index.html
│   │   ├── logo192.png
│   │   ├── logo512.png
│   │   ├── manifest.json
│   │   └── robots.txt
│   └── src
│       ├── App.css
│       ├── App.js
│       ├── index.css
│       └── index.js
│   ├── package.json
│   ├── package-lock.json

│
└── README.md

Usage

  • Enter a math topic (e.g., "Fractions", "Addition").

  • Enter the number of questions (numeric only).

  • (Optional) Tick checkbox to include answer key.

  • Click Generate Exam.

  • Copy generated exam with one click.

Security

  • API key is stored securely in the backend (.env).

  • Frontend never exposes sensitive keys.

License

This project is licensed under the MIT License.

About

AI-powered exam paper generator for primary school math teachers. Generate topic-based questions and answer keys instantly using Gemini API.

Topics

Resources

License

Stars

Watchers

Forks

Contributors