Recommender Systems are information systems that provide personalized suggestions or recommendations to users based on their preferences, interaction history, and behavior patterns. An important use of recommender systems is in Virtual Learning Environments (VLEs), i.e. remote learning platforms where students can access educational materials, activities, assessments, etc., where they offer significant benefits to both students and instructors. Such benefits include personalized learning, increased engagement and effectiveness of both teaching and learning tasks. Challenges for the use of recommendation systems in VLEs include the cold start problem, data sparsity, and limited coverage. To deal with these challenges, we propose G-Learn, a recommendation system for contents in VLEs that can operate in both supervised and unsupervised modes. The recommendations are based on graph machine learning techniques combined with keyword mining and similarity, allowing the system to recommend educational materials that are adapted to the performance of each student detected when the student solves questions on the platform. We show the effectiveness of G-learn in a realistic scenario, using data from the VLE Homero, a computer science platform supported by the federal government of Brazil. We compare different settings for the keyword mining and machine learning techniques. Real data from students is used to validate the recommendation graphs, where G-learn obtained an average f1-score of 0.64 in the unsupervised mode and 0.95 in the supervised one.