Introduction

Learning a second/foreign language (L2) is a complex process that involves various factors, including socio-cultural, linguistic, and psycho-emotional factors, which influence language acquisition (Derakhshan, Dewaele, et al., 2022; Derakhshan, Fathi, et al., 2022; Derakhshan, Greenier, et al., 2022; Solhi et al., 2023; Wang et al., 2022). These factors include but are not limited to age, gender, motivation, learning style, language aptitude, proficiency level, and cultural differences, (Dörnyei, 2014; Ehrman et al., 2003). Additionally, recent research has highlighted the significance of psycho-emotional variables in language learning, such as positive and negative emotions, grit, and foreign language enjoyment (FLE) (Derakhshan, 2022; Derakhshan, Solhi, et al., 2023; Derakhshan, Dewaele, et al., 2022; Derakhshan et al., 2021; Gregersen & MacIntyre, 2021; Wang, 2023; Wang et al., 2021).To succeed in L2 education, teachers and students should focus on positive feelings instead of overestimating negative emotions (Gregersen & MacIntyre, 2021). This shift toward positivity helps students manage the inherent challenges of acquiring another language (MacIntyre et al., 2019). Moreover, the way EFL/ESL students diligently try to obtain their goals, makes them gritty and successful (Duckworth, 2016). Grit is a spiritual variable related to intrinsic motivation, which affords the required passion and will to reach goals in academia (Duckworth & Quinn, 2009). It has been found effective in psychology, general education, L2 education, medicine, and business domains (Keegan, 2017).

Furthermore, in online education, students’ grit and engagement in the classroom need more consideration by educators (Derakhshan, Dewaele, et al., 2022; Derakhshan, Fathi, et al., 2022; Derakhshan, Greenier, et al., 2022). The sudden shift toward e-education created many challenges for L2 educators (Derakhshan et al., 2021). Consequently, it is essential to involve students in classroom activities (Dewaele & MacIntyre, 2016). In doing so, the role of FLE is prominent. FLE is a complicated emotion, which pushes learners into action and maximizes their motivation despite difficulties (Dewaele & MacIntyre, 2016). It is obtained when students’ needs are satisfied and new things are learned in the class (Dewaele & MacIntyre, 2014). Additionally, students’ academic engagement and enjoyment may be affected by technologies and the rate of familiarity with facilities (Bond & Bedenlier, 2019). While research on the role of students’ grit and FLE in L2 education is increasing, their predictive power in online learning has been largely unexplored, and other factors may also impact students’ grit, enjoyment, and engagement. One such factor is online learning self-efficacy (OLSE), which is crucial in remote education (Han & Geng, 2023; Yavuzalp & Bahcivan, 2020). Self-efficacy is one’s judgment of his/her abilities to do a task (Bandura, 1977). In online settings, self-efficacy is significant since students are facing a new mode of education. OLSE has been found to determine students’ degree of learning in online learning contexts (Zimmerman & Kulikowich, 2016).

Most of the studies on OLSE have focused on the technology components of the construct (Alqurashi, 2016), its measurement scales (Yavuzalp & Bahcivan, 2020), and its underlying dimensions (Shen et al., 2013). Nevertheless, its interaction with student-related psycho-emotional factors has been overlooked. In an exploratory study, Shen et al. (2013) found that OLSE predicts students’ online learning satisfaction. However, the moderating role of this construct in producing positive emotions in students in L2 contexts is left uncharted, to date. To fill this gap, the current study aimed to examine the possible moderating role of OLSE in the interplay of grit, FLE, and online student engagement.

Literature Review

The Concept of Grit

As a non-cognitive factor, grit has a fundamental role in education by driving one to work industriously toward long-term goals with passion and interest (Duckworth et al., 2007). It is a mixture of ‘perseverance of effort’ and ‘consistency of interest’ (Duckworth & Quinn, 2009). For Duckworth and Quinn (2009), grit is a personality feature beyond motivation, while Credé et al. (2017) perceive it as conscientiousness. In contrast to many psycho-emotional variables involved in education that are context-specific and evolving, grit hardly changes across contextual shifts (Reed et al., 2013). Grit has two facets, namely perseverance in effort and persistence of interests, which have strong correlations with students’ academic success and performance (Duckworth et al., 2007).

