Artificial Intelligence has rapidly developed, especially in education and programming, providing advantages in improving learning efficiency and personalizing educational content. This study examines the relationships between learning motivation and problem-solving skills, as well as factors influencing learning motivation, namely growth mindset, self-efficacy, and perceived usefulness of Artificial Intelligence. Data collected from 276 students were analyzed using Partial Least Squares Structural Equation Modeling. The results show that growth mindset, self-efficacy, and perceived usefulness significantly influence learning motivation. Additionally, learning motivation strongly predicts problem-solving skills in programming tasks. These findings emphasize the critical role of psychological factors in fostering learning motivation and improving problem-solving abilities within Artificial Intelligence-enhanced programming environments. This research offers valuable insights for educators and instructional designers to develop effective strategies that integrate psychological support and Artificial Intelligence tools, ultimately enhancing student learning outcomes.