Abstract
Java programming is an important skill for IT students to master object-oriented programming (OOP) concepts. Programming exercises help students develop their conceptual understanding and implementation skills. Previously, we implemented the Java Programming Learning Assistant System (JPLAS) for self-study. It includes the Code Writing Problem (CWP) that asks students to implement source code that is evaluated using JUnit test code. However, the current JUnit-based evaluation provides only a pass/fail outcome and does not offer feedback for identifying students’ misconceptions. As a result, teachers must manually analyze incorrect answer codes and refine corresponding materials. In this paper, we propose a generative AI-based feedback mechanism that integrates the Human-in-the-Loop (HITL) process into the CWP. The AI model accepts incorrect answer codes, teacher-prepared materials, supporting inputs, and JUnit execution results as inputs and generates feedback for student error diagnosis, test code refinement, and guidebook refinement as outputs. Expert teachers validate the generated outputs before material refinement. For the main evaluation, we applied the proposal to four OOP CWP topics in a Java course at the State Polytechnic of Malang (POLINEMA), Indonesia. Three AI model settings generated 72 outputs, which were evaluated and validated by five programming teachers. Overall, 54 of 72 outputs were accepted in the HITL validation. The five teacher validators showed high inter-rater agreement (Fleiss’ = 0.850). The mechanism also completed the evaluated teacher-side tasks faster than the manual condition. In a classroom comparison involving 33 and 20 students using the original and refined materials, respectively, the refined material group showed higher CWP pass rates (99.17% vs. 96.30%) and mean final grades (77.95 vs. 74.18).