1 Introduction

There has been a global revival of integrating programming into the K-12 curriculum (Tikva & Tambouris, 2021), since Wing (2006) highlighted the importance of adding computational thinking (CT), a cognitive skill that draws concepts from computer science, into every child’s skillset. Programming is defined as a process by which people develop a series of procedures to instruct and communicate the computers to perform tasks accurately (Buitrago Flórez et al., 2017), which includes but is not limited to formulating problems and writing codes (Zhang & Nouri, 2019). Programming is considered the core approach to developing students’ CT skills, which can transform the young generation from technology consumers to technology producers (Grover & Pea, 2013). This is evidenced in a meta-analysis synthesizing 105 studies with 539 effect sizes (Scherer et al., 2020). Moreover, programming is seen as a tool to develop disciplinary knowledge in computer science and is related to a wide range of cognitive skills, such as problem-solving and algorithmic thinking (Buitrago Flórez et al., 2017). Therefore, programming education has been taught to a younger population as a means of initiating cognitive development starting at earlier ages (Buitrago Flórez et al., 2017), highlighting the significance of understanding young learners’ programming environment (PE) acceptance for programming learning. More specifically, PE refers to the learning environment afforded by the programming tools for learners to perform programming tasks and develop programming skills (Cheng, 2019; Xu et al., 2019).

The development of PE embraced a growing diversity of programming modalities, typically including text-based programming, graphical programming, and tangible programming (Weintrop & Wilensky, 2018). Conventionally, novices learn programming in a text-based modality, which may cause cognitive loads and challenges dealing with complex programming concepts (Xu et al., 2019). To accommodate various needs of novice learners, the emerging programming modalities share the common characteristics of “low floor, high ceiling”, which enables novice learners to construct programming artefacts at a low beginning threshold, and also allows advanced learners to use the extensive and powerful functions (Grover & Pea, 2013). Such examples are block-based graphical programming, which simplifies the process of writing codes into dragging and snapping the command blocks (Lye & Koh, 2014), and robotic programming, which makes use of the tangible building blocks or robots to concretize the programming process (Çınar & Tüzün, 2021). Different PE afforded novices to learn programming with different modalities and thus induced different learning interactions. PE use was found to influence students’ programming practice (Weintrop & Wilensky, 2018) and learning motivation (Çınar & Tüzün, 2021). However, relatively limited studies were conducted to understand the main drivers and boundary conditions of PE use to facilitate programming learning.

Primary school students’ use of various PE is a complex and inherently social process resulting from the interplay of personal, environmental, and behavioral influences, yet there is very limited evidence of the essential motivations and the potential boundary conditions in which the interrelationships between motivators may comply. Existing social psychological theories pinpoint that the relationships between motivations and a specific (type of) human behaviors can only comply by considering the boundary conditions corresponding to the situated context, indicating people who vary in these conditions may form different behavior-relevant beliefs, attitude, and intention (Ajzen & Fishbein, 1980; Bandura, 1986; Fishbein & Ajzen, 2011). Therefore, this study explored the critical determinants and extended the boundary conditions to include not only the personal and environmental moderators, but also the behavior-relevant moderators affecting primary students’ PE acceptance in the programming education context. The specific objectives are to (1) propose a theoretical model to examine the critical determinants that affect primary students’ acceptance of PE, (2) identify the potential personal, environmental, and PE use-relevant moderators and explore their moderating effects on the proposed relationships. Hence, this study collected representative survey data from primary school students. The large-scale survey data was then analyzed using the structural equation modelling (SEM) approach to identify the critical determinants and their relationships in determining students’ PE acceptance and using the multigroup SEM approach to examine the variations that exist in the proposed relationships across different personal, environmental and PE use-relevant boundary conditions.

2 Theoretical framework and hypotheses

In this study, the social cognitive theory (SCT) and the theory of planned behavior (TPB) were employed together with the technology acceptance model (TAM) to formulate a research model to examine the interrelationships of determinants influencing primary students’ behavioral intention to use PE and to explore the moderating effects of potential personal, environmental, and behavioral factors on the hypothesized relationships. The integrated model was presented as Fig. 1.

Fig. 1
figure 1

The research model

2.1 Theoretical underpinning

The SCT theorized human functioning as the interaction among personal, environmental, and behavioral influences (Bandura, 1986). According to Bandura’s reciprocal determinism theory, the personal determinants are mainly manifested in the forms of cognition and affect, and the focal determinants are behavioral intention and perceived self-efficacy (Bandura, 1986). As for environmental influence, the SCT emphasizes that personal agency operates within a surrounding environment through social persuasions or observational learning from role models (Bandura, 1986, 2001). Nevertheless, the SCT fails to depict a systematic interrelationship of the determinants of planned behavior. Ajzen and Fishbein (1980) proposed the theory of reasoned action (TRA), which postulates the logical and successive linkages of the critical determinants and one’s execution of a particular behavior. More specifically, behavioral attitude toward the behavior and subjective norm are theorized to be the antecedents of behavioral intention. Ajzen (1991) recognized the critical role of perceived behavioral control in explaining one’s behavioral intention and extended the TRA to propose the TPB. The four determinants of human action represent one’s behavioral, normative, affective, and control motivation to execute a future behavior (Fishbein & Ajzen, 2011).

Grounded in the above social psychological theories, Davis (1989) theorized the TAM to explain and predict human’s technology use behavior. The TAM postulates that perceived ease of use, perceived usefulness, and behavioral attitude are related to users’ behavioral intention to use a technology. Later, many researchers have theoretically extended the TAM by integrating the key determinants from the TPB and SCT in the higher education context (e.g., Scherer et al., 2019; Zhao et al., 2021) and the K-12 context (e.g., Chai et al., 2022; Cheng, 2019; Cheng & Yuen, 2022).

In sum, due to primary students’ PE acceptance for programming learning is still an emergent topic, this study adapted the TAM by synthesizing the TPB and SCT to investigate the factors affecting primary students’ behavioral intention to use PE. Following the elaborated review of the theoretical underpinning, research has consistently shown that perceived ease of use, perceived usefulness, perceived self-efficacy, behavioral attitude, subjective norm, and behavioral intention are key determinants in predicting and explaining students’ acceptance of learning technology.

2.2 Hypotheses development

2.2.1 TAM variables

