In this research, a hybrid approach combining a Hidden Markov Model (HMM) with a Long Short-Term Memory (LSTM) recurrent neural network (RNN) is introduced to model real-time online feedback to students when completing academic activities using online Learning Management Systems (LMS). The solution provided is a Smart Classifier which unravels, and processes hidden patterns in the data to train appropriate metrics to raise flags indicating outlier student behavior based on historical data from previous and ongoing sessions. This work introduces an approach that facilitates modifications of the attention mechanism in Transformer models. Using this approach, the predictor module of the proposed solution is improved. The key element of this improvement is to use a Bayesian Graph Network (BGN) coupled to a Transformer. As a novelty, this method provides a systematic customization of the attention mechanism in Transformer models that can be applied to a range of problems involving clickstream data.