This project is a web application for processing and verifying student math assignments. Users can upload images of their assignments, and the application will extract text, verify the answers using OpenAI's API, and display the results. This version uses image uploads instead of a live webcam component.
- Upload images of math assignments.
- Extract text from uploaded images using OCR.
- Verify extracted answers using OpenAI's API.
- Display the verification results.
-
Clone the repository:
cd math-assignment-checker
-
Install dependencies:
sh npm install
-
Set up environment variables:
Create a
.env.local
file in the root directory and add your OpenAI and Supabase keys:OPENAI_API_KEY=your_openai_api_key NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_KEY=your_supabase_key
-
Start the development server:
sh npm run dev
The application will be available at
http://localhost:3000
.
-
Open the application:
Navigate to
http://localhost:3000
in your web browser. -
Enter details:
Fill in the test version, test name, and student name.
-
Upload image:
Click on the "Upload Image" button and select an image of the student's math assignment.
-
Process image:
Click on the "Process Image" button to start the text extraction and verification process.
-
View results:
The extracted text and verification results will be displayed on the page.
OPENAI_API_KEY
: Your OpenAI API key.NEXT_PUBLIC_SUPABASE_URL
: Your Supabase project URL.NEXT_PUBLIC_SUPABASE_KEY
: Your Supabase project key.
my-next-app/
├── .env.local
├── README.md
├── next.config.js
├── package.json
├── public/
│ ├── favicon.ico
│ └── vercel.svg
├── src/
│ ├── app/
│ │ ├── layout.js
│ │ ├── page.js
│ │ └── page.module.css
│ ├── components/
│ │ └── WebcamCapture.js (currently not used)
│ ├── utils/
│ ├── ocr.js
│ ├── openai.js
│ └── supabase.js
└── yarn.lock
Contributions are welcome! Please open an issue or submit a pull request for any changes or improvements.
This project is licensed under the MIT License.