An online exam application built as a Minimum Viable Product (MVP) that supports various question types, including single-choice MCQs, multiple-answer MCQs, short-answer questions, and long-answer questions. The application focuses on subjects like Mathematics and English, rendering mathematical notation using LaTeX syntax.
- Features
- Technology Stack
- Project Structure
- Installation
- Usage
- API Endpoints
- Sample Data
- Contributing
- License
- Contact
- Multiple Question Types: Supports single-choice MCQs, multiple-answer MCQs, short-answer, and long-answer questions.
- Mathematical Notation: Renders mathematical expressions using LaTeX syntax with MathJax.
- Responsive Design: Fully responsive UI optimized for both web and mobile devices.
- Timer Functionality: Implements a persistent countdown timer for exams with time limits.
- Persistent State: Preserves exam state across page refreshes using
localStorage
. - Custom Scrollbar: Enhances user experience with a custom scrollbar throughout the application.
- Exam Metadata Display: Shows exam title, subject, passing score, and time left.
- User Input Handling: Captures and stores user responses for all question types.
- Backend Integration: Communicates with a Flask backend API for data retrieval and submission.
- Accessibility: Focuses on accessible design with proper contrast ratios and keyboard navigation support.
- Framework: Next.js (React framework)
- Styling: CSS Modules, Tailwind CSS
- Mathematical Rendering: MathJax (
better-react-mathjax
package) - HTTP Client: Axios
- Framework: Flask
- Database: SQLite (via SQLAlchemy)
- CORS Handling: Flask-CORS
project-root/
├── README.md
├── backend/
│ ├── app.py
│ ├── instance/
│ ├── models/
│ └── requirements.txt
├── docker-compose.yml
└── frontend/
├── README.md
├── jsconfig.json
├── next.config.mjs
├── package-lock.json
├── package.json
├── postcss.config.mjs
├── tailwind.config.js
└── src/
├── app/
├── components/
├── pages/
├── styles/
└── utils/
- Node.js (v14 or newer)
- npm or yarn
- Python (v3.7 or newer)
- pip
- Docker (optional, if using
docker-compose.yml
)
git clone https://github.com/math-alpha/gceLab.git
cd gceLab
If you prefer using Docker to set up both the frontend and backend environments:
-
Ensure Docker is installed and running on your system.
-
Run Docker Compose
docker-compose up --build
This will build and start both the frontend and backend services as defined in
docker-compose.yml
. -
Access the Application
- Frontend:
http://localhost:3000
- Backend API:
http://localhost:5000
- Frontend:
-
Navigate to Backend Directory
cd backend
-
Create a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Navigate to Front-End Directory
cd ../frontend
-
Install Dependencies
npm install # or yarn install
-
Navigate to Backend Directory
cd backend
-
Activate Virtual Environment
source venv/bin/activate # On Windows: venv\Scripts\activate
-
Run the Flask App
python app.py
The backend server will start at
http://localhost:5000
.
-
Navigate to Front-End Directory
cd ../frontend
-
Start the Development Server
npm run dev # or yarn dev
The front-end application will start at
http://localhost:3000
. -
Access the Application
Open your browser and navigate to
http://localhost:3000
.
- Description: Retrieves the exam data.
- Response: JSON object containing exam metadata and questions.
- Description: Submits the user's responses.
- Request Body: JSON object with question IDs and user responses.
- Response: JSON object with submission confirmation and optional scoring.
The application uses a sample exam data set focused on Mathematics. The exam includes various question types to test the application's functionality.
Sample Exam Data Structure:
exam_data = {
"examTitle": "Sample Mathematics Exam",
"examMeta": {
"duration": 90,
"passingScore": 70,
"subject": "Mathematics"
},
"questions": [
{
"id": "q1",
"type": "single-choice",
"questionText": "What is the derivative of \\( f(x) = x^2 \\)?",
"options": [
{ "id": "a", "text": "\\( 2x \\)" },
{ "id": "b", "text": "\\( x^2 \\)" },
{ "id": "c", "text": "\\( x \\)" },
{ "id": "d", "text": "\\( 2 \\)" }
],
"correctOptionIds": ["a"],
"metadata": {
"difficulty": "medium",
"topic": "Calculus",
"marks": 5
}
},
# Additional questions...
]
}
Contributions are welcome! Please follow these steps:
-
Fork the Repository
Click the "Fork" button at the top right of the repository page.
-
Clone Your Fork
git clone https://github.com/yourusername/gceLab.git
-
Create a Branch
git checkout -b feature/your-feature-name
-
Make Changes
Implement your feature or bug fix.
-
Commit Changes
git commit -m "Description of your changes"
-
Push to Your Fork
git push origin feature/your-feature-name
-
Create a Pull Request
Go to the original repository and create a pull request from your fork.
This project is licensed under the MIT License.
- Author: Ngadou Yopa
- Email: yopasylvestre [.at_] gmail.com
- GitHub: math-alpha
Feel free to reach out if you have any questions or suggestions!
-
Environment Variables
- You may need to set environment variables for production deployments.
- For development, default configurations are used.
-
Deployment
- Front-End: Can be deployed on platforms like Vercel or Netlify.
- Back-End: Can be deployed on platforms like Heroku or AWS Elastic Beanstalk.
-
Testing
- No automated tests are included in this MVP.
- Manual testing is recommended to ensure all features work as expected.
-
Known Issues
- Timer may not sync across multiple devices.
- User authentication is not implemented in this MVP.
Thank you for using the Online Exam MVP Application! We hope it meets your testing and educational needs.
If you need further assistance or have any other questions, feel free to ask!