A Proposal of Model of Emotional Regulation in Intelligent Learning Environments

. Emotions can influence cognitive development and are key elements to the teaching-learning process. Positive emotions (e.g., engagement) can improve the ability to solve problems, store information, and make decisions. On the other hand, negative emotions (e.g., boredom) reduce the capacity to process information at a deeper level, preventing learning to become effective. Therefore, students’ emotions must be regulated to hinder negative and to promote positive emotions during learning. To support the choice of the best intervention to regulate individual emotions, this article proposes an algorithm based on simulated data considering different individual performances in solving Algebra exercises. The results suggest that the proposed model has high success rates (over 90%) in the choice of interventions and may be applied in real scenarios.


Introduction
Emotions influence many aspects of the teaching process (Schutz and Lanehart, 2002) and can enhance or impair learning by having an impact on abilities such as categorization, thinking, and problem-solving (Greenleaf, 2002;Sutton and Wheatley, 2003). For instance, negative emotions can reduce the working memory 1 and the probability of students using cognitive strategies for deeper and more elaborate information processing (Linnenbrink and Pintrich, 2000). On the other hand, scientific research has shown that positive emotions can improve the ability to solve problems, facilitate the recall of to solve problems) is affected by the individuals' emotions and personality 3 ; if they experience a negative emotion, then their performance is negatively impacted.
A recent study (Reis, Alvares, Jaques and Isotani, 2018) provided evidence that personality traits may indicate how the subject manages their confusion. The results indicated that subjects who score high on neuroticism personality trait usually deal with confusion during less time compared to who score high on extroversion. The authors also noted that the more knowledge the subjects had about the subject for both personalities, the time for confusion tolerance increased. When this time of tolerance finished, students were more likely to feel frustrated and bored. Analyzing and knowing the moment when the individual is able to deal with the confusion, might help the researchers and professionals to elaborate more adequate educational systems, knowing when to present an intervention with the objective of regulating the student's confusion. When the tolerance time ends, an interface element can be shown as a support material, presenting the detailed explanation of the content. However, the confusion must be worked in a way that is not completely interrupted in the beginning, giving the student the opportunity to elaborate the answer in an individual way. Consequently, the elements of hypermedia must be presented according to the time that the student is feeling the confusion, given that when felt in the beginning, the hypermedia element must be less detailed, in order to enable the students to build their knowledge.

Related Works
Students often experience emotions during learning process. In a school environment, students constantly experience frustration, boredom and confusion (D'Mello and Calvo, 2013). Frustration and boredom are considered negative emotions, which distract students from learning. For example, boredom during classes causes distraction in students because they start to think about subjects unrelated to the content of the lesson. In addition to reducing attention, negative emotions can weaken learning and performing tasks (Turner and Schalkertlert, 2001). On the other hand, positive emotions, such as confusion, when experienced less intensely, can promote motivation, interest and memorization of the content. In addition, positive emotions help the student to use flexible, creative and profound learning strategies, such as relating the material learned to the material of other subjects, organizing the material and critical thinking (Dweck, 2013). However, the confusion felt very strongly is considered a negative emotion, which can impair learning, quickly leading the student to feel frustration and boredom (D'Mello and Calvo, 2013). Thus, it is important that educational systems are able to help students regulate their emotions.
There are several approaches to interacting at the interfaces of educational systems for the emotional regulation of students. As an example, Desseilles's (2016) study used "Serious Games" for regulation, in which the strategies of emotional regulation are based on Gross' theory (Gross, 1998).
In addition to the Serious Games approach, the emotion regulation strategy of Gross (1998) also grounds other works that use pedagogical agents and virtual reality to regulate learners' emotions. In the study of Bosse, Gerritsen, DeMan and Treur (2012), the pedagogical agent was used to assist the students in directing attention to elements presented in the interface if they felt bored. When there was a failure, the pedagogical agent supported the students to re-evaluate their current emotion using motivational messages. In the case of virtual reality, Nararro-Haro et al. (2016)'s study consisted in using the strategy of cognitive reappraisal by means of a mindfulness technique showing images with landscapes, in which it took the student to a state of relaxation.
Virtual reality was also used to cope with stressful situations through the theory proposed by Lazarus (1993). In Gaggioli et al. (2011)'s study, the users were exposed to a virtual world, providing immersion and experiencing stressful situations to learn to deal with their emotions and relax during moments of tension. In addition to the theory proposed by Lazarus (1993), the Meichenbaum stress inoculation training also utilizes relaxation methods (e.g., visualization of nature landscapes) so that the individual is able to handle a stress situation present in the virtual reality world (Pallavicini et al., 2013).
Alternatively, some studies adopt textual interaction to apply Computer Supported Collaborative Learning approaches, and a recommendation for emotional regulation (Tian et al., 2014;Xu, Du and Fan, 2013;Bakhtiar, Webster and Hadwin, 2018). Hence, based on collaborative work, individuals in a group, such as colleagues and instructors, could assist with feedback to other members who experienced stress and anxiety. In the recommendation approach, when the system detects frustration, a motivational message is displayed telling that making mistakes is common and part of the learning process.
We have realized that these works only considered the student's emotion at the time of the teaching-learning process for emotional regulation, without including individual aspects of each one, such as historical information, learning mindset or prior knowledge. Therefore, this article proposes an algorithm to support the emotional regulation of individuals according to their historical information.