The Importance of Grit in L2 Education

Grit has a prominent place in L2 education owing to the complexities that feature in learning a foreign language (Derakhshan, Solhi, et al., 2023; Keegan, 2017). Mainstream education and L2 education have shifted from basic reading and writing skills toward more complex abilities such as critical thinking, problem-solving, and effective communication (Horn, 2013). This requires gritty students, who stand against setbacks (Taşpinar & Külekçi, 2018). Teachers are no longer simple presenters of knowledge, but active agents, who produce gritty and tough students (Duckworth et al., 2010). Grit promotes academic performance, hope, trust, learning motivation, resilience, and success rate (Keegan, 2017; Taşpinar & Külekçi, 2018; Xu, 2022). Furthermore, grit is contended to afford persistent energy, passion, motivation, desire, self-discipline, and self-control for L2 learners (Duckworth & Gross, 2014; Li & Yang, 2023). It can also incur achievement and problem-solving skills after graduation (Taşpinar & Külekçi, 2018). Grit may also interact with enjoyment in virtual contexts as explained below.

Foreign Language Enjoyment (FLE)

As a relatively new construct in the field of SLA research, FLE is concerned with the positive emotions and attitudes that learners experience when using or learning a foreign language (Dewaele & MacIntyre, 2014; Dewaele et al., 2018). It is considered an important factor in language learning, as it can lead to higher motivation, willingness to communicate, and ultimately, better learning outcomes (Botes et al., 2022). FLE has two underlying dimensions; private enjoyment (PE) and social enjoyment (SE) (Dewaele & MacIntyre, 2016; Jiang & Dewaele, 2019). PE is concerned with the enjoyment learners experience in private settings, such as reading a book or watching a movie in the target language. SE, on the other hand, pertains to the enjoyment that learners experience when communicating with others in the target language, such as in a conversation or group discussion. FLE has been found to be positively associated with motivation, anxiety, learning achievement, and grit in L2 learning (Botes et al., 2022; Dewaele & MacIntyre, 2016; Fathi & Mohammaddokht, 2021; Jin & Zhang, 2021; Li, 2020). Furthermore, recent studies in the field of EFL learning have shown that teacher factors can be closely related to how learners experience FLE (Derakhshan, Zhang, et al., 2023).

Foreign Language Engagement in Online Settings

After the COVID-19 pandemic, many educational centers shifted toward remote instruction. However, this sharp transition created different challenges for L2 educators (Gao & Zhang, 2020). Other than technological challenges like internet access, technophobia, willingness to participate in virtual contexts, and required platforms to run a new mode of delivery, EFL/ESL students faced several psych-emotional complications (e.g., anxiety, boredom), too (Derakhshan et al., 2021). Another area that this shift could influence was students’ engagement in online classrooms (Côté & Gaffney, 2021). In online settings, foreign language engagement is critical because L2 students are physically distant from their classmates and teachers (Dixson, 2015). The concept refers to students’ active engagement in L2 classes by thinking about the content of the relevant subject and talking and interacting with others (Dixson, 2015). Research shows that students’ planning and perseverance affect their engagement in online classes (Barrett & Liu, 2019; Finn & Zimmer, 2012). Although researching the construct of engagement has recently flourished, its trace in online L2 education is left unaddressed.

Online Learning Self-efficacy

Self-efficacy is a factor that determines students’ academic success in varying contexts (Bandura, 1977). Its significance enhances in challenging and new learning contexts like online education (Cho et al., 2010). Since the self-efficacy of students are the cornerstones of their success in online education, in some contexts, low self-efficacy may cause dropout (Lee & Choi, 2011). Self-efficacy is context-sensitive and in online education, three aspects must be considered by educators including technology, learning, and interaction to improve education (Shen et al., 2013).

OLSE includes six dimensions related to (1) online course completion, (2) peer interaction, (3) teacher interaction, (4) self-regulation, (5) course management system, and (6) socialization with peers (Shen et al., 2013). Additionally, Zimmerman and Kulikowich (2016) proposed three dimensions to OLSE, namely time management, online learning, and technology use. Operationally, OLSE is defined as L2 students’ perceived ability to learn and accomplish tasks in online settings. It can be affected by several personal, emotional, cognitive, contextual, and social variables (Cho & Kim, 2013).

