DEV Community

MUHAMMED SAHAL P K
MUHAMMED SAHAL P K

Posted on

Offline GATE Mock Test App: Edge CBT & AI Coaching with Gemma

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

Preparing for competitive examinations like GATE often means downloading hundreds of static question-paper PDFs. While past papers are the best study material, a flat PDF cannot reproduce real exam pressure: it cannot track a 180-minute countdown, enforce negative marking rules, or give instant feedback on conceptual mistakes.

For the Ghost in the Machine challenge, I interpreted the theme as breathing life into "dead", inert test papers. I built the Offline GATE Mock Test App—a lightweight desktop Computer-Based Test (CBT) environment powered by a local, open-weight Gemma 3 1B model running via Ollama.

It renders official question-paper PDFs on a high-contrast canvas alongside an interactive palette and response panel. Once submitted, it deterministically evaluates the responses against official answer keys and uses local Gemma to act as an offline study coach—classifying missed syllabus topics, identifying likely misconceptions, and providing targeted 3-step revision advice.

Note on Project Status: This project is a working prototype and proof-of-concept built in a bit of a rush right before the deadline. While the core test runner, official evaluation logic, and local coach integration work, it is still a work-in-progress (WIP) and not a fully finished commercial product.


Demo

Because this is a locally run desktop utility and I was racing against the clock, I don't have a video recording ready. Here are two direct screenshots from the active app running on my machine:

1. Interactive CBT Mock Environment

A 180-minute countdown timer, 65-question state palette (Blue: current, Green: answered, Amber: review), and dynamic response controls for MCQ, MSQ, and NAT types alongside the original PDF page:

Interactive CBT Mock Test Runner with question palette and timer

2. Post-Submission Review & Gemma Coaching Drawer

Deterministic scoring header (-1/3 MCQ penalty, zero-penalty NAT/MSQ) paired with local Gemma 3 1B providing topic classification, misconception analysis, and actionable revision steps:

Attempt review window showing deterministic scoring and local Gemma CS coach


Code

You can explore the full source code and setup instructions on GitHub:

Offline GATE Mock Test App

Hacktoberfest 2026 Challenge Category Model Status Python

Edge AI / Offline Open-Weight Intelligence: Transforming static official examination artifacts (PDF question papers and answer keys) into an active, air-gapped Computer-Based Test (CBT) environment powered locally by Gemma via Ollama—without cloud dependencies, subscriptions, or telemetry.

Submitted to the Hacktoberfest 2026 Open-Source AI Challenge (Week 4) on the DEV Community for the Best Use of Gemma partner category.


Project Status & WIP Disclaimer

Important

Active Prototype / Proof of Concept
This project is an auditable, working proof-of-concept built for the Hacktoberfest 2026 challenge. While the core test engine and offline AI coach are operational, certain advanced analytics and historical paper adapters remain in active development.

What is Fully Functional Today

  • Deterministic Scoring Engine: Strictly enforces official GATE rules—fractional negative marking for MCQs ($-1/3$ for 1-mark, $-2/3$ for 2-mark), exact-match multiple-select (MSQ) without partial credit, and numerical value tolerances (NAT) with range…

How I Built It

The entire pipeline is built to run 100% locally with zero cloud dependencies:

  • Inference & Open-Source AI: Local Gemma 3 1B (gemma3:1b) orchestrated via Ollama.
  • GUI & Presentation: Python with standard Tkinter and ttk using custom dark themes for low glare during long study sessions.
  • Document Engine: PyMuPDF (pymupdf) to parse tabular answer keys from official keys and render question-page regions directly to an in-memory cache, keeping mathematical formulas and circuit diagrams sharp.
  • Strict Trust Boundary: The app enforces a hard separation between scoring and AI guidance. Evaluation is strictly deterministic based on the extracted answer-key table (scoring.py). Gemma is never permitted to evaluate correctness or alter marks—it strictly consumes locked post-submission data to provide qualitative revision advice (coach.py).
  • Privacy by Design: All source exam PDFs, generated page caches, and candidate attempt history are ignored via .gitignore to protect privacy and respect copyright.

Why Does Open Innovation Matter?

Open innovation and open-weight models like Gemma make private, high-stakes educational software possible:

  1. Student Data Privacy: Exam attempts, test anxiety, and knowledge weaknesses should never be harvested for cloud telemetry or advertising. Everything stays on the student's personal computer.
  2. True Offline Accessibility: Serious test preparation requires distraction-free focus—often with Wi-Fi disabled—or takes place in regions with spotty internet connectivity. Open-weight models running on Ollama allow smart coaching anywhere without a persistent connection.
  3. Zero API Cost Barrier: Closed AI APIs require pay-per-token subscriptions or credit cards, which creates an unnecessary barrier for students. Open models allow anyone to build and run unlimited self-study sessions at zero marginal cost.

The Spirit of It

This is my very first time participating in Hacktoberfest and my first time submitting an open-source challenge post on DEV!

As someone personally preparing for technical competitive exams, I know the frustration of staring at static PDFs and answer keys late at night, wondering why an approach failed. Even though the application is still rough around the edges and I was in a rush to submit before the deadline, seeing local Gemma pop up in the review drawer to explain a graph theory misconception without an internet connection felt like having a patient peer sitting right next to me. I genuinely hope this concept inspires more offline, privacy-first tools for students everywhere.


Acknowledgements & Collaboration

A big thank you to Major League Hacking (MLH) and the DEV Community (along with DigitalOcean) for hosting Hacktoberfest and putting together these open-source AI weekly challenges! It has been an awesome learning experience and a great motivator to push this prototype out the door.

Want to Collaborate? 🤝

Since this project is an early-stage prototype built in a sprint before the deadline, there is a lot of room to expand:

  • Developing the adaptive 15-question recovery drill (Secret Mission)
  • Supporting multi-year archival papers (2021–2025)
  • Refining the dark CBT UI layout and cross-session weak-topic trend dashboards

If you are interested in collaborating, contributing to the repo, or helping turn this into a fully polished open-source tool for exam aspirants, drop a comment below or open an issue/discussion on GitHub! I’d love to connect and build together.


Prize Categories

  • Best Use of Gemma

Top comments (3)

Collapse
 
alexshev profile image
Alex Shev •

The hard boundary between deterministic scoring and the Gemma coaching layer is exactly right for a study tool. Learners can challenge a mark against the published key while still getting useful, human-readable revision guidance. For the next iteration, a small “why this coaching tip” panel that points back to the missed questions and syllabus labels would keep that qualitative layer just as inspectable as the scoring engine.

Collapse
 
sahalpk007 profile image
MUHAMMED SAHAL P K •

Thanks a lot for the feedback, Alex! Really glad the strict separation between deterministic scoring and AI coaching resonated with you—keeping marks verifiable against the official key was a top priority.

A "Why this coaching tip" panel tracing advice back to the exact question and syllabus tags is a great idea. It would definitely make the coaching layer much more transparent and grounded. I'll add this to the roadmap for the next iteration!

Collapse
 
alexshev profile image
Alex Shev •

That roadmap item would make the coaching layer much easier to trust. I would treat the panel as a compact proof: the question or syllabus tag that triggered the advice, the scoring signal, and a short explanation of the recommendation's scope. It also gives learners a clean way to flag advice that is helpful in tone but not grounded in the evaluated attempt.