Proposal
Our proposal for emotional regulation consists of a two-part algorithm. The first part refers to the length of time that a student takes to deal with a confusion emotion before it becomes frustration or boredom. This component of our model is based on the study (Reis, Alvares, Jaques and Isotani, 2018), that investigated the influence of students' personality traits and previous knowledge on how long students tolerate confusion. As presented in Section 2, the results suggested that the students who score high on neuroticism personality trait tolerated confusion for a shorter time, comparing to the students who score high on the extroversion personality trait. The confusion, when felt initially, indicates that the student is integrating all new information with his or her knowledge and existing abilities. When the confusion is felt for a long period (or deep confusion), the student can begin to feel frustration and boredom, resulting in the abandonment of the exercise or material that is being studied. Thus, the study of (Reis, Alvares, Jaques and Isotani, 2018) presented the average time that the learner who score high on neuroticism and extroversion traits could tolerate the confusion until the emotion become harmful to the learning.
From the identification of the tolerance time of the confusion by the student, our algorithm will propose the best hypermedia element to support the student's confusion (second stage). These elements can be text, figure, worked-example or video, in which each element of the support material detailing is being improved, in other words, the first element has fewer details than the last one.
To assist in choosing the most appropriate hypermedia element for the learners and provide customized emotional regulation, our proposal considers their historical information (emotion, exercise level, number of errors in the same exercise, number of requested hints, abandonment of the previous exercise, and number of abandoned exercises), where each item has a "priority" order to determines its influence which hypermedia element will be chosen. So, the higher the priority item, the more it impacts the choice of the hypermedia element. We consider four hypermedia elements types ordered by the level of information: text, figure, worked-example and video. The level of information in each element was based on the Theory of Multimedia Learning, proposed by Mayer (2003). This theory assumes that the human beings have the visual and auditory channels for the processing of information. Each of these channels must be explored in different and complementary ways, in order to not overload only one. In view of this, we assumed that the level of text detailing element offers less support to the student than an image or a video. The video is a hypermedia element that can explore both the auditory and visual channels and, therefore, present a more detailed content.
Consequently, these elements were chosen according to their level of information. As discussed earlier, confusion is beneficial when the students feel it for a short period of time, so the text element is introduced to students who are feeling the confusion at the beginning and allows them to create mental connections to resolve it. However, the longer they feel confusion, the more information of the studied content is necessary to help their confusion, and thus figures, worked examples and finally the video are presented. In our work, not only the time of confusion is considered for the choice of the element, but also their entire history of problem solving during the students' learning.
It is important to highlight that in the present work, the calculated rate of neuroticism and extraversion will make it possible to measure the tolerance time of confusion, before it becomes frustration and boredom. At the end of this time of tolerance, the element of hypermedia is presented to the students to help them solve their confusion.
The scheme of our intervention proposal is presented in Fig. 1.
To illustrate, a learner who is feeling confused and making several mistakes while solving a problem has a high chance of dropping out. Therefore, for each mistake made by this individual, the hypermedia element should be more informative (e.g., from text to figure), in order to minimize confusion and help his/her to solve the proposed exercise.
Section 5 presents a strategy of simulation that has the objective of choosing the most suitable hypermedia element to the student profile (listed in 1). The computational simulation is a strategy that involves the creation of an algorithm or computational system that represents a part of the real world and allows the results of its experiments to be a prediction of what will happen in reality. In the educational setting, the simulation can help in the prediction of the students' behavior patterns before putting it into practice, helping to not interrupt the curricular activities. The use of simulations allows testing a large amount of variables without disturbing the student's learning process, in addition to being able to simulate a large amount of students' profiles that are not possible to be used in the real world.