The TAM conceptualizes two unique beliefs one holds toward technology acceptance behaviors, including perceived ease of use and perceived usefulness. According to the TAM, perceived ease of use reflects users’ intrinsic motivation and perceived usefulness represents users’ extrinsic motivation (Davis, 1989). The TRA suggests that one’s beliefs about a possible outcome of performing a behavior will determine his or her attitude toward performing that behavior (Ajzen, 1991). Behavioral attitude reflects one’s overall affective evaluation toward performing a particular behavior (Ajzen, 1991). Moreover, the TPB pinpointed that behavioral attitude is one of the most important predictors of behavioral intention (Ajzen, 1991; Fishbein & Ajzen, 2011). Rooted in the TRA, the TAM posits three logical steps link to users’ behavioral intention to perform a behavior: first, perceived ease of use can directly impact perceived usefulness; second, both perceived usefulness and perceived ease of use can directly influence behavioral attitude; third, behavioral intention can be predicted by perceived usefulness and behavioral attitude.

Numerous empirical studies conducted earlier have validated these relationships in predicting and explaining users’ behavioral intention to use learning technology (e.g., Ashrafi et al., 2022; Buabeng-Andoh, 2021). A few systematic review and meta-analysis studies also validated the capacity of TAM variables in explaining technology use intention (e.g., Scherer et al., 2019; Scherer & Teo, 2019). Given the parsimony and robustness of the original TAM model, some recent studies have also applied it as the basis to investigate the factors that predict K-12 students’ behavioral intention, for example, primary students’ intention to use PE for programming learning (Cheng, 2019), to use augmented reality app for smart libraries (Chen et al., 2022), and to engage AI in learning (Chai et al., 2022), and high school students’ involvement in STEM learning (Mutambara & Bayaga, 2021). Therefore, we hypothesize that:

H1

Perceived ease of use has a significant effect on perceived usefulness.

H2

Perceived ease of use has a significant effect on behavioral attitude toward using PE.

H3

Perceived usefulness has a significant effect on behavioral attitude toward using PE.

H4

Perceived usefulness has a significant effect on behavioral intention to use PE.

H5

Behavioral attitude toward PE has a significant effect on behavioral intention to use PE.

2.2.2 Perceived self-efficacy

As noted in the seminal works of the TPB (Ajzen, 1991; Fishbein & Ajzen, 2011), perceived behavioral control and perceived self-efficacy both conceptually reflect people’s belief of their capability to perform a behavior and can result in one’s perception of ease or difficulty to perform that behavior. On the other hand, whereas perceived ease of use reflects one’s judgement of their efforts, perceived self-efficacy represents one’s judgment of their ability. Nevertheless, Davis (1989) directly mapped perceived self-efficacy on to perceived ease of use in TAM. A recent meta-analysis revealed that perceived self-efficacy has been widely used as an antecedent of perceived ease of use (Scherer et al., 2019), indicating students with higher self-efficacy would perceive learning technology as easier to use (Cheng, 2019). Moreover, Bandura (1986) also linked perceived self-efficacy to attitude. Many researchers have framed perceived self-efficacy as computer self-efficacy to reflect the judgment of one’s capability to use a computer (Compeau & Higgins, 1995; Venkatesh & Davis, 1996). Previous research also supported perceived self-efficacy as a significant predictor of perceived ease of use and attitude (Buabeng-Andoh, 2021). Nevertheless, both the SCT and TPB pinpoint perceived self-efficacy as an essential determinant of behavioral intention, but the effects of perceived self-efficacy on behavioral intention are controversial, which needs further investigation (Buabeng-Andoh, 2021).

Perceived self-efficacy has long been important in reflecting students’ motivation and ability to program learning activities (Sun et al., 2022). Some researchers considered programming self-efficacy as the perception and judgment of one’s ability to solve computational problems with programming knowledge and skills (Cheng, 2019; Kong, 2017). Learners with high programming self-efficacy are more willing to apply their knowledge and utilize skills to solve computational problems (Kong, 2017). Moreover, programming self-efficacy significantly predicted students’ perceived usefulness and perceived ease of use of visual programming environments (Cheng, 2019). Existing studies also revealed that programming self-efficacy is associated with programming attitude and computational thinking performance (Sun et al., 2022; Wei et al., 2021). Therefore, we proposed that:

H6

Perceived self-efficacy has a significant effect on perceived ease of use.

H7

Perceived self-efficacy has a significant effect on behavioral attitude toward PE.

H8

Perceived self-efficacy has a significant effect on behavioral intention to use PE.

2.2.3 Subjective norm

Human behavioral development is extensively shaped by the surrounding people in their social environment (Bandura, 1986). The TPB conceptualized subjective norm to reflect one’s normative belief that “specific individuals or groups think he should or should not perform the behavior and his motivation to comply with the specific referents” (Ajzen & Fishbein, 1980, p. 8). Many follow-up studies also explored the effects of subjective norm on users’ intentions to use technology. Typically, subjective norm was assumed to be a determinant of behavioral intention in the TAM and the UTAUT, which have been extensively validated (Venkatesh et al., 2003; Venkatesh & Bala, 2008). In the e-learning context, Abdullah and Ward’s (2016) extensive review on 107 e-learning acceptance studies found that subjective norm was the most commonly used determinant of e-learning acceptance. Recent studies have revealed subjective norm as the primary determinant of behavioral intention (Huang et al., 2020; Revythi & Tselios, 2019).

Moreover, some studies have also differentiated distinct subjective norm in affecting one’s technology usage intention. A few studies on university students’ acceptance of e-learning have decomposed subjective norm into lecturer and peer influence (Cheung & Vogel, 2013; Lai & Chen, 2011). Some studies on teenagers further recognized the impact of parental influence on students’ behavioral intention (Cheng et al., 2022; Cheng & Yuen, 2019). For children who spend most of their time in school and with family, their course of action is largely influenced by their teachers, peers, and parents. Therefore, it is reasonable that the normative influences should include the influence of their peers, teachers, and parents. Summarizing the above literature, the following hypotheses were proposed:

H9

Peers subjective norm has a significant effect on behavioral intention to use PE.

H10

Teachers subjective norm has a significant effect on behavioral intention to use PE.

H11

Parents subjective norm has a significant effect on behavioral intention to use PE.

2.3 Moderators

