Knowledge tracing is of great significance for providing better personalized learning guidance and has thus attracted extensive research attention in recent years. The task of knowledge tracing is to model students' learning process on the basis of historical exercise records and trace students' knowledge proficiency, thereby predicting students' performance on future exercises or recommending exercises for better proficiency. Existing methods focus on either the skill level or the exercise level, ignoring the relationships among exercises and Knowledge Components (KCs). The classical single-factor models include the Deep Knowledge Tracing (DKT) {model} and the Dynamic Key-Value Memory Network (DKVMN) model. Although a few models, such as the Bayesian Knowledge Tracing (BKT) model and the Knowledge Proficiency Tracing (KPT) model, utilize the Q-matrix to improve model performance, most of them ignore the interaction among KCs, not to mention models that do not use the Q-matrix. Inspired by the recent success of network embedding, this paper presents a heterogeneous network embedding framework for knowledge tracing called HNEKT that takes both exercises and KCs into account. To adapt to the application of knowledge tracing, this paper also proposes several meta-paths to generate meaningful node sequences for network embedding. Besides, it explores other side information as well to improve the extensibility and effectiveness of the proposed model. Extensive experiments on three real-world datasets demonstrate the effectiveness of the HNEKT model.