Simulation Strategy
Our proposal is based on simulated data that throughout this work are used and validated in a statistical model. Fig. 2 presents the steps of the simulation strategy: First to third steps generate the students' historical information database. The fourth and fifth steps perform the validation of this database. The first step consists of the gen-  eration of the students' data in a random way and according to the relevant characteristics registered by Tutoring System PAT2Math 4 (Jaques and Nunes, 2013;Morais, Silva, Reis, Isotani and Jaques, 2017). Table 1 describes the historical information collected from each individual to be used in both the simulation and the statistical model: The basic input configuration includes the number of individuals to be simulated (N) and possible emotions that these individuals can feel ( emotion = X � 2.6.2. Analysis of qualitative data Qualitative data were collected in the study as well as quantitative data. In the process, students were provided to fill out interview forms. Data collected through interview forms were reviewed under the themes and codes. The views of the students were coded by two researchers independently from each other for the reliability of the study using the formula ( ��������� �on�en��� + �i��en��� ) ( ��������� �on�en���+�i��en��� ) of Miles and Huberman (1994), and the consistency between encoders was calculated as .94. Two researchers came together and agreed on the remaining 6% difference. In addition, member control was done for the reliability of the research in the coding process. 0-Any positive emotion; 1-Confusion; 2-Frustration; 3-Boredom). In addition, the simulation is based on the four previously described ordered hypermedia elements (text, figure, worked-example and video). Other configurations of the exercises are:

Findings
n. ex = 10 emotion = X � f qualitative data were collected in the study as well as quantitative data. In the were provided to fill out interview forms. Data collected through ere reviewed under the themes and codes. The views of the students researchers independently from each other for the reliability of the ormula ( ��������� �on�en��� + �i��en��� ) ( ��������� �on�en���+�i��en��� ) of Miles and and the consistency between encoders was calculated as .94. Two together and agreed on the remaining 6% difference. In addition, s done for the reliability of the research in the coding process. : number of exercises to be solved by student. n. st = 5 n. ex = 10 emotion = X � f qualitative data were collected in the study as well as quantitative data. In the ere provided to fill out interview forms. Data collected through re reviewed under the themes and codes. The views of the students researchers independently from each other for the reliability of the rmula ( ��������� �onsens�s + �issens�s ) ( ��������� �onsens�s+�issens�s ) of Miles and and the consistency between encoders was calculated as .94. Two ogether and agreed on the remaining 6% difference. In addition, done for the reliability of the research in the coding process.

