Considering students' learning styles in education and especially in technology enhanced education can have many benefits for students such as providing them with personalized recommendations and advice based on their learning styles. However, in order to provide students with such personalized recommendations and advice, their learning styles have to be identified first. In this paper, we introduce an architecture that aims at monitoring students' behaviour in online courses and using this information in order to build and frequently update a cognitive profile that consists of information about students' learning styles. Dynamic student modelling enables systems to incrementally learn students' learning styles, identify and consider exceptional behaviour of students, and update students' learning styles once they change over time. In order to quickly initialise the cognitive profile, the architecture additionally provides a learning style questionnaire that can (but does not have to) be used by students and therefore combines static and dynamic student modelling of learning styles. The proposed architecture can be easily integrated in different learning systems, requiring only few adjustments with respect to locating data about students' behaviour, providing notifications about students' actions in a course, and presenting a link to the learning style questionnaire. The architecture has been integrated in a learning system and an adaptivity module has been developed to demonstrate the benefits of dynamic student modelling. This adaptivity module extends the proposed architecture by accessing the information about students' learning styles in the cognitive profile and using this information for providing students with adaptive feedback about their learning styles and how to improve their learning processes considering their learning styles.