-
-
LogicTutor AI main interface: clean workspace where first-year students paste code and choose between FORTRAN 90/95 or C.
-
C Language debugging feedback catching assignment inside an if-condition, infinite loops, and missing semicolons without spoilers.
-
FORTRAN 90/95 analysis detecting missing IMPLICIT NONE, unclosed DO loops, and uninitialized accumulators with guiding questions.
Track
Education — Academic organization, tutoring, and accessibility in introductory programming labs.
Inspiration
While reviewing and grading first-semester programming lab reports (specifically in FORTRAN and C), a recurring pattern became clear: beginners rarely fail because they lack intelligence—they struggle with foundational traps like uninitialized accumulators, integer division truncation, missing IMPLICIT NONE declarations, or confusing assignment (=) with equality (==). When students paste their broken code into standard AI chatbots, they usually get the complete, fixed solution right away, bypassing the critical debugging process required to actually learn programming logic. LogicTutor AI was inspired by the need for an accessible, always-available lab teaching assistant that guides students with Socratic hints instead of spoiling the answer.
What it does
LogicTutor AI is a lightweight web-based debugging mentor designed for first-year computer science and engineering students:
- Socratic Hint Generation: Analyzes student code in FORTRAN 90/95 and C, pinpointing structural or logical issues and asking targeted guiding questions so the student discovers the fix independently.
- Hybrid Dual-Engine Architecture:
- Zero-API Offline Heuristic Engine: Uses static pattern analysis and regex/AST-inspired rules to detect common first-semester pitfalls immediately with zero latency, zero API costs, and full offline support.
- Optional Gemini AI Engine: Allows users with a free Google AI Studio key to unlock deep, natural-language LLM analysis for complex or custom logic errors.
- Interactive Lab Examples: Includes built-in buggy code samples so students or evaluators can test the Socratic feedback loop in one click.
How we built it
- Frontend: Built with semantic HTML5, responsive CSS3 (dark-mode lab interface), and vanilla JavaScript (ES6+) so it runs natively in any browser without heavy dependencies or build steps.
- Hybrid Analysis Pipeline: Implemented a client-side static rule engine (
runLocalHeuristicEngine) tailored to introductory FORTRAN and C curricula, paired with an asynchronousfetchintegration to the Gemini 2.5 Flash REST API with automatic fallback handling.
AI Tools Disclosure & Attribution
In accordance with the STEM2Connect AI Hackathon guidelines, Gemini was used as an AI coding and brainstorming assistant during development to structure the Socratic prompt engineering, refine regular expressions for FORTRAN/C static checks, and draft project documentation.
Challenges we ran into
- Balancing helpfulness without giving away the direct code fix in both the deterministic rules and the LLM system prompt.
- Ensuring the tool remains 100% functional for students or judges who do not have cloud API credits, which led to designing the hybrid fallback architecture.
What we learned & What's next
Building a hybrid system proved that combining deterministic domain knowledge (real patterns seen when grading student lab reports) with generative AI creates more reliable educational tools than relying on an LLM alone. Next steps include adding support for Python, interactive line-by-line code highlighting, and a rubric checklist mode for lab report self-evaluation.
Built With
- c
- css3
- fortran
- gemini-api
- html5
- javascript