•
: number of steps for solving an exercise. level n. st = 5 n. ex = 10 emotion = X � ualitative data ere collected in the study as well as quantitative data. In the re provided to fill out interview forms. Data collected through reviewed under the themes and codes. The views of the students searchers independently from each other for the reliability of the ula ( ��������� �onsens�s + �issens�s ) ( ��������� �onsens�s+�issens�s ) of Miles and d the consistency between encoders was calculated as .94. Two ether and agreed on the remaining 6% difference. In addition, one for the reliability of the research in the coding process.
These settings mentioned above were based on the PAT2Math settings. For example, in this system, it is possible to register up to 4 levels of questions (basic, intermediate, advanced and specialist). The sequence of exercises is presented for students in the same sequence that they were registered by the system administrator.
During the simulation process, covariate values are iteratively generated, in which some decisions are randomly made, based on the simulated values of a standard uniform distribution, denoted by UNIF (1) level n. st = 5 n. ex = 10 emotion = X � 2.6.2. Analysis of qualitative data Qualitative data were collected in the study as well as quantitative data. In the , where 1 means that only one value will be simulated.
As a decision criterion, a value UNIF(1) level n. st = 5 n. ex = 10 emotion = X � 2.6.2. Analysis of qualitative data simulated from the uniform distribution is compared with a predetermined probability value PAT2Math is a web-based intelligent tutor system that assists students (minimal feedback, error feedback, and hints) while solving, step-by-step, first-degree equations. Available at http://pat2math.unisinos.br Table 1 Covariates considered for emotional regulation Covariates Description Exercise level x 3 Number of errors in the same exercise x 4 Number of hints requested x 5 Abandonment of the previous exercise x 6 Number of abandoned exercises In order for the simulation to be as realistic as possible, we have previously defined maximum values that some covariates may assume. For instance, the number of errors in the same exercise 3 5 ← 0 5 ← 1 ), otherwise no intervention will be triggered. Thus, Algorithm 1 presents our proposal to simulate covariates of performance and emotion for individuals. COUNT ABANDONMENT: 6 ← 6 + 5 6: INITIALIZE: 3 ← 0 4 ← 0 7: for ( = 1: . ) do 8: Once all covariates (historical information) of each individual are defined, the second step is to set values for coefficients ( ′ Algorithm 1 Simulation strategy of performance and emotion for regulation analysis. ) of each covariate (listed in Table 1).
The coefficients refer to the weights of each item from the individual historical information, where commonly higher values have a greater influence on the choice of hypermedia element, as discussed in Section 4. We define the coefficients based on weights that we want to give for each covariate, so 1 = 10 ′ Algorithm 1 Simulation strategy of performance and emotion for regulation analysis.
seems to have more influence than the other coefficients, it is worth remembering that the covariate 5 UNIF(1) level n. st = 5 n. ex = 10 emotion = X �

Analysis of qualitative data
Qualitative data were collected in the study as well as quantitative data. In the process, students were provided to fill out interview forms. Data collected through interview forms were reviewed under the themes and codes. The views of the students were coded by two researchers independently from each other for the reliability of the study using the formula ( ������� � �onsens�s + �issens�s ) ( ������� � �onsens�s+�issens�s ) of Miles and Huberman (1994), and the consistency between encoders was calculated as .94. Two researchers came together and agreed on the remaining 6% difference. In addition, member control was done for the reliability of the research in the coding process. (abandonment of the previous exercise) only takes values 0 or 1, i.e., this weight only has influence when the individual abandoned the previous exercise.