With a thorough discussion on the psychological process in shaping students’ behavioral intention to use PE, we then explore the potential boundary conditions on the proposed relationships. It should be stressed that both the SCT and TPB pinpointed the importance of boundary conditions in influencing the interrelationships of its determinants (Ajzen & Fishbein, 1980; Fishbein & Ajzen, 2011). More specifically, the TPB suggests that relationships can only adhere to the boundary conditions of a given context, highlighting that individuals with varying conditions might develop distinct beliefs, attitude, and intentions relevant to specific types of behaviors. According to the SCT, the factors affecting one’s performance of a particular behavior can be categorized as personal and environmental factors. Since this study focuses on PE use behavior, we further identified the PE use-relevant moderators, which are closely related to children’ PE use behavior, as another category of key moderators worth exploring.

2.3.1 Personal moderators: gender, grade, and experience

Gender was considered an important factor in programming education, while conflicting results were observed in gender differences in programming learning. On the one hand, no gender difference was found in the CT skills developed through programming (Angeli & Valanides, 2020; Jiang & Wong, 2022). On the other hand, girls were found to have less confidence in robotics programming (Kucuk & Sisman, 2020) and lower programming attitude toward programming learning (Sun et al., 2022). This indicates that the research of gender differences in programming education is inconclusive. More specifically, some recent studies employed the TAM and revealed that gender differences in young learners’ lie in the constructs of perceived self-efficacy and perceived ease of use of game-based programming (Hu et al., 2022), and behavioral intention to use visual PE (Cheng, 2019). Therefore, gender is likely to moderate students’ PE acceptance.

Existing programming learning studies have revealed age or grade differences in the learning progression of learners at different developmental levels (Zhang & Nouri, 2019). Children at the younger and older ends may fall into different developmental stages with distinct capabilities of cognitive development (Inhelder & Piaget, 1958). For example, Seiter and Foreman (2013) found that primary school students used different programming concepts and the usage of complicated concepts such as parallelization, problem decomposition, abstraction and data representation tend to be delayed until the later grades. Students in grade 6 performed significantly better than grade 4 in the programming concepts of conditionals, logical operators and so on, which could be explained by that children aged 12–13 developed more matured verbal reasoning and categorical reasoning in dealing with information (Jiang & Wong, 2022). Therefore, students in different grades were likely to have different perceived usefulness, perceived ease of use, and perceived self-efficacy when using PE (Hu et al., 2022).

Previous studies also pinpointed the effects of prior experience on students’ cognitive and affective learning outcomes of programming education. Students with prior experience were likely to achieve greater gains in cognitive learning (Witherspoon et al., 2016; Zhong et al., 2016) and their programming learning experience is closely related to CT skills (Sun et al., 2022). In terms of affective constructs, those with more experience were found to have greater computer self-efficacy and a more positive attitude toward computing (Denner et al., 2014). These findings consistently suggested that students’ prior experience would moderate students’ attitude towards and perceptions of programming learning.

2.3.2 Environmental moderators: parents’ education level

The selection of parents’ education level as the environmental moderator was largely based on theories and existing studies. While heterogeneity existed in students’ parents’ education levels, the backgrounds of the primary students’ peers and teachers were largely homogenous as they had similar peers and teachers. Therefore, peers and teachers’ moderating factors were not included in environmental moderator analysis. Parental education tends to have a direct and positive effect on children’s achievement (Davis-Kean, 2005; Sewell & Shah, 1968). Based on the expectancy-value theory, parents’ education shapes the beliefs and expectations of the parent, which are vital to structure the home and educational environment for the children to excel (Eccles et al., 1993). In the STEM fields where programming education is situated, parents with higher education levels tended to provide STEM learning opportunities to children (Dabney et al., 2016). Empirical evidence suggested that parents’ education levels were positively related to students’ academic attainment of a STEM degree (Luo et al., 2022), and students’ robotics programming experiences and outcomes (Su et al., 2022). Meanwhile, the effects of fathers’ and mothers’ involvement were distinguished (Hsu et al., 2011), suggesting that fathers’ and mothers’ education levels might influence students’ learning and technology usage differently.

2.3.3 PE use-relevant moderators: programming competition, computational thinking, programming modality

2.3.3.1 Programming competition.

The effectiveness of competitions was an ongoing research initiative regarding its effects in promoting motivation and performance in the STEM fields (Chen et al., 2020; Eguchi, 2016; Witherspoon et al., 2016). Competition encompassed various learning activities, such as goal-oriented and project-based learning, in which students experienced competition and collaboration (Witherspoon et al., 2016). Traditionally, competition was perceived to be destructive to learning because competitors tended to be self-protective, which might diminish learning empowerment and responsibility (Kohn, 1992). Nevertheless, more recent theories (e.g., the social interdependence theory) argued that properly designed competition could benefit learning (Johnson & Johnson, 2009). Some studies attempted to examine the impact of programming competitions on students’ performance and motivations. Results showed that robotic competitions had long-term impacts on cultivating students’ interests to pursue further studies in STEM and could improve students’ STEM performance over time (Eguchi, 2016). Robotic competitions were also found to promote students’ STEM learning and programming knowledge (Nugent et al., 2016). Moreover, students who participated in the robotics competitions showed significantly higher motivation to learn programming than those who were not involved (Witherspoon et al., 2016). However, Chen et al.’s (2020) study showed that programming competition did not have an effect on learning motivation and 21st century competencies. The inconsistent findings on the effects of programming competitions highlight the needs to further investigate how students’ participation in programming competitions may or may not moderate their PE acceptance.

2.3.3.2 Computational thinking.

Computational thinking (CT) was largely defined as the cognitive problem-solving skills by drawing concepts fundamentally in computer science (Wing, 2006), which was assessed with computational concepts addressed and in relations to the underlined cognitive abilities, such as spatial ability, reasoning ability, and problem-solving ability (Román-González et al., 2017). There have been studies examining the relationship between students’ cognitive CT skills and attitudinal constructs (Hava & Koyunlu Ünlü, 2021; Wei et al., 2021). CT skills were significantly correlated to students’ attitude toward inquiry, such as curiosity, to a moderate level (Hava & Koyunlu Ünlü, 2021) and programming self-efficacy to a low level (Wei et al., 2021). Moreover, Polat et al. (2021) revealed a small correlation between students’ cognitive CT skills and perceptions. This indicates that CT skills were likely to moderate students’ attitude and perceptions, which are formed in computational thinking development through programming. By synthesizing all external variables related to technology acceptance constructs, Abdullah and Ward (2016) included cognitive ability, such as computer knowledge, as the external variable influencing students’ perceived usefulness and perceived ease of use. Moreover, literacy skill was also found to significantly predict children’s perceived usefulness and behavioral intention to accept AI technology (Chai et al., 2022) and e-learning technology acceptance (Cheng et al., 2022). Hence, it is reasonable to hypothesize that CT skills can moderate students’ attitude and perceptions of PE acceptance.

