Skip to content

GUI developed with customtkinter for auto-AI solutions to closed questions

Notifications You must be signed in to change notification settings

neogib/MCQ-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Powered solutions to multiple-choice questions

This project is a Python-based application designed to solve multiple-choice questions (A/B/C/D answers) using OpenRouter AI through the openai module. The application features a custom GUI built with customtkinter for a seamless user experience.

Features

  • Multiple-Choice Question Solver: Automatically solve questions with A/B/C/D answers.
  • Custom GUI: Intuitive interface built with customtkinter.
  • OCR Integration: Extract text from images using easyocr.
  • AI-Powered Solutions: Generate answers via OpenRouter AI with openai api.
  • Image Processing: Handle images using Pillow.
  • Export to files: Save solutions to .odt files using odfpy or to markdown format .md.
  • Export to flashcard: Save solution to anki for later revise and quicker learning.

Screenshots

Main Interface Solution Display

Installation

Important

The GUI will look great only on linux machine (tested on Debian). There may be problems with the appearance of the application when using Windows.

Warning

Required: You must set up an OpenRouter API key before running the application. The program will not work without it.

To run the application locally:

  1. Clone the Repository:

    git clone https://github.com/Gibirizon/solving-multiple-choice-questions-with-AI.git
    cd solving-multiple-choice-questions-with-AI
  2. Create a Virtual Environment and install dependencies:

  • For pip users:
python3 -m venv .venv
source .venv/bin/activate  # On Windows use `.venv\Scripts\activate`
pip install -e .
  • For uv users:
uv sync
source .venv/bin/activate  # On Windows use `.venv\Scripts\activate`
  1. Set up OpenRouter API Key:

    Create a .env file in the project root directory and add your OpenRouter API key:

    # Create .env file
    touch .env

    Then add your API key to the .env file:

    API_KEY=your_openrouter_api_key_here

    [!NOTE] To get your OpenRouter API key:

    1. Visit OpenRouter
    2. Sign up or log in to your account
    3. Go to your dashboard and generate an API key
    4. Copy the key and paste it in your .env file
  2. Run the Application:

python main.py

Usage

  1. Input Questions:

    • Enter screenshots of multiple-choice questions from your files or just paste them with Ctrl-V when your cursor is in appropriate area.
  2. Edit the text or use image:

  • After importing screenshot of question you can edit the text taken from the photo with OCR or just use this screenshot directly to get better results.
  1. Get Solutions:

    • Click Get answer to your question to get AI-generated answers.
  2. Export Solutions:

    • Save answers to .odt or .md files by navigating to Export tab. You can also export this question as a flashcard to anki - powerful flashcards program. To export it to anki you need to have AnkiConnect add-on installed.

Made by Gibirizon ❤️

About

GUI developed with customtkinter for auto-AI solutions to closed questions

Topics

Resources

Stars

Watchers

Forks

Languages