This repository contains a cross-platform desktop GUI application (Tkinter) for managing OMR test forms, converting scanned PDFs into images, executing OMR evaluations, and syncing results with Google Firestore.
This guide is structured into two parts:
- Developer & Admin Setup: For the technical team preparing, configuring, and maintaining the software.
- School Setup & End-User Guide: For school administrators and teachers running the software daily to process OMR sheets.
This section explains the code architecture, how to configure Firestore, prepare OMR templates, and package settings.
- SQLite Database (
tests.db): Holds exam metadata (ID, test name, date, template folder name) in a flat table namedtests. - Config File (
app_config.json): Stores file paths, execution commands, and the default PIN.- The configuration supports platform-specific keys (e.g.
python_command_win32vspython_command_darwin) to allow seamless usage across both Windows and macOS machines.
- The configuration supports platform-specific keys (e.g.
To enable cloud synchronization of OMR results, configure Google Firestore:
- Create a Firebase/Google Cloud Project.
- Enable Firestore Database in Native mode.
- Go to IAM & Admin → Service Accounts in the GCP Console.
- Create a service account and assign the role Cloud Datastore User or Firestore Data Owner.
- Generate and download a new private key in JSON format.
- Provide this JSON file to the school administrators to load into their preferences.
OMR Checker templates must be placed inside the samples (or templates_dir) folder. Each template must be a subdirectory containing:
template.json: Configures bubble layout coordinate maps.evaluation.json: Configures the grading weights. Make sure it uses"marking_schemes"(plural) to comply with OMRChecker specifications.answer_key.csv: A CSV map containing correct answers for all questions.omr_marker.jpg: Alignment marker asset.
The login screen is protected by a 6-digit PIN.
- PIN salt is set via
PIN_SALTinsideindex.py. - The hash is computed using SHA-256 and stored as
pin_hashinsideapp_config.json. - Default PIN is
123456. You can update it using the GUI's Settings → Change PIN option.
You can package this application into a standalone executable that runs without requiring Python or other libraries installed on the target machine.
- macOS Installer (
.dmg): Run the build script on a Mac computer:This createspython3 build_installer.py
dist/OMRTestManager.appand packages it intodist/OMRTestManager.dmg. - Windows Executable (
.exe): Run the batch script on a Windows computer:This installs packages and compiles the app into a single executablebuild_installer_win.bat
dist/OMRTestManager.exe. - Automated Cloud Builds (GitHub Actions):
Every push to the
mainormac-compatibility-and-fixesbranches triggers a GitHub Actions workflow. You can download the pre-compiledOMRTestManager.exedirectly from the Actions tab of your repository.
Welcome! This guide will help you install and run the Test Manager software on your school computers.
Tip
Recommended: Use Standalone Installers If your technical team has provided you with the standalone installer, you do not need to install Python or run terminal commands:
- Windows: Simply download
OMRTestManager.exeand double-click to run it. - macOS: Download
OMRTestManager.dmg, open it, and drag OMRTestManager into your Applications folder. Right-click the app and choose Open the first time to bypass the Apple security prompt.
If you are running the software directly from the source code instead of the standalone installer, follow these steps:
- Make sure Python 3.7 or higher is installed on your computer.
Open your terminal (macOS) or Command Prompt (Windows) and install the required modules:
pip install Pillow pymupdf google-cloud-firestore opencv-python deepmerge dotmap jsonschema matplotlib numpy pandas rich screeninfo- Run the application:
python3 index.py
- Log in using your 6-digit PIN (Default:
123456). - In the menu bar, go to Settings → Preferences.
- Configure the folders:
- Input Directory: Create a folder on your computer (e.g.,
inputs) and select it. This is where scanned pages will be prepared. - Output Directory: Create a folder on your computer (e.g.,
outputs) and select it. This is where graded CSV results will be saved. - Templates Folder: Choose the folder where your OMR templates are stored (e.g.,
samples). - Python Command: Enter the path to your OMR evaluation script. Use
{input}and{output}as placeholders:- Windows Example:
py C:\OMRChecker-master\main.py --inputDir {input} --outputDir {output} - macOS Example:
python3 /Users/yourusername/OMRChecker-master/main.py --inputDir {input} --outputDir {output}
- Windows Example:
- Firestore Auth Key: Browse and load the Google Cloud credentials JSON file provided by your technical team.
- Input Directory: Create a folder on your computer (e.g.,
- Click Save.
Follow these steps for every OMR test you need to grade:
- Click Add Test on the dashboard.
- Enter the Test Name and Date (YYYY-MM-DD).
- Select the appropriate layout template from the Template Folder dropdown list.
- Click Save.
- Select your test from the left-hand menu.
- Click Input PDF.
- Choose the scanned PDF containing all student answer sheets.
- Confirm the page count on the pop-up window. The app will automatically split the PDF into page images and copy the layout template.
- Click Run Command.
- Click Yes to confirm.
- The OMR engine will grade the sheets. Once finished, a table preview of the results containing student scores, Roll Numbers, and marked answers will load automatically on the right panel.
- Click Push to Firestore.
- Confirm the prompt to upload.
- The results will be pushed directly to your school cloud database!
- Error: "Template folder '...' not found."
- Check that your Templates Folder in Preferences contains the folder name selected for this test.
- The CSV Preview shows old values or doesn't update.
- Click on another test name on the left sidebar and click back to force the preview window to reload.
- Error: "Firestore Auth Key not found."
- Go to Settings → Preferences and check that you have selected a valid credentials JSON key file.
This section details the historical developer steps, prompts, commits, and debugging processes that took place during development.
- What We Did: Added platform-specific configuration keys (
_darwin,_win32) inSettingsManagerto support multi-platform user environments, fixed Poppler paths, and cleared Firestore variable NameErrors. - Commit:
82dd9bd
- What We Did: Filtered path columns from CSV preview, formatted file labels (e.g.
page_1.jpg->Page 1), and resolved a start-up indent block issue.
- What We Did: Restructured the documentation into developer setup (Part 1) and end-user setup (Part 2) guides.
- What We Did: Replaced
pdf2image(Poppler dependent) withpymupdf(pure python PDF library) to completely eliminate Poppler dependencies. Bundled OMRChecker directly inside the app folder to run programmatically. - Commit:
758897a
- What We Did: Added
build_installer_win.batfor local Windows compiling and created a GitHub Actions workflow (build.yml) to build the Windows.exeautomatically on push. - Commit:
860c3c9
- What We Did: Isolated test folders by test ID, fixed relative path alignment issues, disabled OpenCV thread debug popups causing Cocoa GUI crashes on macOS, recursive template scanning, and resolved a page_count
NameErrorcrash. - Commits:
7f76f8fto8f2a2ca
- What We Did: Successfully compiled the macOS standalone
.dmginstaller locally and verified automated compilation of the Windows.exeinstaller.
- What We Did: Generated and validated the final installers on macOS (
.dmg) and Windows (.exevia GitHub Actions), updated all manuals with installer guides, and submitted the upstream Pull Request #4.
- What We Did: Created a pixel-perfect 60-question
Standard_Templatelayout that precisely targets the school's OMR sheet (Mathematics 20Q, Physics 15Q, Chemistry 15Q, and MAT 10Q). Added a post-processing Option Analysis report generator that outputs selection statistics and success rates for each question inOption_Analysis.csv. Modified the OMR engine's verification step to automatically filter and align the answer key questions list to match the template's output columns (allowing 120-question keys to run seamlessly on 60-question templates). - Commit:
2fa619b
- What We Did: Explicitly registered and imported built-in OMR Checker processor classes (CropOnMarkers, CropPage, FeatureBasedAlignment, Levels, MedianBlur, GaussianBlur) to prevent standalone compiled binaries from crashing during dynamic directory walks.
- Commit:
93b6345
- What We Did: Implemented automatic answer key extraction from the first page of the scanned PDF (setting File ID to "Answer Key" and Roll Number to "KEY"), filtered metadata columns from Option Analysis stats, and hid
Option_Analysis.csvfrom both the GUI table preview and Google Firestore sync list. - Commit:
8ee0a0a