2.3.3.3 Programming modality.

Programming modality refers to the representational infrastructure and the interactions supported by the programming interface (Weintrop & Wilensky, 2018). Text-based, graphical, and tangible programming modalities may have varying effects on students’ programming performance. Referring to the cognitive load theory (Rau, 2020), text-based, graphical, and tangible programming modalities with fundamentally different design principles may influence students’ programming performance differently. Graphical PE simplifies text-based representation by replacing the text inputs with graphical building blocks, which reduces the cognitive load. While comparing the graphical and tangible programming modalities, it was suggested that students’ attention was split into two sources of visual representations and physical instructions using robotics, and students’ attention was focused on graphical modality with fewer redundant details (Rau, 2020). In a meta-analysis, Scherer et al. (2020) showed that graphical programming with visualization demonstrated a moderate effect size in the effectiveness of developing students’ programming knowledge and skills, compared with text-based programming modality, while the comparative effect size was trivial to small at an insignificant level in the study conducted by Xu et al. (2019). Meanwhile, robotics programming with the aid of physicality had a large effect size in promoting students’ programming knowledge and skills, compared with the programming modalities without the aid of physicality (Scherer et al., 2020). Moreover, some studies suggested that the use of different programming modalities influenced students’ programming practice (Weintrop & Wilensky, 2018), moderated their cognitive competencies (Lai & Wong, 2022), and affected their learning motivation (Çınar & Tüzün, 2021).

Therefore, we proposed to examine the moderating effects of the following eight constructs grouped into: (1) personal factors, including gender, grade, and prior experience, (2) environmental factors, including fathers’ and mothers’ education levels, and (3) PE use-relevant factors, including programming competition, CT, and programming modality.

3 Research methods

3.1 Participants and procedures

This study was conducted in a southern city in China. The Ministry of Education of China has selected this city as one of the first cities to widely pilot programming courses in primary education in 2019. Therefore, programming education has been widely implemented in primary schools in the research context in formal classes and extracurricular activities using different programming modalities. Primary 4 (P4), Primary 5 (P5), and Primary 6 (P6) students were selected as the participants since prior investigation showed that P3 students were not able to have enough literacy and computer skills to complete the online survey.

All sampled schools were further confirmed to have implemented programming education in their school curriculum before they were invited. From the formal learning side, the participants took weekly-basis courses in information and technology, which taught them basic programming concepts using a visual programming tool called Matrix Editor incorporating different programming modalities, such as visual programming, text programming, and tangible programming with the connection of hardware (see Fig. 2). In addition, from the informal learning side, all primary students could participate in different forms of programming activities, such as after-school programming courses, school programming clubs, and different levels of programming competitions, whereby students could choose the preferred programming modality to create an artifact aiming at solving real-life problems.

Fig. 2
figure 2

Programming interface

To ensure the response rate and reduce possible biased reactions, a web-based online survey was developed to collect data with a brief session about the research presented before the survey, and all the surveys were conducted in the school computer rooms with technical support on-site at the end of the fall semester in 2021. Therefore, all participants had already taken weekly-basis courses in information and technology for at least one semester and other forms of informal programming learning by the time the surveys were administered. Ethical approval was obtained from the institutional review board. Random sampling was used to select the intact classes from P4 to P6 students in each sampled school. The final sample size consisted of 1527 students from 8 schools, including 752 male students and 775 female students, who were studying in P4 (N = 453), P5 (N = 764) and P6 (N = 310).

3.2 Measurement scales

3.2.1 Cognitive determinants of PE use

This study identified eight constructs as the critical determinants of students’ PE acceptance. Three items were adapted from Venkatesh et al. (2003) to measure perceived usefulness, perceived ease of use, behavioral attitude, and behavioral intention, respectively. Three items were adapted from Park (2009) to measure perceived self-efficacy. Two items were adapted from Venkatesh and Davis (2000) to measure subjective norm of peers, teachers, and parents, respectively. All the scale items were scored on a 5-point Likert scale from 1 (strongly disagree) to 5 (strongly agree).

3.2.2 Moderators of PE use

Gender was measured with one item as 1 (male, N = 752) and 2 (female, N = 775). Grade was measured with one item as 1 (P4, N = 453), 2 (P5, N = 764), and 3 (P6, N = 310). Students were requested to report the length of time they had programming learning, with students who reported less than 1 year of programming learning experience were categorized as the less experienced group (1, N = 616) and students who reported more than 1 year of programming learning experience were categorized as the more experienced group (2, N = 911). Programming competition was indicated by their participation in programming contests, with one item as 1 (no participation group, N = 1319) and 2 (participation group, N = 208). According to previous studies (e.g., Scherer et al., 2020), students’ preference of programming modality was measured with one item as 1 (text-based, N = 136), 2 (graphical, N = 887), and 3 (tangible, N = 504). Environmental factors were indicated by parents’ education level, with one item as 1 (below college, N = 272 for father; N = 332 for mother) and 2 (above college, N = 772 for father; N = 751 for mother).

Computational thinking (CT) was measured using the Computational Thinking test (CTt) adapted from (Román-González et al., 2017). We used the CTt to test primary students’ CT for the following reasons: first, the test is presented in environment interfaces that can be decontextualized and, therefore, can be adapted in other research contexts; second, the test was designed for 5th to 10th grade students and have been validated among primary students (Tsarava et al., 2022); third, the original test (28 items) can be administered in pre-post evaluation conditions given the concepts measured in the CTt can be split into two equal sub-tests (14 items for each), and therefore can be completed within a normal class (40 min). Accordingly, the CTt was split into two equal sub-tests and randomly assigned to the students, which were completed by 857 and 670 students, respectively. Students were requested to choose one correct answer for each item, yielding a summed score ranging from 0 to 14. To account for measurement error after changing the test length, we used the Spearman-Brown Prophecy Formula to evaluate the reliability of the current test (Allen & Yen, 2001). Cronbach alphas (α) of the sub-tests were 0.724 and 0.720, respectively, indicating a good reliability (Cortina, 1993). Based on the mean value (i.e., 7.8) of the CTt score, students were categorized as low CT group (N = 691) and high CT group (N = 836).

