With the rise of online eTextbooks and Massive Open Online Courses (MOOCs), a huge amount of data has been collected related to students’ learning. With the careful analysis of this data, educators can gain useful insights into the performance of their students and their behavior in learning a particular topic. This paper proposes a new model for predicting student performance based on an analysis of how students interact with an interactive online eTextbook. By being able to predict students’ performance early in the course, educators can easily identify students at risk and provide a suitable intervention. We considered two main issues the prediction of good/bad performance and the prediction of the final exam grade. To build the proposed model, we evaluated the most popular classification and regression algorithms on data from a data structures and algorithms course (CS2) offered in a large public research university. Random Forest Regression and Multiple Linear Regression have been applied in Regression. While Logistic Regression, decision tree, Random Forest Classifier, K Nearest Neighbors, and Support Vector Machine have been applied in classification. Based on the findings of the experiments, the algorithm with the best result overall in classification for this data was Random Forest Classifier with an accuracy equal to 91.7% while in the regression it was Random Forest Regression with an R² equal to 0.977.