Related Studies

Given the popularity of PP constructs and online education, several empirical and theoretical studies have been done on their interface. Concerning L2 students’ grit, correlational studies reveal that grit predicts well-being, success, satisfaction, willingness to communicate (WTC), achievement, resilience, engagement, and enthusiasm (Fathi et al., 2021; Jin & Kim, 2017). In a recent study, Xu (2022) argued that L2 students’ grit is facilitated by teachers’ hope and trust. Furthermore, Wu et al. (2022) identified a positive correlation between grit and EFL students’ performance. Similarly, Kiatkeeree and Ruangjaroon (2022) explored the relationship between grit and the online engagement of 563 EFL students. The results demonstrated a positive association between grit and students’ achievement and engagement level in online education.

Regarding FLE, research shows that enjoyment produces motivation, WTC, achievement, and grit (Botes et al., 2022; Li, 2020). Moreover, the relationship between grit and engagement can be influenced by students’ perceived self-efficacy in online learning (Shen et al., 2013). Along the same line, Womble (2008) found a positive linkage between online self-efficacy and satisfaction in training courses. Moreover, the role of gender, academic status, and previous experiences in determining the OLSE of students has been approved (Artino & Stephens, 2009; Cho & Kim, 2013).

After reviewing the literature, it is clear that several studies have demonstrated the significance of FLE as a predictor of language learning achievement, motivation, and engagement. Similarly, L2 grit has been found to be associated with persistence and resilience in language learning. Additionally, OLSE has been identified as a critical factor in promoting engagement in online learning environments. While the constructs of concern in this study have been explored separately, their interplay in online contexts has been overlooked. Unveiling the role of self-efficacy in shaping other psycho-emotional constructs (e.g., grit, engagement) in online L2 education is also critical to enhance the quality of e-teaching and e-learning. Spurred by these gaps, this study aimed to examine the moderating role of OLSE in the bond among grit, foreign language engagement, and online student engagement. In light of the theoretical and empirical literature, the following hypotheses are formulated:

H1

L2 grit predicts online learning engagement. Since grit is a key factor in determining success in overcoming challenges and maintaining interest in L2 learning (Duckworth et al., 2010; Li & Yang, 2023; Taşpinar & Külekçi, 2018) and online learning can be challenging for many students, we hypothesize that students with higher levels of L2 grit will be more engaged in online learning.

H2

FLE affects online learning engagement. In light of some studies which have found that motivation and enjoyment are key factors in predicting engagement in online learning activities (Deng et al., 2022; Guo, 2021; Luo et al., 2023), it is warranted to assume that individuals who enjoy learning a foreign language will be more engaged in online learning activities related to that language.

H3

Online learning self-efficacy affects online learning engagement. Empirical studies have found that self-efficacy is a significant predictor of engagement and achievement in online learning (Han & Geng, 2023; Han et al., 2021; Kuo et al., 2021), which supports this hypothesis.

H4

Online learning self-efficacy mediates the relationship between L2 grit and FLE with online learning engagement. The rationale for this hypothesis is that self-efficacy may be a mechanism through which both L2 grit and FLE affect online learning engagement. Specifically, individuals with higher levels of L2 grit and FLE may have higher levels of online learning self-efficacy, which in turn leads to increased engagement in online learning activities. Empirical studies have found that self-efficacy mediates the relationship between various constructs and academic achievement (Neroni et al., 2022), which supports this hypothesis.

Method

Participants

In this study, the participants were 578 intermediate-level EFL learners recruited from two state universities in Iran. The universities offered online English language classes to students at different proficiency levels. The participants were selected based on their proficiency level, which was determined by a placement test. The inclusion criteria for the study were being an intermediate-level EFL learner and currently enrolled in an online English language course.

A convenience sampling method was used to recruit the participants. Announcements were made in online English language classes, and invitation emails were sent to eligible students who met the inclusion criteria. The participants who agreed to participate in the study provided their informed consent before completing the online questionnaire. The sample consisted of 322 females and 256 males with an age range of 18 to 30 years (M = 22.5, SD = 2.8).

Instruments

FLE Scale