$${\alpha }_{(CTt-A)}^{\ast }=\frac{2{\alpha }_{(CTt-A)}}{1+(2-1){\alpha }_{(CTt-A)}}=\frac{2\times 0.567}{1+(2-1)\times 0.567}=0.724$$
$${\alpha }_{(CTt-B)}^{\ast }=\frac{2{\alpha }_{(CTt-B)}}{1+(2-1){\alpha }_{(CTt-B)}}=\frac{2\times 0.562}{1+(2-1)\times 0.562}=0.720$$

3.3 Data analysis

First, we examined the multivariate normality of the measurement constructs. Following Kline (2016), the results showed that the data were normally distributed (the table can be provided upon request). Second, we adopted the two-step structural equation modelling (SEM) approach to analyze the proposed model, which first evaluated the measurement model using confirmatory factor analysis (CFA) followed by the examination of the structural model fit and hypothesized relationships (Anderson & Gerbing, 1988). The maximum likelihood estimation procedure was used to test the measurement and structural models. The following cutoff values were used to evaluate model fit indices (Hair et al., 2006; Hu & Bentler, 1999): (1) Satorra-Bentler scaled chi-square test (SB-χ2) should be no more than 5.00; (2) the comparative fit index (CFI) and Tucker-Lewis index (TLI) should be no less than 0.90; (3) the root mean square error of approximation (RMSEA) and standardized root mean square residual (SRMR) should be no more than 0.80.

Third, we employed the measurement invariance tests to examine the model invariant across groups. As a precondition to compare structural path coefficient differences, measurement invariance tests were conducted in three subsequent steps using the same baseline CFA model, with the test of configural invariance first followed by the test of metric invariance (weak invariance) and scalar invariance (strong invariance) (Vandenberg & Lance, 2000). The sequences of tests between groups would proceed further only if the previous step was justified and scalar invariance should be held. A set of stringent criteria were used to assess the model invariant: (1) a non-significant Satorra-Bentler scaled chi-square difference test (Δχ2); (2) the changes in the CFI (ΔCFI) should be no more than 0.02 (Cheung & Rensvold, 2002); (3) the changes in TLI (ΔTLI) should be no more than 0.05. (Little, 1997); (4) the changes in RMSEA (ΔRMSEA) and SRMR (ΔSRMR) should be no more than 0.01 (Chen, 2007).

Following the establishment of measurement invariance, we conducted multigroup comparisons to explore the moderators’ effects on the modeled relationships. This involved estimating the model fit of an unconstrained model and a constrained model using a baseline structural model, in which all the parameters were freely estimated across groups and all structural path coefficients were constrained to be equal across groups, respectively. Then, the three steps were carried iteratively until no significant chi-square difference (Δχ2) between the constrained and unconstrained model was reported (Mason et al., 2011): (1) the Δχ2 test was performed between the comparative models; (2) the constraint on path with the largest modification index was released upon significant Δχ2; (3) the Δχ2 between the partially constrained model and the unconstrained model was examined again. All the data analyses were performed using Mplus 8.7.

4 Results

4.1 Testing the measurement model

The results of the CFA analysis showed that the measurement model demonstrated a good model fit (SB-χ2 = 581.018, df = 157, CFI = 0.981, TLI = 0.975, RMSEA = 0.042, SRMR = 0.026). The convergent validity was assessed using the following criteria (Fornell & Larcker, 1981): (1) item reliability should be no less than 0.50; (2) Cronbach alpha (α) and composite reliability (CR) should be no less than 0.70; (3) average variance extracted (AVE) should be no less than 0.50. The results showed that factor loading of all the scale items exceeded 0.50 (see Table 1), the reliability, AVE, and discriminant validity of all the measurement constructs were satisfied except for perceived ease of use (See Table 2). It is possible that one observed item of perceived ease of use was asked in a negative term, posing difficulties for the primary students’ understanding. Given its overall reliability and validity were acceptable and its theoretical importance, perceived ease of use was still included.

Table 1 Constructs, sources, corresponding scale item and factor loadings
Table 2 Reliability, AVE, and discriminant validity

4.2 Testing the structural model and the hypotheses

The results of SEM analysis showed that the structural model demonstrated a good model fit (SB- χ2 = 692.538, df = 168, CFI = 0.977, TLI = 0.971, RMSEA = 0.045, SRMR = 0.043). As seen in Table 3, all the hypothesized relationships were supported except for H3, H4, H5, and H10. The structural model explained 76.4% of the variance in perceived ease of use, 45.5% of the variance in perceived usefulness, 61.4% of the variance in behavioral attitude, and 52.1% of the variance in behavioral intention. The structural model evaluation results are presented in Fig. 3.

Table 3 Summary of hypotheses testing results
Fig. 3
figure 3

Path coefficients of the research model. Note: *p < .05, **p < .01, ***p < .001

4.3 Testing the measurement invariance

The results of measurement invariance are presented in Table 4. Following the steps illustrated in Sect. 3.3, we first examined the configural invariance followed by metric invariance and scalar invariance. The baseline configural, metric, and scalar invariance models all fit to the data well. The configural invariance across all comparative groups can be achieved (Hair et al., 2006; Hu & Bentler, 1999). Furthermore, nested model comparisons showed no significant differences across the comparative groups of the moderators, except for the gender and grade groups. However, changes in the model fit indices (ΔCFI, ΔTLI, ΔRMSEA, ΔSRMR) for nested model comparisons were within the criteria for all comparative groups between the metric invariance models and configural models, and between the scalar invariance models and the metric invariance models (Chen, 2007; Cheung & Rensvold, 2002; Little, 1997). It indicates that both weak invariance and strong invariance were established between the comparative models. Therefore, the measurement invariance across all groups was established.

Table 4 Summary of the measurement invariance results

4.4 Multigroup comparison

