Knowledge tracing is a key area of research contributing to personalized education. In recent times, deep knowledge tracing has achieved great success. However, the sparsity of students’ practice data still limits the performance and application of knowledge tracing. An additional complication is that the contribution of the answer record to the current knowledge state is different at each time step. To solve these problems, we propose Attention-based Knowledge Tracing with Heterogeneous Information Network Embedding (AKTHE). First, we describe questions and their attributes with a heterogeneous information network and generate meaningful node embeddings. Second, we capture the relevance of historical data to the current state by using attention mechanism. Experimental results on four benchmark datasets verify the superiority of our method for knowledge tracing.