The level of FLE of participants was evaluated using 10 items adapted from Jiang and Dewaele's (2019) scale. This scale measures the private enjoyment (PE) and social enjoyment (SE) aspects of the construct. Respondents rated the items on a 5-point Likert scale ranging from 1 (‘not at all’) to 5 (‘very much so’). An example of an item from this scale is “I enjoy learning English.”

L2 Grit

To assess the participants’ level of L2 grit, a 10-item scale developed by Lee (2020) was used. The scale measures participants' perseverance of effort (POE) and consistency of interest (COI) in achieving their long-term goals related to learning English. Each item is rated on a 5-point Likert scale, ranging from 1 (‘not like me at all’) to 5 (‘very much like me’).

Online Student Engagement

For the present study, a 22-item questionnaire developed by Hoi and Le Hang (2021) was utilized to measure online student engagement. The questionnaire used a five-point Likert scale and consisted of four subscales: Behavioural engagement (BE), Cognitive engagement (CE), Affective engagement (AE), and Social engagement (SE). Four items were used to measure each subscale, with BE measuring students' active participation and positive behaviors, CE measuring cognitive investment, AE measuring emotional reactions, and SE measuring the quality of an effort to maintain relationships with classmates and teachers.

Online Learning Self-Efficacy Scale (OLSS)

For this construct, Tsai et al.’s (2020) scale was used, which consists of 25 items assessing five components: (1) Self-efficacy to complete an online course (S1), (2) Self-efficacy to interact socially with classmates (S2), (3) Self-efficacy to use tools in a Course Management System (CMS) (S3), (4) Self-efficacy to interact with instructors in an online course (S4), and (5) Self-efficacy to interact with classmates for academic purposes (S5). Respondents used a 5-point Likert scale to indicate their level of agreement with each item, ranging from 1 (strongly disagree) to 5 (strongly agree).

Procedure

During a single session, participants were requested to complete four scales, namely foreign language enjoyment, L2 grit, online learning self-efficacy, and online learning engagement, which took approximately 30 min. A link to the online survey, along with a brief introduction to the study, was sent to the participants via email. The participants were instructed to complete the scales honestly and to the best of their ability. They were informed of the purpose of the study and their right to withdraw from the study at any time without any penalty. To ensure informed consent, written consent forms were obtained from the participants. The researchers assured the participants that their responses would remain confidential and would only be used for research purposes.

Analytic Procedure

SPSS 22 and AMOS 23 were used to conduct data analysis. A two-stage approach for structural equation modeling (SEM) was used, which included testing the measurement and structural models (Kline, 2023). To assess the goodness of fit for the hypothesized model, different fit indices were examined. The researchers also used the Expectation–Maximization algorithm, Z scores, and Mahalanobis D2 to address missing data and identify outliers, respectively (Tabachnick et al., 2013). Additionally, they examined the skewness and kurtosis indices to identify non-normal data. After conducting the initial screening, 12 cases were excluded from the analysis.

Results

Testing the Measurement Model

The construct validity of the scales was examined by testing the measurement model and goodness of fit indices. Modifications were made to improve the model’s fit, including removing certain items with low factor loadings and drawing correlational paths for error terms. The final models showed an acceptable fit to the data (see Tables 1 & 2). The scales demonstrated adequate internal consistency with alpha values greater than 0.70. Descriptive statistics and correlations were calculated for all the constructs (see Table 3).

Table 1 Measurement model of the latent variables
Table 2 Factor Loadings, Standard Errors, t-Values, and R2 for the Measurement Model
Table 3 Descriptive statistics and correlations

Testing the Structural Model

After confirming the measurement model, structural models were examined. The hypothesized partial mediation model (Model P) was compared with the full mediation model (Model F) and an alternative direct model (Model D). Table 4 displays the fit indices of all three competing structural models. Based on the SEM values obtained, the fit indices of the partial mediation model (Model P) were significantly better than those of Model F (Δdf = 3, Δχ2 = 33.78, p < 0.001) and Model D (Δdf = 5, Δχ2 = 98.85, p < 0.001). Therefore, the partial mediation model (Model P) was selected as the most concise model specifying the connections among latent constructs.

Table 4 Results of fit indices of structural models