4.4.1 Personal moderators

Following the procedures of a path-by-path methods of moderation analysis (Chai et al., 2022; Hu et al., 2022), the results revealed that grade and experience moderated some relationships in the research model, while gender did not have moderating effects. Two significant path differences were revealed for the experience group comparisons (see Table 5). More specifically, perceived self-efficacy had a stronger influence on perceived ease of use and behavioral intention for the more experienced (PSE→PEOU: β = 0.908, p < .001; PSE→BI: β = 0.488, p < .001) than the less experienced group (PSE→PEOU: β = 0.808, p < .001; PSE→BI: β = 0.323, p < .001).

Table 5 Summary of standardized path coefficients and z-score across the gender and experience groups

The results of the multigroup comparisons across grade groups are presented in Table 6. The differences in the P4-P5 comparison lie in the influence of subjective norms on behavioral intention. Peer subjective norm was significant for P5 students (β = 0.266, p < .001). In contrast, teacher subjective norm had a significant influence on intention for P4 students (β = 0.167, p < .05). For the P4-P6 comparison, perceived ease of use was less strongly related to perceived usefulness for the P4 (β = 0.688, p < .001) than the P6 group (β = 749, p < .001), whereas peer subjective norm only had a significant influence on intention for the P6 group (β = 0.214, p < .001). Similarly, for the P5-P6 comparison, perceived ease of use was also less strongly related to perceived usefulness for the P5 (β = 0.633, p < .001) than the P6 group (β = 0.749, p < .001). It indicates that perceived ease of use may have a greater influence on perceived usefulness for students at higher grades. Moreover, peer subjective norm only significantly affected the intention of P5 (β = 0.266, p < .001) and P6 (β = 0.214, p < .01) students, whereas teacher subjective norm appeared to only have a significant positive effect on P4 students (β = 0.167, p < .05).

Table 6 Summary of path coefficients and z-score across the grade groups

4.4.2 Environmental moderators

We examined the moderating effects of two environmental factors represented by the father’s and mother’s education level (see Table 7). In both groups, perceived self-efficacy had a stronger influence on perceived ease of use for the above college group (father: β = 0.880, p < .001; mother: β = 0.899, p < .001) than the below college group (father: β = 0.880, p < .001; mother: β = 0.830, p < .001). It indicates that both father and mother’s education level moderated the same path (PSE→PEOU) similarly, implying that for the students with higher parents’ education levels, the stronger level of perceived self-efficacy was likely to result in perceived ease to use PE for programming learning.

Table 7 Summary of path coefficients and z-score across parents’ education level groups

4.4.3 PE use-relevant moderators

The results of the multigroup comparisons across competition and CT groups are presented in Table 8. For the competition group comparisons, there was no significant difference among the path comparisons. For the CT group comparisons, we found two significant path differences (PEOU→PU and PSE→PEOU). Perceived ease of use had a stronger influence on perceived usefulness for the low CT (β = 0.711, p < .001) than the high CT group (β = 0.645, p < .001), whereas perceived self-efficacy was less strongly related to perceived ease of use for the low CT (β = 0.844, p < .001) than the high CT group (β = 0.892, p < .001).

Table 8 Summary of path coefficients and z-score across the competition and CT groups

Finally, we compared path coefficient differences across the programming modality preference groups (see Table 9). It is noteworthy that no significant difference was found in the textual-graphical group comparisons. For the textual-tangible group comparisons, perceived self-efficacy had a greater influence on perceived ease of use for the textual group than the tangible group. For the graphical-tangible group comparisons, three paths were revealed (PEOU→PU, PEOU→BA, and PSE→PEOU). More specifically, perceived ease of use had a greater influence on perceived usefulness and behavioral attitude for the tangible group (PEOU→PU: β = 0.685, p < .001; PEOU→BA: β = 0.789, p < .001) than the graphical group (PEOU→PU: β = 0.631, p < .001; PEOU→BA: β = 0.460, p < .001). In contrast, perceived self-efficacy influenced perceived ease of use to a significantly higher level for the graphical group (β = 0.863, p < .001) than the tangible group (β = 0.870, p < .001).

Table 9 Summary of path coefficients and z-score across programming modality preference groups

5 Discussion

5.1 The structural model with the entire sample

The current study revealed the boundary conditions on children’s PE acceptance with a large sample of 1527 primary school students from Grade 4–6. We first used confirmatory factor analysis to support the measurements of the examined factors and then used a structural equation model, which showed support for seven of the eleven hypotheses. Perceived ease of use significantly predicted perceived usefulness and behavioral attitude, whereas perceived usefulness did not predict behavioral attitude and behavioral intention. Perceived self-efficacy significantly influenced perceived ease of use, behavioral attitude, and intention. In addition, behavioral intention was significantly predicted by peer subjective norm and parent subjective norm, but not by teacher subjective norm and behavioral attitude.

Perceived self-efficacy is a vital determinant that affects primary school students’ perceived ease of use, attitude, and behavioral intention to use PE. It implies that students with higher levels of perceived self-efficacy are more likely to perceive ease of using PE, have positive attitude and intend to adopt PE in their learning. The finding is consistent with the previous studies, which show that perceived self-efficacy significantly predicted behavioral intention to use game-based programming for younger adolescents (Hu et al., 2022), perceived ease in using visual programming (Cheng, 2019), and attitude to use mobile learning (Buabeng-Andoh, 2021). The results provided empirical evidence to highlight the important role of self-efficacy in programming learning, which is not only a significant indicator of students’ motivation and ability to engage in programming learning (Sun et al., 2022), but also a critical motivation in facilitating children’s acceptance and continued use of PE. Moreover, the results also revealed that perceived ease of use was significantly related to perceived usefulness and attitude. The results implied that for upper-level primary school students, if they perceived ease of using PE, they were more likely to perceive the usefulness and have positive attitude of PE. Given perceived ease of use and perceived self-efficacy were more likely to reflect users’ intrinsic motivation to use technology (Davis, 1989; Bandura, 1986), the results suggested that experience-specific intrinsic motivations were critical in shaping children’s favorable perceptions and attitude toward PE use for programming learning, which were in line with previous studies on teenagers’ acceptance of e-learning (Cheng & Yuen, 2018, 2022).

