Virtual Learning Environments provide teachers with a web-based platform to create different types of feedback. These environments usually follow the `one size fits all' approach and provide students with the same feedback. Several personalized feedback frameworks have been proposed which adapt the different types of feedback based on the student characteristics and/or the assessment question characteristics. The frameworks are intradisciplinary, neglect the characteristics of the assessment question, and either hard-code or auto-generate the types of feedback from a restricted set of solutions created by a domain expert. This paper contributes to research carried out on personalized feedback frameworks by proposing a generic novel system which is called the Ontology-based Personalized Feedback Generator (OntoPeFeGe). OntoPeFeGe addressed the aforementioned drawbacks using an ontology-a knowledge representation of the educational domain. It integrated several generation strategies and templates to traverse the ontology and auto-generate the questions and feedback. The questions have different characteristics, in particular, aiming to assess students at different levels in Bloom's taxonomy. Each question is associated with different types of feedback that range from verifying student's answers to giving the student more details related to the answer. The feedback auto-generated in OntoPeFeGe is personalized using a rule-based algorithm which takes into account the student characteristics and the assessment question characteristics. The personalized feedback in OntoPeFeGe was quantitatively evaluated on 88 undergraduate students. The results revealed that the personalized feedback significantly improved the performance of students with low background knowledge. In addition, the feedback was evaluated qualitatively using questionnaires provided to teachers and students.