Figure 1 shows the final partial mediation model's path estimates. All path coefficients were significant, except for the path from L2 grit to online engagement. The structural model showed that online engagement was significantly influenced by FLE (β = 0.32, p < 0.001), while L2 grit had a significant impact on OLSE (β = 0.28, p < 0.01). Additionally, OLSE directly affected online engagement (β = 0.55, p < 0.001), and FLE had a significant effect on OLSE (β = 0.34, p < 0.001).

Fig. 1
figure 1

The final mediation model

The researchers employed Baron and Kenny’s (1986) method to investigate whether OLSE acted as a mediator between the constructs. The results from the direct model (see Table 5) revealed significant path coefficients for FLE and L2 grit on online engagement (FLE-engagement: 0.35, p < 0.001; L2 grit-engagement: 16, p < 0.05), indicating the first step of Baron and Kenny’s test was met. In the full mediation model, the path coefficient between grit and FLE on OLSE was also found to be significant (FLE-OLSE: 0.37, p < 0.001; grit-OLSE: 0.31, p < 0.001), satisfying the second requirement of Baron and Kenny’s method. Finally, the partial mediation model showed that FLE had a significant direct effect on engagement (β = 0.32, p < 0.001). Furthermore, along with the indirect effect of OLSE, FLE significantly influenced engagement− 0.16 (0.34 × 0.55), which was less than the direct effect (0.18 < 0.32) of FLE on engagement. This result indicated that OLSE partially mediated the relationship between FLE and engagement. The study also revealed that L2 grit had an insignificant effect on engagement. However, OLSE acted as a full mediator between L2 grit and engagement (0.28 × 0.55 = 0.15 > 0.10). Thus, the impact of L2 grit on OLSE contributed to enhancing online engagement.

Table 5 Path estimates of the structural model

Finally, to investigate common method bias, Harman’s single factor test was performed as recommended by Podsakoff and Organ (1986). All the indicators of the four constructs (CSE, mindfulness, boredom, and FLE) were included in the maximum likelihood extraction method. Results showed that the first factor explained only 26.17% of the variance, which is lower than the 50% criterion. Thus, it can be inferred that the common method bias was not a significant issue in this study.

Discussion

This study investigated the relationships among FLE, online learning self-efficacy, L2 grit, and online learning engagement among EFL learners. The findings provide insights into the importance of learner motivation and self-efficacy beliefs in online learning settings. Firstly, the results revealed that FLE positively affected online learning engagement. This finding is consistent with previous research that suggests that positive affective factors like enjoyment influence online learning engagement (Artino, 2012; Deng et al., 2022; Guo, 2021; Luo et al., 2023). FLE has been shown to promote language learning motivation and engagement (Dewaele & MacIntyre, 2014), and our study extends this finding to the online learning context. In online learning, FLE may be particularly important since it can counteract some of the negative aspects of online learning, such as isolation, lack of social interaction, and the absence of face-to-face communication (Simamora, 2020). Students, who enjoy learning a foreign language may be more likely to engage in online learning activities, such as participating in discussion forums, completing online assignments, and seeking out additional learning resources. When learners experience positive emotions and attitudes towards online L2 learning, they are more likely to participate in activities, interact with peers and instructors, and persist in their language learning journey.

Secondly, our study found that online learning self-efficacy positively affects online learning engagement, which is consistent with previous research (Han & Geng, 2023; Han et al., 2021; Kuo et al., 2021). This finding is consistent with Bandura’s (1989) social cognitive theory. According to this theory, individuals' beliefs about their capabilities to perform specific tasks, also known as self-efficacy beliefs, influence their behavior, motivation, and learning outcomes. Self-efficacy beliefs are predictors of academic achievement and engagement (Bandura, 1977). They are also essential in online learning contexts (Artino & Stephens, 2009; Zimmerman & Kulikowich, 2016). From this perspective, students, who believe in their ability to succeed in online learning are more likely to engage in learning activities. Therefore, learners should be provided with appropriate resources and training to enhance their online learning self-efficacy beliefs and generate online learning engagement.