Nonetheless, perceived usefulness did not predict behavioral attitude and behavioral intention, and behavioral attitude also did not predict behavioral intention. Perceived usefulness reflects users’ extrinsic motivation (Davis, 1989, p.320), which indicates that extrinsic motivation was not likely to influence children’s behavioral attitude to use PE for programming learning. This contradicts the previous findings that both perceived ease of use and perceived usefulness significantly predicted behavioral attitude and intention (Cheng, 2019; Mutambara & Bayaga, 2021). Although the study showed that perceived usefulness did not significantly influence behavioral intention of using PE, it is in agreement with previous studies on e-learning acceptance among children (Buabeng-Andoh, 2021; Chen et al., 2022; Cheng & Yuen, 2019). The attachment to perceived ease of use rather than perceived usefulness could be explained by that children focused more on the hedonic value (Chen et al., 2022). The insignificant influence of attitude on behavioral intention mirrors the findings in Ashrafi et al. (2022). It may be explained by the lack of educational support provided by PE to cater different learning needs, which might cause learners to terminate their behavioral intention when failing to gain the required programming knowledge and use it for future learning (Ashrafi et al., 2022).

The influence of subjective norms from social entities on students’ behavioral intention varied. This finding demonstrated the critical role of peers and parents in driving teenagers’ behavioral intention to use PE (Cheng et al., 2022; Cheng & Yuen, 2022). It may be explained by the fact that programming learning is a social activity that fosters peer collaboration (Grover & Pea, 2013), whereas parents can provide children with informal learning opportunities and resources in programming. Hence, parents and peers are two key drivers in determining primary school students’ behavioral intention of using PE. However, teachers’ subjective norm did not influence students’ behavioral intention, which is consistent with some previous studies (Cheung & Vogel, 2013; Lai & Chen, 2011). Programming education is grounded in the theories of constructionist learning which underlines the active role of learners to construct programming artifacts and knowledge in such student-centered learning environments (Tikva & Tambouris, 2021), whereby teachers’ opinions about the technology are relatively not salient in determining the individual’s beliefs about technology use (Lai & Chen, 2011). This may explain the insignificant influence of teacher subjective norm on behavioral intention because the instructor can be classified as a “weak social tie” in student-centered learning environments (Cheung & Vogel, 2013).

5.2 Measurement invariances and multigroup SEM comparisons

The measurement invariances results indicated that the measures on the research model have the same meaning across the groups, ensuring meaningful multigroup comparisons across groups. For personal moderators, grade and experience moderated some relationships in the research model, while gender did not have moderating effects. Boys and girls did not differ in the influencing factors of PE acceptance, which was partially supported in the studies using graphical programming suggesting that gender similarities were found in the influencing factors of behavioral attitude (Cheng, 2019), behavioral intention, and perceived usefulness (Hu et al., 2022).

Contradict with some studies (Hu et al., 2022), grade level moderated the linkage between perceived ease of use and perceived usefulness, peer subjective norm and behavioral intention, and teacher subjective norm and behavioral intention. The results revealed that compared with lower grades, higher grades are more likely influenced by peer subjective norm to use PE and perceived stronger relationship between perceived ease of use and perceived usefulness. It further suggested that grade differences in programming acceptance lie in how students of different grades formed the intrinsic and extrinsic motivation of using PE, and they were influenced by the peers and teachers. This finding extended the grade differences in cognitive ability of programming learning to the motivational and social factors of PE use (Jiang & Wong, 2022). Experience moderated the linkage between PSE and PEOU, PSE and BI. Compared with students with less prior experience, students with more prior experience are more likely influenced by perceived self-efficacy to develop behavioral intention and perceive the ease of using PE. It indicates that perceived self-efficacy had a greater influence on students with more prior experience than those with less experience. This evidenced that students’ prior experience moderated their attitude and perceptions of programming (Denner et al., 2014) by influencing the relationships between PSE and other constructs.

For environmental moderators, father’s and mother’s education levels moderated the same path (PSE→PEOU) in their respective models. Results show that for students with higher fathers’ or mothers’ education levels, perceived self-efficacy had a greater influence on their perceived ease of using PE. This finding can be explained by the expectancy-value theory (Eccles et al., 1993). The theory suggests that parents with higher education levels can provide more learning-related opportunities and create a supportive educational environment for their children to excel, which in turn, shapes their children’s beliefs, expectations, and efficacy in learning (Dabney et al., 2016).

For PE use-relevant moderators, CT levels and programming modality preference moderated some relationships in the research model, while competition did not have moderating effects. It indicates that students with or without competition experience perceived PE acceptance in a similar way. In other words, competition experience did not influence PE acceptance. This finding is consistent with previous studies, which showed that competition brought trivial effects in students’ learning gains of robotics programming (Chen et al., 2020). However, CT levels moderated the linkage between perceived ease of use and perceived usefulness, and perceived self-efficacy and perceived ease of use. The perceived usefulness of students with lower CT levels was more likely to be influenced by the perceived ease of use, whereas the perceived ease of use of students with higher CT levels was more likely to be influenced by self-efficacy. In other words, perceived ease of use plays a vital role for students with lower CT levels, while self-efficacy is relatively more important for students with higher CT levels. The results echo that literacy levels significantly predicted students’ acceptance of using new technology (Chai et al., 2022).

Programming modality moderated the linkage between perceived ease of use and perceived usefulness, perceived ease of use and attitude, and perceived self-efficacy and perceived ease of use. The preference of text-based and graphical programming modality did not engender a difference in the structural relationship. This finding supported that there were no significantly different effects of text-based and graphical programming on student learning (Xu et al., 2019). However, compared with tangible programming modality, perceived self-efficacy had a greater influence on perceived ease of use in the text-based and graphical modality. Perceived ease of use had a greater influence on perceived usefulness and behavioural attitude in the tangible modality than the graphical modality. The results suggested that PE with the aids of physicality influenced students programming learning (Scherer et al., 2020). This may be explained by the cognitive load theory, which refers to that the fundamentally different design principles were sought to reduce the cognitive overload of novice learners (Rau, 2020). It also opens the window to further investigate the effects of text-based, graphical, and tangible modalities in programming learning to disentangle the benefits of visual or physical aids.

5.3 Theoretical implications

