1. Introduction
Artificial Intelligence (AI) is increasingly applied in higher education, particularly in STEM disciplines, where automation and analytical support can substantially reduce instructional workload and enhance student learning experiences. In programming courses, the assessment of student assignments traditionally requires considerable time, expert code evaluation, and additional communication with students for clarification or corrections. With the growing availability of advanced generative models and tools for text and code processing, the opportunity emerges for AI-assisted preliminary grading, enabling real-time analysis, feedback, and classification of student work. In higher education, especially with growing class sizes, automated grading systems are increasingly seen as necessary to handle large volumes of assignments and reduce the burdens on instructors. At the same time, educators recognize the potential of AI to enhance assessment processes, suggesting that instead of banning such tools, they should be leveraged to improve grading consistency and feedback quality.
This study presents an experimental approach to employing multiple AI tools and platforms for the preliminary evaluation of programming assignments in undergraduate courses Introduction to Programming, Programming 2, and Advanced Programming Concepts. The experiment combines generative large language models (LLMs), including ChatGPT with analytical extensions (DeepResearch, Code Interpreter/Data Analyst), Claude.ai, Google AI Studio with Gemini models, as well as custom Python scripts for code evaluation. Special attention is devoted to the integration of Google AI Studio, which supports contextually extensive queries (up to 1,000,000 tokens) and connectivity with tabular data (e.g., Excel), thereby enabling additional flexibility in grading and analysis.
For the purposes of the experiment, a collection of Python-based assignments completed by students during regular coursework was compiled. The assignments were exported from the Moodle system in CSV/JSON format and subsequently processed by AI systems. Evaluation was conducted in three phases: (1) code analysis by LLMs according to predefined criteria (functionality, correctness, style, comments), (2) comparison with instructor-assigned grades, and (3) quantitative and qualitative analysis of deviations and grading accuracy.
The scientific contribution of this study is threefold. First, it introduces a novel methodology for semi-automated assessment of student work through AI systems integrated with both open-source and commercial tools. Second, it demonstrates the application of fine-tuned and contextually enriched AI models in an authentic educational environment, including prototype scripts for code processing and evaluation. Third, it examines challenges and limitations, such as the reliability of LMS data exports, technical constraints of AI tools (API limitations, quotas, privacy concerns), and the necessity of manual validation.
Additionally, the experiment collected data on the effectiveness of detecting common coding errors (e.g., faulty loops, uninitialized variables, inefficient algorithms), the processing speed per assignment, and the overall time savings compared to manual grading. Particular emphasis is placed on tools that support zero-shot and few-shot learning, which allow for the generation of grades and feedback without extensive manual data labeling.
The remainder of the paper details the employed technologies, system architecture, experimental methodology, evaluation criteria, results, and their interpretation. Furthermore, the study discusses scalability to other courses and institutions, as well as the ethical and transparency considerations associated with the educational use of AI systems.
2. Related Work and Review of Existing AI Tools in Education
Recent studies have shown that LLMs can approximate human-level grading accuracy in essay scoring. C. Impey et al. [
1] in their study, used GPT-4 to grade short science essays in MOOCs, finding that its scores matched instructor grades and even exceeded the reliability of peer grading. This suggests LLMs may enable automated yet credible scoring at scale. Similarly, M. Usher [
2] compared ChatGPT-4 with professors and peers in a university course assessment. In his study, M. Usher reported that ChatGPT-4 tended to grade more leniently than human assessors but offered more extensive feedback, while peer and instructor scores were lower and closely aligned. On the other hand, C. Grévisse [
3] found GPT-4′s grading to be significantly stricter than a human teacher’s, giving lower scores on average. Nonetheless, GPT-4 showed high precision in identifying fully correct answers with few false positives. The study also tested Gemini 1.5, another LLM, which on average graded similarly to the human but exhibited greater variability on certain questions. [
3]. Additionally, B. Quah et al. [
4] evaluated ChatGPT in grading dental students’ essays. They reported a moderate correlation with human scores and noted that ChatGPT’s average grades were slightly lower than instructors.
One of the central themes of published studies is whether AI graders can reliably mimic human judgment and what biases or differences exist. M. Lundgren in his study [
5] found that GPT-4 matched mean scores of human graders but lacked sensitivity to rubric nuances, thus avoiding very high or low scores and had low inter-rater reliability with humans. R. Mok et al. [
6] conducted a “hands-on test” using LLMs to grade university physics exam answers. In their study they demonstrated that LLMs graded straightforward physics answers well, but struggled with diagrams and complex reasoning. C. Xiao et al. [
7] proposed a dual-process system combining LLMs and humans, through a human-AI collaborative scheme in which an open-source LLM grader is used alongside human graders in a second-language essay course. Their system provided automated score and high quality feedback, while greatly improving grading consistency, when novice and expert instructors co-graded with the AI. Such findings correlate with the findings of M. Usher [
2] study and conclusion that AI can be integrated as a “second pair of eyes” thus improving grading consistency.
In programming education, LLMs like ChatGPT show promise in evaluating code quality and offering feedback. Traditional auto-graders mostly check functional correctness, but LLM-based approaches aim to evaluate code qualitatively, by reviewing style, efficiency and documentation while also providing constructive feedback. E. Q. Tseng et al. [
8] introduced CodEv, an automated code grading framework that uses multiple LLMs with chain-of-thought prompting to assess code on multiple dimensions. Codev provided human-aligned code reviews and feedback by not only generating grades, but also providing textual comments on code readability, structure, and maintainability. Additionally, A. Mehta et al. [
9] in their study specifically evaluated ChatGPT as a virtual teaching assistant in an introductory programming course. They compared ChatGPT’s grading of student code against human educators, and also analyzed the feedback it gave. Their findings show that ChatGPT was able to apply the grading rubric correctly in most cases, and its point deductions correlated strongly with the educators’, thus indicating that it identified similar errors or omissions. Moreover, M. Jukiewicz’s study [
10] reinforces these previously mentioned findings. In his study, over a 15-week pilot study that incorporated nine programming assignments were dual-graded by the instructor and ChatGPT. On average, the human instructor tended to assign slightly higher scores than ChatGPT, but there was a strong positive correlation between their grades, demonstrating consistent ranking of student performance by the AI. I. Aytutuldu et al. [
11] utilizied an AI-powered assessment tool AI-PAT, which leverages ChatGPT and Gemini models to both grade and handle grading appeals in computer science courses. In their study they found the AI models’ scores to be strongly correlated with each other and with human judgments, though different prompt setups could cause score variability. On the other hand, A. Mangalur et al. [
12], in their study, proposed a framework combining adaptive intelligence and analytics for continuous student evaluation. Their system uses a generative AI, utilizing Gemini API, to generate customized quiz questions, auto-grade responses, and instantly feedback with explanations.
Beyond grading, a critical role of assessment is to give students feedback that helps them improve. Here, researchers have explored AI as a feedback generator and compared it with traditional feedback sources, such as teacher or peers. A recurring finding is that AI feedback can be as effective as human feedback in supporting learning outcomes, and students often appreciate its clarity and detail, but the best results may come from combining AI and human input. For instance, in their research J. Escalante et al. [
13] studied English learners, primarily EFL students, receiving writing feedback either from an instructor or from ChatGPT. In their study, they found out that after an 8-week writing intervention, both groups improved similarly in their writing proficiency, with no significant difference in gains between AI-generated feedback and human feedback. Similarly, S.K. Banihashem et al. in their study [
14] compared peer-generated versus ChatGPT-generated feedback on university students’ argumentative essays. They found a significant difference in the nature of feedback, ChatGPT’s comments were more descriptive, focusing on how the essay was written, primary focus on organization, style, and coherence, whereas peer feedback was more problem-focused, identifying issues or gaps in arguments. B. Quah et al. [
4] in their study concluded that the level of detail and personalization possible with LLM’s is their major advantage. In their research they observed that ChatGPT could deliver individualized, criterion-based feedback to every student essay, something infeasible for a single instructor in a large audience.
The advent of ChatGPT and similar AI has sparked a reevaluation of assessment strategies in higher education. Researchers are not only testing AI’s performance, but also discussing policy and implementation issues that arise when adopting AI for grading. In their study, I. S. Chaudhry et al. [
15] argued for redesigning assessments in the ChatGPT era to emphasize skills beyond AI replication, while also recommending that universities redesign evaluations to emphasize skills that AI cannot simply replicate. Moreover, R. Kumar [
16] in his study outlined the benefits and ethical concerns of using AI for grading, including issues of transparency and privacy, while also proposing numerous benefits of AI grading, such as discretion, consistent feedback, and elimination of human grader bias or fatigue. G. Ilieva et al. [
17] proposed a framework for AI-driven assessment aligned with pedagogical goals and quality assurance. In their study, they emphasized iterative validation and faculty involvement where key point is that faculty and students must be engaged in co-designing AI-integrated assessment, to ensure buy-in and to surface any issues of trust or ethics early. Finally, in their study S. Elsayed and D. Cakir [
18] argued for rethinking feedback practices, suggesting AI can support more structured and actionable feedback, while also providing evidence that many students still do not find traditional feedback useful, often because it’s too vague, too late, or not actionable. Similarly, A. Smolansky et al. [
19], in their study, surveyed educators and students across universities regarding generative AI in assessment. They found out that both groups agreed that assessment practices must evolve; rather than banning AI, it should be leveraged. In practical terms, they concluded that this might mean using AI to grade routine aspects, such as grammar and factual content, while instructors grade creativity or reasoning, a partition that preserves human judgment where it’s most needed.
A. Čep et al. [
20] employed a structured review methodology to analyze the integration of large language models (LLMs), particularly GPT models, in video game narrative design. Using clearly defined selection and analysis criteria, they systematically categorized recent experimental and case studies to evaluate the effectiveness of GPT models across various narrative elements, from dialogues to full storylines. Their work contributes scientifically by synthesizing state-of-the-art applications of LLMs in interactive storytelling and highlighting actionable insights for future integration across diverse game genres. Additionally, by assessing the benefits and limitations of GPT-driven narratives, the study provides guidance for both game designers and AI researchers in optimizing player experience through generative AI.
2.1. General Web-Based AI Tools
Within the scope of preliminary assessment of student programming assignments, several general-purpose AI tools with web-based interfaces were analyzed. These platforms require no additional installation and allow fast, accessible interaction through a standard web browser. The tools tested included ChatGPT 4.5 (OpenAI), Claude 3.5 (Anthropic), Perplexity Pro, DeepSeek R1, and Minimax ver. 01. All of these are based on advanced large language models (LLMs), differing in architecture, context length, code handling capabilities, and their ability to perform complex analytical operations.
ChatGPT proved to be the most effective tool for this project, primarily due to its integrated extensions such as DeepResearch and Data Analyst (also known as Code Interpreter). These allow CSV file uploads, data analysis, and complex tabular operations within an interactive interface. In the educational context, ChatGPT was employed for automated review and refinement of instructional materials, including evaluation of task clarity, logical consistency of instructions, and linguistic and grammatical accuracy. Through several iterations, assignment descriptions were refined into content that was pedagogically consistent, cognitively aligned with course level, and linguistically optimized for students whose first language is not English.
Moreover, the Data Analyst functionality enabled the loading and analysis of CSV files containing student results throughout the semester. This facilitated the generation of dynamic reports, including identification of high-performing students (potential candidates for exemption from partial exams), detection of anomalies (sudden changes in performance), and calculation of descriptive statistics (mean, median, standard deviation per assignment). This significantly accelerated and objectified pedagogical decision-making during the semester.
Claude.ai, based on Anthropic’s proprietary LLM architecture (Claude 3.0 series), was used when processing longer inputs (over 100k tokens), such as entire repositories of student code with comments. Its strength lies in maintaining consistency across the evaluation of multiple assignments within a single conversational context. Perplexity proved useful for quickly generating contextual summaries and comparing student solutions against best practices, while DeepSeek was tested for its declared proficiency with multiple programming languages and technically precise responses in C/C++ 20, Python 3.10, and JavaScript ECMAScript 2024 (ES2024). Minimax, though limited in availability and functionality, was used experimentally as a contrast to the other tools, particularly in analyzing commented code.
Despite their advanced capabilities, these tools still require manual validation of outputs, as errors were observed in interpreting complex semantic relationships within code, as well as cases of oversimplification. Additional challenges include limitations of free versions, usage quotas, and concerns regarding privacy and protection of student data when processed on commercial platforms.
In conclusion, web-based AI tools demonstrate strong potential for supporting instructors in material preparation, results analysis, and preliminary assessment. However, their integration into educational practice requires a carefully designed framework, including clear evaluation guidelines, adherence to ethical standards, and continuous quality monitoring.
2.2. Limitations of Web-Based Tools
Unlike generic web-based AI tools, which are primarily optimized for direct user interaction, advanced applications of AI in education require deeper integration of models within automated scripts and data-processing systems. In this experiment, Google AI Studio (Gemini 2.5 Flash model) was employed as a development environment enabling direct interaction with various Gemini model versions (1.5, 2.0, and 2.5). It supports query execution via Python scripts, processing of text and code inputs, and connectivity with external data sources such as Google Sheets or Excel files.
A key advantage of Gemini models is their support for extremely large context windows—up to 1,000,000 tokens in some cases—which allows simultaneous analysis of multiple student submissions, accompanying task descriptions, LMS-exported CSV files, and grading rubrics. This reduces the need to fragment input data, thereby mitigating the risk of losing semantic context.
Python scripts were designed to automate the process of querying Gemini models through the API, leveraging functions for:
importing student submissions from CSV format (Moodle exports),
structural and semantic code analysis (error detection, comments, code organization),
classification of solutions according to predefined rubrics (e.g., 0–5 points per dimension: correctness, efficiency, readability, comments),
generating student feedback in the form of textual recommendations for improvement.
Each query incorporated prompt engineering techniques, augmenting the input prompt with examples of correct and incorrect solutions (few-shot learning) and specifying the expected output format, such as a JSON structure with fields for grade, comment, and detected errors.
Beyond classification, Gemini models were also used for error pattern detection, e.g., recurring issues in the use of for and while loops, incorrect variable initialization, or misconceptions regarding function execution order. Using the models’ “explanation” modules, textual justifications were generated for problematic code segments, which holds pedagogical value in providing actionable feedback.
Additionally, an experimental batch-assessment workflow was tested, in which Gemini models graded large sets of assignments using predefined scripts that imported tasks, generated responses, and recorded scores into Excel files. This approach allowed for high-volume evaluation (hundreds of submissions per run) and facilitated comparison with instructor grading for accuracy validation.
Challenges observed included:
access limitations and usage quotas (especially with free Google accounts),
response latency for large inputs, where processing could take several minutes per assignment,
unreliability of LMS exports, which often produced semi-structured or inconsistent CSV files.
Despite these challenges, the advantages are significant. AI tools integrated into automated scripts enable higher levels of automation, reproducibility, and flexibility in assessment, while also opening possibilities for fine-tuning with real student data and grades as training sets in future iterations. Importantly, the ability to generate personalized feedback enhances transparency and student motivation, while substantially reducing instructor workload.
3. Methodology
The experiment was structured into four main phases: (1) Data preparation and export—collecting and anonymizing student code submissions from the LMS; (2) Definition of evaluation criteria—developing a grading rubric (functionality, structure, documentation, efficiency) and example-guided prompts; (3) AI-based evaluation and result recording—using the three LLMs to grade assignments according to the rubric and storing their scores and feedback; and (4) Comparative analysis—comparing the AI-generated grades to instructor-assigned grades for agreement and accuracy.
To examine the effectiveness and accuracy of AI-assisted preliminary grading of student programming assignments, a multi-phase experimental study was conducted across three undergraduate computer science courses: Introduction to Programming, Programming 2, and Advanced Programming Concepts. The experiment was structured into four main phases: (1) data preparation and export, (2) definition of evaluation criteria, (3) AI-based evaluation and result recording, and (4) comparative analysis with instructor grading.
3.1. Data Collection and Processing
The dataset of student assignments was collected from the Moodle learning management system at the University North. The assignments were written in Python and submitted either as plain text or .py files. For experimental purposes, the data were exported into CSV and JSON formats containing the following attributes:
anonymized student ID; solution source code; task identifier; instructor-assigned grade; instructor feedback (where available); submission timestamp.
To ensure consistency and structural integrity, a parsing and validation script was applied. This removed incomplete records and normalized code indentation, preventing syntactic irregularities from affecting AI models.
3.2. Definition of Evaluation Criteria
Student solutions were graded according to four rubric dimensions from
Table 1.
The maximum score per assignment was 10 points. AI models were instructed via prompt to generate both a score and justification for each category, with the final grade obtained as the sum of components.
3.3. AI-Based Evaluation
Two groups of tools were employed for code analysis:
General web-based AI tools (ChatGPT 4-turbo, Claude, Perplexity) in interactive mode, with inputs manually submitted for validation and comparison of responses.
Python scripts integrated with Google AI Studio and Gemini models, enabling batch processing of assignments and structured recording of results.
The alignment between AI-generated scores and instructor scores was measured using Pearson correlation coefficients. Pearson’s r captures the linear relationship between the AI’s scores and the instructor’s scores. We also computed the absolute difference in points (on a 0–10 scale) for each assignment to quantify the magnitude of score discrepancies.
For each assignment, the prompt included:
task description (from Moodle); student source code; rubric definition; few-shot grading examples.
To ensure consistency, a subset of 100 assignments was cross-validated against instructor grading. For each solution, the following measures were examined:
absolute score difference (AI vs. instructor); correlation of grades (Pearson and Spearman coefficients); agreement on functional correctness (validated through test cases where applicable).
3.4. Result Analysis and Validation
Evaluation metrics were divided into quantitative and qualitative categories as shown in
Table 2.
Additionally, task complexity was analyzed as a moderating factor in AI performance. Results indicated that models achieved higher accuracy in grading simpler algorithmic tasks (e.g., loops, conditionals), but encountered greater difficulty with assignments involving multiple files, modularization, or exception handling.
5. Discussion and Recommendations
The implementation of AI tools in preliminary grading of student assignments offers several advantages, but also presents challenges that must be carefully addressed. One of the most significant benefits is a considerable acceleration of the evaluation process, enabling instructors to focus on higher-quality pedagogical work and individualized student support. AI tools, especially those capable of deep code analysis and contextual understanding, can detect common programming errors, logical inconsistencies, and stylistic shortcomings, thereby further improving the quality of feedback. This also opens the possibility of early identification of educational issues, such as conceptual difficulties or insufficient understanding of key programming constructs, which is crucial for timely intervention.
On the other hand, there are substantial risks associated with over-reliance on AI systems. Models may sometimes produce inaccurate or inadequate grades due to inherent limitations of the training dataset, as well as the complexity and creativity of programming tasks. Technical limitations include API capacities, restricted context windows in some models, and unpredictable performance in cases of more complex tasks. Algorithmic transparency and the way AI reaches its conclusions represent an additional challenge, particularly in academic settings where justification of grades and protection against bias are essential.
Based on the conducted experiment, the development of hybrid grading models is recommended, combining the strengths of AI systems with necessary expert oversight from instructors. Such an approach offers the best of both worlds—automation and speed along with human judgment and ethical responsibility. Furthermore, it is important to establish clear ethical guidelines for the use of AI in education, including data privacy, academic integrity, and transparency of grading.
Due to challenges associated with proprietary AI platforms, a stronger orientation toward open-source and interoperable systems is recommended, which allows greater control, customization, and integration within existing educational ecosystems. Further development should include the standardization of evaluation metrics for AI systems, API development for easier LMS integration, and continuous assessment of AI tools’ impact on educational outcomes and student motivation through empirical studies.
Ultimately, the integration of AI into the grading process represents a paradigmatic shift in educational practice, which, if properly guided, can significantly enhance the quality and efficiency of higher education.
These results align with recent studies exploring AI-assisted grading of programming assignments. Mehta et al. [
9] found that ChatGPT could apply a grading rubric in an introductory programming course with high fidelity, and its point deductions were strongly correlated with those of human instructors. Similarly, Jukiewicz [
10] reported a strong positive correlation between ChatGPT’s grades and an instructor’s grades across multiple coding assignments, with instructors only slightly more generous on average. In another study, Aytutuldu et al. [
11] deployed a ChatGPT/Gemini-based grading system in computer science courses and observed that the AI models’ scores were strongly correlated both with each other and with human judgments. These parallel findings suggest that large language models can replicate human grading patterns for code assignments to a remarkable degree, reinforcing the credibility of our approach. Minor differences do exist—for instance, as Jukiewicz noted and our results hinted, the AI may sometimes grade slightly stricter than instructors—but overall the ranking of student performance by the AI was consistent with human assessment in both their study and ours.
Moreover, any AI-driven grading system must safeguard student data privacy, ensuring that code submissions and feedback remain secure and compliant with institutional policies. AI graders also have inherent limitations—they cannot truly evaluate the creativity or originality of a student’s solution, nor the rationale behind architectural design choices. As a result, an AI might overlook innovative approaches or fail to detect when a student’s work isn’t authentically their own. These factors, combined with potential algorithmic biases in LLMs, underscore the importance of human oversight and a balanced approach to AI use in grading.
6. Conclusions
The experiment conducted in this study demonstrated that modern artificial intelligence tools, particularly large language models such as ChatGPT-4, Gemini 1.5, and Claude 3, can significantly enhance the process of preliminary grading of student programming assignments. The greatest contribution is observed in the initial code evaluation phase, detection of syntactic and logical errors, and generation of structured comments that provide students with high-quality feedback.
ChatGPT-4, when used with the Data Analyst module, proved to be the most reliable in terms of grading consistency, quality of explanations, and detection of edge cases. Gemini 1.5 also offers high accuracy and exceptional processing speed, especially when accessed via the AI Studio platform. Claude 3, while promising, exhibited greater variability in results, necessitating additional validation in educational contexts.
In the context of teaching practice, AI systems are recommended for:
Rapid preliminary grading of large student groups,
Generating personalized feedback for simpler assignments,
Analyzing trends in student performance throughout the semester (e.g., for identifying candidates for partial exam exemptions),
Automating certain administrative processes, such as aggregation and classification of grades.
However, the use of AI systems cannot fully replace expert evaluation. Human oversight is essential to ensure accuracy, ethical compliance, and pedagogical quality of grading. Additionally, investment is required to build robust data processing infrastructure and to ensure alignment with privacy policies and academic integrity standards.
For future application, the following are recommended:
Integration of AI models into LMS platforms (e.g., Moodle) via plugins enabling local processing and audit trails of grades,
Development of scripts for preprocessing and validating student code before submission to AI models,
Training teaching staff in formulating optimal prompts and interpreting AI results,
Further research on the impact of AI grading on student motivation and learning outcomes through longitudinal studies and controlled experiments.
In conclusion, the results indicate that it is possible to develop reliable, efficient, and scalable AI-assisted grading systems in education, provided that careful design, expert oversight, and clear pedagogical methodology are ensured.