# Knowledge Graph and Personalized Answer Sequences for Programming Knowledge Tracing
## 1 Introduction  
With the continuous development of Massive Open Online Courses (MOOC), a large amount of online learning data can be used to accurately and timely trace students' learning states. Knowledge tracing (KT) is a data-driven method in education technology, which uses a series of student interactions with exercises to predict their mastery of Knowledge Concepts (KCs) corresponding to those exercises. However, many existing KT models, such as DKT [1], DKT+ [2], DKVMN [3], SAKT [4], IEKT [5], AKT [6], and GKT [7], suffer from limitations, including insufficient exercise representation and a lack of personalized knowledge state modeling. Details of these works will be reviewed in the subsequent section. Nowadays, programming has become a fundamental skill for solving real-world problems. However, despite the success of KT in MOOC systems, a noticeable gap in research on KT within programming education can be observed, which presents distinct challenges. Programming KT is mainly based on subjective exercises, and questions are usually answered by students through code submission. The performance of students' code is judged by the evaluation system using test data under different situations. In this context, we provide an example of students' answers to programming exercises, as shown in Figure 1, where exercise \(p_{1}\) corresponds to the KC \"Struct\", \(p_{2}\) includes the KCs \"Struct\" and \"Pointer\", \(p_{3}\) corresponds to the KC \"LinkList\", and \(p_{4}\) includes the KCs \"LinkList\"and \"Bi-LinkList\". In the process of answering exercises in the field of programming, two aspects are worth considering:  
1. Exercises are not independent--clear predecessor and successor relationships between KCs exist. For example, after the \(p_{2}\) exercise was answered incorrectly, \(p_{4}\) continued to be attempted by student \(S_{1}\). Due to insufficient mastery of the predecessor of \(p_{4}\), the exercise resulted in a timeout. However, after exercises related to the previous KCs, \(p_{2}\) and \(p_{3}\), were completed, \(p_{4}\) was answered correctly by student \(S_{1}\). 2. Multiple attempts reflect individualized knowledge mastery. For example, two failed attempts were made by student \(S_{2}\) even after exercise \(p_{2}\) was answered correctly, which may have been submitted for testing reasons and should not be interpreted as a lack of mastery over the KCs involved. Another example is when exercise \(p_{1}\) was faced; students \(S_{1}\) and \(S_{2}\) answered correctly on the first attempt, while three attempts were required by student \(S_{3}\) to get it right. Therefore, the mastery of the knowledge concept \"Struct\" is clearly different for \(S_{1}\) and \(S_{2}\) compared to \(S_{3}\). Various methods have been explored in current studies on programming KT. For example, Bayesian Knowledge Tracing (BKT) has been employed for code quality assessment, and code representation learning has been conducted using abstract syntax trees (AST) and token-based methods. While promise has been shown by these methods in tracing students' knowledge states on individual exercises, the broader relationships between exercises and KCs are often overlooked, and personalization in modeling students' overall knowledge states is lacking. To address these challenges, we propose a programming KT model based on a knowledge graph and personalized answer sequences for the diversification of programming exercises, named GPPKT. A knowledge graph is provided as a structured way to represent relationships between entities, making it especially suitable for organizing complex information. In the context of programming KT, the hierarchical and relational structure of knowledge concepts is captured by the knowledge graph, and the connections between these concepts are modeled more accurately. The Variational Autoencoder (VAE) [8] is utilized as a powerful generative model to learn latent representations of data. These latent variables capture the underlying structure and variability in the data.