The current study contributes to the theory development in the field of technology acceptance and programming education studies. First, our study provided empirical evidence of employing the SCT, TPB, and TAM theories in understanding primary students’ PE acceptance for programming learning. In contrast with many previous TAM studies highlighting the important role of user perceptions in driving technology use behaviors, this study highlighted the vital role of perceived self-efficacy in shaping students’ intention to use PE. The results reinforced the implications of the SCT and TPB, highlighting the importance of perceived self-efficacy in facilitating children’s effective functioning. The results implied that intrinsic motivations might be effective in facilitating children’s PE use for programming learning. Thus, we suggest future studies to explore more potential intrinsic motivations that might facilitate children’s use of PE for programming learning. According the SCT, self-regulation is a metacognition that is likely to have a strong positive association with good learning performance. Therefore, future research can consider integrating self-regulative learning as a teaching strategy in programming education and examines its effect on children’s motivations to accept and use PE for programming learning. Second, this study pioneered to extend the boundary conditions of technology acceptance from demographic and family backgrounds to PE-use relevant moderators. The results yielded insights into the nuanced difference in the motivators in shaping students’ PE acceptance across students with different background characteristics. The results also implied the importance of computational thinking and programming modality in children’s programming learning. Therefore, future studies are encouraged to design comprehensive and systematic experimental studies to compare the impacts of different programming modalities on students’ programming practices and cognitive skills (especially computational thinking skills).

Thirdly, it enriched the body of theories about learning with physical and virtual representations (Rau, 2020) by identifying the critical determinants influencing human-computer interaction, such as perceived ease of use and perceived self-efficacy. It extended the cognitive and concept-specific explanation of learning with different representations (Rau, 2020) to include behavior-relevant beliefs drawing from the seminal social psychological theory and the TAM. Perceived self-efficacy plays a more significant role in virtual representation, while perceived ease of use exerts a greater influence on physical presentation. It implied that the representational structure and interactions supported by the PE shaped children’s behavior-relevant beliefs in learning programming. Fourthly, the significant influences of subjective norm and environmental factors further evidenced the social-cultural nature of CT education (Grover & Pea, 2013). While the framings of CT have been shifted from the cognitive to situated perspective, the effects of the larger community surrounding the learners and collaborative participation were underscored (Kafai & Proctor, 2022). Our results add to this point by outlining the significant influences of peers and parents. It indicates that the influences of peers and parents are not only socially participatory, but also formative in developing children’s behavioral intention to use PE.

5.4 Practical implications

To conclude, this study also sheds light on the practical implications. Firstly, the results imply that we should pay attention to promoting children’s ease of use perception to use PE for programming learning. Specifically, results show that the PE acceptance of students with lower CT levels were more likely to be influenced by perceived ease of use. Therefore, educators and designers should pay attention to reducing children’s cognitive load in using PE for programming learning, which can be achieved by better PE design and creating visual hints or tangible blocks as an assistive method during their programming process (Lye & Koh, 2014). In addition, educational needs’ support, such as programming tips or hints, should be taken into consideration of PE design to provide required programming knowledge for continual use and learning. Secondly, given that perceived self-efficacy plays a vital role in PE acceptance, instructors should design learning content in a developmentally appropriate manner and devise learning activities that can boost students’ perceived self-efficacy. It is suggested that increasing computer use can possibly enhance self-efficacy by creating PE use in class and after class, such as programming clubs (Cheng, 2019). Considering the fact that the PE acceptance of students with lower and higher CT levels were more likely to be influenced by perceived ease of use and self-efficacy respectively, instructors should keep the “low floor” for the lower CT students and promote “high ceiling” for the higher CT students during the computer use (Grover & Pea, 2013). Third, given that peer and parent subjective norm demonstrated significant influences on children’s intention to use PE across most group comparisons, it is suggested to create more social involvement and collaborative learning environment for primary students to maximize the positive influences of peer and parental influence in driving the intention to use PE. Two major findings can inform another important practical implication: first, teacher subjective norm was not likely to significantly impact children’s intention to use PE across all group comparisons; second, children demonstrated different levels of affective and cognitive development toward programming in different programming modalities. Therefore, instructors should reflect on whether their instructional design of programming learning is appropriate. In this case, instructors are encouraged to take advantage of different programming modalities to better engage children in programming learning.

5.5 Limitation and future studies

The study also had limitations and thus raised future research directions. Firstly, the study was conducted in a city in China, where cultural and socio-economic factors may differ significantly from other regions, limiting the generalizability of the findings to other contexts. Nonetheless, the mixed sampling methods ensured the representativeness of the sampled participants in understanding upper-level primary students’ motivations and use behavior of PE for programming learning. Secondly, negative terms were used to describe the statement when measuring perceived ease of use, which adversely affected the construct validity slightly. However, it may also yield insights into the design of questionnaire items, such as considering the participants’ cognitive ability and comprehension levels, especially avoiding using negative terms for primary students when designing questionnaire items. Thirdly, this study mainly employed quantitative data collection and analysis in investigating the primary school students’ PE acceptance and use, which may overlook the different case characteristics that qualitative data can provide. Hence, future studies may consider incorporating interview data that can provide a more in-depth understanding of students’ acceptance of PE.

6 Conclusion

This study examined the determinants and moderators’ effects on primary school students’ PE use, drawing from the integrated theories of the TAM, TPB, and SCT. This study extended previous studies by considering the interrelationships between the essential motivations and the boundary conditions corresponding to the programming education context among primary students, including personal moderators (i.e., gender, grade, and experience), environmental moderators (i.e., both parents’ education level), and PE use-relevant moderators (i.e., programming competition, computational thinking, and programming modality). By conducting SEM analyses, we confirmed that perceived self-efficacy is a vital determinant that affects primary school students’ perceived ease of use, attitude, and behavioral intention to use PE. In addition, different sources of subjective norm (i.e., peer/teacher/parent) influenced students’ behavioral intention differently. Moreover, the multigroup SEM analysis revealed significant path differences across different moderators, except for the gender and programming competition group comparisons, with most path differences were related to perceived self-efficacy and perceived ease of use. Therefore, this work highlighted the significance of experience-specific intrinsic motivations in informing children’s perceptions, attitude, and intention to use PE for programming learning across different boundary conditions. This work can yield important theoretical and practical implications to identify and accommodate essential constructs within a theoretical model across the boundary conditions of PE acceptance to improve children’s PE use behaviors in primary education.