Finally, it was found that L2 grit did not have a direct effect on online learning engagement but influenced it through the mediation of online learning self-efficacy. From a social cognitive theory (Bandura, 1989) perspective, individuals with higher levels of self-efficacy tend to have better performance and persistence in the face of challenges. In the online learning setting, learners with high levels of self-efficacy may be more likely to engage in online learning activities and persist in the face of obstacles, leading to heightened engagement. This finding is partially in line with Sukmana et al. (2021) who found that grit indirectly affected learners’ academic achievement via the mediation of online learning. Although success in online learning requires consistent interests and perseverant efforts (Lee & Hsieh, 2019), our findings indicated that a lack of perceived competencies in online contexts might hinder goal accomplishment even among grittier learners. It can be implied that grit may be context-sensitive for EFL learners. That is, gritty EFL learners become more engaged in online learning if they are endowed with self-efficacy perceptions in online learning contexts. EFL learners might face some unexpected challenges in online learning such as role and responsibility changes, unfamiliarity with technology devices, and new interpersonal relations which gritty learners may not overcome unless they possess some online learning self-efficacy.

However, the extracted mediation model suggests that L2 grit can enhance learners' self-efficacy beliefs by fostering their sense of mastery experiences, self-regulation, and perseverance in the face of obstacles. In turn, enhanced self-efficacy beliefs can increase learners’ engagement in online learning activities. This is in line with previous research that found self-efficacy mediating between grit and achievement (Jiang et al., 2021; Li & Yang, 2023; Neroni et al., 2022). This finding underscores self-efficacy beliefs in promoting engagement and achievement in online contexts (Alemayehu & Chen, 2021). Greater online self-efficacy helps EFL learners to devote greater efforts, time, and consciousness concerning online learning tasks (Tsai et al., 2020), thereby fostering their online student engagement.

Overall, this study highlights the complex interplay between motivational constructs such as L2 grit, self-efficacy beliefs, and engagement in online language learning. It adds to the existing literature by providing empirical evidence for the role of online learning self-efficacy as a mediator of the relationship between L2 grit and online learning engagement. However, there are some limitations to this study that need to be considered. One limitation of this study is its focus on a specific group of Iranian EFL learners, which may limit the generalizability of the findings to other populations. Future research could aim to replicate this study with different populations and investigate potential cultural differences in the relationships among these variables. A second limitation is a reliance on self-reported measures, which may be susceptible to biases and not accurately reflect participants' actual engagement in online learning activities. Future research could incorporate objective measures, such as tracking participants' online activity and performance, to assess online learning engagement. Finally, this study used a cross-sectional design, which limits the ability to infer causality from the findings. Future studies could employ longitudinal or experimental designs as well as innovative approaches to delve into the complex nature of these variables (Derakhshan, Wang, et al., 2023) to establish causal relationships among FLE, L2 grit, OLSE, and online learning engagement.

Conclusions

This study examined the interplay among FLE, L2 grit, OLSE, and online learning engagement among Iranian EFL learners. The results revealed that FLE and OLSE had a significant positive impact on online learning engagement. Moreover, it found that L2 grit indirectly affected online learning engagement through the mediation of OLSE. However, L2 grit did not affect online learning engagement. Overall, the findings highlight the importance of FLE and OLSE in promoting online learning engagement among EFL learners. Having underscored the significance of creating a positive and enjoyable learning environment, providing learners with resources and training to enhance their online learning self-efficacy beliefs, and promoting L2 grit as a way to enhance online learning engagement, this study provides insights that can inform the development of effective online language learning programs.

Considering theoretical implications, the study extends the literature on the relationships among FLE, L2 grit, OLSE, and online learning engagement by highlighting the indirect effect of L2 grit on online learning engagement through OLSE. Moreover, the study provides insights into the role of FLE and OLSE in promoting online learning engagement. The findings can be used to inform future research on the factors that influence EFL learners’ online learning engagement. Practically, the findings have implications for EFL teachers and educators, who design and implement online language learning programs. The study suggests that educators and course designers should focus on creating a positive and enjoyable learning environment, providing learners with resources and training to enhance their online learning self-efficacy beliefs, and promoting L2 grit as a way to enhance online learning engagement. Therefore, educators should consider incorporating these strategies into their online language learning programs to foster a more effective and engaging learning experience for EFL students.

In light of the study's findings, there are several implications for future research to consider. First, although this study explored the relationship between FLE, L2 grit, OLSE, and online learning engagement, future research may investigate the potential influence of other variables, such as motivation or learning styles, on these constructs. Additionally, further research could investigate the effectiveness of specific interventions aimed at enhancing OLSE and promoting L2 grit in online language learning contexts.