Findings
The third step is to simulate the response variables (interventions) that will be explained by these covariates. In other words, we must simulate the hypermedia element that will be chosen, given the obtained covariates. To do this, we used an ordinal logistic regression (Agresti, 2010), more specifically, it is a proportional odds model, also known as a cumulative logit model (third step). The choice of the model is because the variable answer is ordinal (basic, intermediate, advanced and expert) and because the interventions are sorted (e.g. text, figure, worked-example and video). The implementation of this model is available on the R-package 6 = 2 5 = 20 4 = 5 3 = 6 2 = 7 1 = 10 ′ Algorithm 1 Simulation strategy of performance and emotion for regulation analysis.
The results indicate that the proposed model has a high success rate (over 90%) for classification in all scenarios, and a small standard deviation, which indicates good accuracy. Remembering that this result is obtained from the information predicted on the fifth step of the adjusted model (on other words, ′ * = [ ( ≤ | )] = + , = 1, 2, 3 * . 6 = 2 5 = 20 4 = 5 3 = 6 2 = 7 1 = 10 ′ Algorithm 1 Simulation strategy of performance and emotion for regulation analysis.
1: for ( = 1: ) do 2: INITIALIZE: 5 ← 0 and 6 ← 0 3: SELECT EXERCISE LEVEL: 2 ← ( ) 4: for ( = 1: . ) do 5: COUNT ABANDONMENT: 6 ← 6 + 5 6: INITIALIZE: 3 ← 0 4 ← 0 7: for ( = 1: . ) do 8: COUNT ABANDONMENT: 6 ← 6 + 5 6: INITIALIZE: 3 ← 0 4 ← 0 7: for ( = 1: . ) do 8: SELECT EMOTION: 1 ← ( 9: if ( (1) > 3 and 3 < . ) then 10: 3 ← 3 + 1 11: end if 12: if (  COUNT ABANDONMENT: 6 ← 6 + 5 6: INITIALIZE: 3 ← 0 4 ← 0 7: for ( = 1: . ) do 8: if ( 1 > 0) then in the simulation process adequately mimics reality in order to choose different elements depending on historical information, Table 4 shows an example with 25.000 simulated individuals and the classification of their interventions. Note that hypermedia elements are intuitively distributed, where the largest numbers of elements are concentrated on the first two types (Text and Figure), while the Video element presents a lower frequency, which corresponds to a lower need for extremely informative intervention. Analogous to Table 3, the above classification example also achieves a high success rate (92.44%) based on the 30% of the test sample in a configuration with 25.000 simulated individuals. It is worth noting that the diagonal of Table 4 expresses the number of hypermedia elements correctly estimated and, even when our model chooses a wrong element, it is never far from the correct answer. For instance, the statistical model chooses correctly 52.485 times the text element and chooses wrongly 2.721, where the figure was chosen, what shows a good robustness even when the chosen elements is not the correct one.

Algorithm
With the statistical model presented on Section 5, it was possible the development of an algorithm for the student's emotional regulation. The algorithm for the choice and presentation of hypermedia elements involves two parts: the first part consists in identify the most suitable moment to present the hypermedia element (discussed on the study of Reis, Alvares, Jaques and Isotani, 2018) and the second part consists in selecting the most suitable element according to the history of resolution of the student in the platform (presented on the section 5). The Fig. 3 presents the internal functioning of the algorithm.
The Fig. 4 presents the code to the calculation of the time that a student with a certain profile is able to tolerate felling the confusion (presented in Reis, Alvares, Jaques and Isotani, 2018).
The Fig. 5 presents the calculation of the type of hypermedia element that will be presented to the student. This calculation was descripted in the Section 5, and uses the information about the current emotion of the student (x 1 ), level of current exercise (x 2 ), quantity of mistakes in the same exercise (x 3 ) quantity of times that the tip was accessed (x 4 ), verify if the previous exercise was abandoned (x 5 ) and, the quantity of abandoned exercises (x 6 ). By the end, these variables are multiplied by their coefficients and summed up to determine which intervention (i.e. figure, text or video) is the best to present for the student.

Conclusion
The ability to regulate and transform negative emotions into positive ones is one of the conditions for the learning process to occur in Algebra. Hence, this article proposes an approach of emotional regulation through a statistical model, in which individual aspects are taken into account, including the possibility of incorporating different personality traits. The used data are simulated using an intuitive strategy of our own. Thus, our algorithm chooses the best hypermedia element based on characteristics of simulated individuals. In addition to the variables used that influence the choice of the hypermedia element described in Table 1 of Section 5 (Simulation Strategy), other useful information could also be used in the model for emotional regulation, such as the amount of time spent in an exercise. However, this work is a generic simulation study and that for real contexts in addition to the variables described, others could be considered.
The proposed statistical model presented high success rates (over 90%) in the choice of types of elements for different simulated scenarios. Furthermore, our simulation strategy was also consistent with what is expected of real data in this context, although there are no previous studies that guarantee such similarity. In this sense, the big challenge of using a database from a real study is the difficulty of getting the correct hypermedia elements and then contrasting them with methodological proposals. Therefore, the use of simulated data can be considered a limitation, as it may not reflect the real setting. In addition, some variables, such as the amount of time spent in an exercise, could influence the choice of hypermedia elements.
In conclusion, the proposed algorithm is capable of suggesting the tolerance time of the student's confusion and present hypermedia elements as support material. These elements are adapted according to the evolution of the student inside the PAT2Math, with the objective of not providing hints and support material in an unnecessary way. S. Isotani is a Professor of Computer Science and Learning Technology at the Institute of Mathematics and Computer Science of the University of São Paulo, Brazil. Before joining the University of São Paulo, Prof. Isotani worked as a research fellow associated with the Human-Computer Interaction Institute at Carnegie Mellon University, USA. His research career has been devoted to imagine, design, develop, test and deploy intelligent and collaborative educational systems. Currently, together with the Brazilian Ministry of Education, he is working on evidence-based public policies related to educational technologies. His mains research interests are in the areas of gamification, ontological engineering, Computer-Supported Collaborative Learning (CSCL), Artificial Intelligence in Education (AIED), and technology-enhanced learning.