Ismail Ben Alla

Code-Hinter

AI Grading Inside VS Code

LLM apps · Apr 2025 · Completed

Programming exercises created, submitted, and AI-graded without leaving VS Code.

Built withTypeScriptVS Code APIPythonFlaskNext.jsHugging Face TransformersSupabase

Code-Hinter — overview

Overview

In a programming course, exercises usually live in one place, student code in another, and grading in a third. For a team project at École Centrale de Lyon, we asked whether the whole loop could happen inside the editor students already use, while the professor stays in charge of what counts as a correct answer.

We built Code-Hinter: a VS Code extension, a Python/Flask backend, and a companion Next.js web app. Professors define exercises with a reference solution and the concepts they expect; students log in, pick an exercise, and evaluate or submit their code from the Command Palette. A small open model (SmolLM2-1.7B-Instruct) checks the code against the professor's concepts and scores how close it is to the reference solution.

The project taught me that AI feedback is only trusted when the criteria are explicit and owned by the teacher. It remained an academic project and was not deployed beyond the course.

The question

Can AI-assisted grading live where students already work — the editor — while professors keep control of the grading criteria?

Key features

How it works

  1. Professor defines the exercise

    Each exercise stores the professor's reference code and the concepts a correct answer must show, linked to professors and students in a simple relational model.

  2. Student works in the editor

    The extension reads the open file and sends it to the Flask API (evaluate_code, compare_code, or complete_code) with the selected exercise.

  3. Model grades against criteria

    The backend prompts SmolLM2-1.7B-Instruct through Hugging Face Transformers to check each concept, or to return a single 0 to 100 similarity score against the reference solution.

  4. Result back in VS Code

    The response is shown to the student in the editor, and the web app gives teachers and students a dashboard view of exercises.

Examples

Demo of the VS Code extension: choosing an exercise from the Command Palette and evaluating code. (watch on YouTube)
Demo of the companion Next.js web app for teachers and students. (watch on YouTube)
The backend data model from the repository: professors create exercises, supervise students, and each student's attempt is tracked with its score, status, and submitted code.
The backend data model from the repository: professors create exercises, supervise students, and each student's attempt is tracked with its score, status, and submitted code.

Input

POST /api/evaluate_code with the exercise's concepts and the student's code, e.g. "print([x for x in range(10)])"

Output

One line per concept in the format the grading prompt requires: "[nbr]) [yes/no], [explanation in 6 words]", with any syntax or logic error called out.

The evaluation contract between the extension and the backend, taken from the repository's API and prompt.

Tech stack

What I learned

Limitations