Introduction

Coding or programming is often seen as an excellent way to nurture 21st century skills, and coding is widely considered as the literacy skill of the 21st century (Papavlasopoulou et al. 2018), however, the underlying reasons for children’s willingness for participation in such activities is still not well understood. Emotions may be a key factor of participation in coding activities. Accordingly, there is a rise in research to better understand the role of emotions in technology-based learning environments (Loderer et al. 2020), however Graesser (2019, p. 1) argued that “the fields of psychology, education, and computer science have individually been much too slow in investigating the intersection of emotions, learning, and technology until the last two decades”. While previous research indicated the importance of motivation and attitudes on the willingness to participate in coding activities, there is no consensus as to which emotions are experienced and what role they play in a technology-based learning environment (Graesser 2019). To complicate things, assessments obtained with different tools, such as self-report measures, judge’s reports, physiological data, behavioural data, and non-instructive multichannel sensing measures, are little to moderately correlated (Graesser 2019).

Along with emotions and attitudes, gender might play an important role on children’s participation in coding activities. It is well known that girls (and females in general) are underrepresented in STEM fields (Science, Technology, Engineering and Mathematics) (Master et al. 2017) and so there is a world-wide pursuit to increase the involvement of girls in science. However, based on a recent report of Girls Who Code (2019), the applied policiesFootnote 1 to increase access to Computer Science (CS), and to increase the volume of CS classrooms in the United States are currently unable to increase the participation of girls in programming: “The data shows that existing policies to bring more girls into computer science aren’t just missing the mark, they may actually be doing more harm than good” (Girls Who Code 2019, p. 11). Based on the report, girls participation rate in CS classes from school years 2016–2017 to 2017–2018 in states with access policies decreased the most in Arkansas with 4.1%, and increased the most in Utah with 3.4%, and it was overall way below 50%. European researchers also stated that at the moment researchers are lacking of evidence for designing effective and engaging coding experiences for children (Papavlasopoulou et al. 2018) and that gender differences are relatively understudied in coding and making activities (Papavlasopoulou et al. 2019). The same holds true for the reasons underlying these observations.

Our research aims to broaden our knowledge on the possible factors that influence children’s attitudes toward coding, hence, indirectly affect their willingness to take part in coding activities. We are set to investigate not only children’s attitude but also their state-level emotions (emotions at a given moment) and possible interactions between those and the reported and measured learning while investigating gender differences as well. In the context of a two-hour long coding workshop we examined children’s emotions, attitude towards programming, the fun experienced, and their learning. Our findings indicate that the workshop had a significant and positive effect on children’s emotions and attitude towards programming, and that the workshop was successful in terms of learning. Additionally, we provide evidence on the possible influential factors associated with the attitude change and learning gain and discuss gender differences along the study findings.

The current paper brings novel insights on the influential factors that play a key role on attitudes toward programming and knowledge acquisition during playful coding learning experiences, and the role of experiencing fun and participants’ gender in this setting. In the following sections of the paper we examine related findings and theories, before we introduce and discuss our study findings, and elaborate on future research.

Related work and background theory

Emotions and learning

As Hascher stated, “there is rarely any learning process without emotions. (…) Despite the obvious connection between learning and emotion, still very little is known about it. For decades, learning was mainly analyzed in terms of cognitive or motivational aspects. As a consequence, learning theories ignored affective processes for a long period of time” (Hascher 2010, p. 13). This is in line with Graesser (2019), who claimed that researchers started to focus on the relationship between emotions, learning and technology only in the past two decades. Moreover, Pekrun et al. (2002) adds that scientific research on academic emotions had a strong and narrow focus on test anxiety for decades. A recent systematic review (Loderer et al. 2020) investigating emotions in the technology-based learning environment supported Pekrun’s argument as the study found that anxiety was the most frequently investigated academic emotion (which was investigated in approximately the half of the cases); followed by enjoyment, which was investigated in approximately in one fourth of all reviewed cases, and boredom (approx. in 15% of the cases). They compared additionally the reported emotions in the technology-based environment and non-technology-based environments and found slightly less anxiety and more enjoyment in the technology-based environment. However, the effect varied across different learning settings. They added that their study findings indicated possible nonlinear relationship between emotions and other factors, which has to be further investigated. Accordingly, Hascher (2010) urged future research in the field in order to broaden our knowledge and understanding on a wider spectrum of emotions in the academic environment.

From cognitive psychology we know that emotions influence cognitive processes and strategies, decision making and motivation, and that the aforementioned influences are reciprocal (Kim and Pekrun 2014). For example, emotions influence our memory (think about how differently eye-witnesses report on catastrophes) but our memory also influences our emotional reactions (think about how a positive memory can influence one’s mood) (Kim and Pekrun 2014). In psychology research, the basic emotions that are characterized by prototypical facial expressions are happiness, sadness, surprise, disgust, anger and fear (Ekman and Friesen 1978). However, it has been questioned whether these six emotions play a key role in the learning process (Craig et al. 2004). Graesser (2019) clearly stated that “The ensemble of emotions that occur during learning are very different from the basic emotions that dominated psychological research for decades” and that “the profile of emotions that learners experience have some commonalities but also predictable differences over task, goals, subject matter content, and population of learners” (Graesser 2019, p. 2). Kim and Pekrun (2014, p. 72) argued that “emotions are only partially observable; individuals’ facial expressions or skin reactions, for example, can have different meanings even in the same situation” and that wearable sensors could have a distracting effect that is reflected on the task-on behavior.

Regarding the specific field of e-learning and emotions, Mayer (2019) pointed out three main research challenges. The first main challenge is the identification of the key emotions in e-learning, the second challenge is their appropriate measurement, and the third is the explanation of the findings, with special regards to the causes and the consequences of emotional states while learning.

As no scientific consensus exists on the key emotions in learning, the different effects of positive compared to negative emotions while learning and on learning are not straightforward. Valiente et al. (2012, p. 130) said that “Although researchers typically expect positive emotions to foster academic success, high-arousal positive emotions (…) may detract from achievement”. Hence, any assumptions of a straightforward relationship between positive emotions and learning, and negative emotions and not learning would be misplaced. For example, the observational analysis of Craig et al. (2004) found significant positive correlation between confusion and measured learning gain, and Loderer et al. (2020) concluded based on their systematic literature review that “negative emotions like confusion, but potentially also anger or boredom, can be beneficial to learning under certain circumstances, likely only to the degree that they promote deeper engagement with contents and can be successfully resolved”.

Fun and learning

Bisson and Luckner (1996) were among the first to discuss the positive effects of fun in the learning environment. In their view fun functions as a vehicle for evoking intrinsic motivation, reducing stress and social boundaries, and creating a safe learning environment. Other authors argued that fun facilitates engagement (Rambli et al. 2013), enhances learning (Chan et al. 2019; Lucardie 2014; Rambli et al. 2013; Tews et al. 2017; Vieira and da Silva 2017; Willis 2007), improves programming skills (Long 2007), has a significant effect on the learning effort (Long 2007), fosters curiosity (Iten and Petko 2016; Vieira and da Silva 2017), contributes to high-quality learning experience (Tews et al. 2017), promotes collaborative learning (Chan et al. 2019), is a predictor for learning success (Iten and Petko 2016), and has an effect on gaining motivation (Iten and Petko 2016). Tisza and Markopoulos (2021) found that adolescents find something fun when (i) they feel in control over the activity and their participation, (ii) they feel well and not feel bad, (iii) they get immersed in the activity, (iv) they let go of social inhibitions, and (v) the level of challenge meets their level of skills. Regarding Elton-Chalcraft and Mills (2015, p. 482) “Learning which is enjoyable (fun) and self-motivating is more effective than sterile (boring) solely teacher-directed learning”. However, other studies failed to demonstrate significant positive associations between the experienced fun and the learning outcomes (Iten and Petko 2016; Sim et al. 2006). As Hascher stated, “Enjoyment in school is one of six constitutive dimensions of student well-being (…) so far, academic enjoyment has been investigated in terms of different events of enjoyment or as enjoyment in specific subjects. Rarely, enjoyment was addressed to the learning activity itself” (Hascher 2010, p. 21–22).

According to Nandi and Mandernach (2016, p. 346) “There is tremendous amount of interest in making education more engaging and interesting for students”, and within the informal (STEM) learning context, game jams, hackathons and game creation events “have been acknowledged by academics and policy makers as a viable alternative to traditional approaches” (Fowler 2016, p. 38). Game jams “provide participants with the opportunity to create a game within a specific constrain or limitation (time, technology, theme, or mode of transport)” (Fowler 2016, p. 39). According to Fowler (2016), over one-third of the participants report on willing to attend the next game jam for fun, while approximately one-fourth willing to attend to learn new things, including new skills, too. Hackathon are “events that have been described as a problem-focused computer programming event” (Fowler 2016, p. 39), however, compared with the game jams, hackathons do not necessarily have the focus on game development. According to Nandi and Mandernach (2016), hackathons provide students with a fun and engaging format to learn about programming in the non-formal learning environment. They also reported on an observation that students who participated on hackathons had slightly higher GPAs (grade point averages) compared with non-participating students. While investigating reasons for participating in hackathons, learning and skill improvement were among the most frequently mentioned ones, and among the other reasons having fun was often found (Briscoe and Mulligan 2014; Fowler 2016; Lara and Lockwood 2016).

In sum, while some studies discuss the coding activity in terms of students having fun, and that the coding activity increases students’ attitude toward coding and their learning outcomes (Papavlasopoulou et al. 2018; Sáez-López et al. 2016) and possibly contribute to a higher GPA (Nandi and Mandernach 2016), our knowledge is still limited regarding the relationship between the experienced fun while learning and learners’ attitude change, and regarding the effect of fun on learning.

Gender differences in coding

Master et al. stated (2017, p. 92) that “the gender gap in science, technology, engineering, and math (STEM) engagement is large and persistent”. It is known that students’ success in computer science courses and their career choices could be affected by their attitudes toward programming (Cetin and Ozden 2015) and previous findings indicated more positive attitudes toward programming among boys than girls (Baser 2013; Korkmaz and Altun 2013; Munro 2018; Rubio et al. 2015). Gender differences on beliefs about programming are present as early as in the age of six (Master et al. 2017), however, those beliefs can be influenced by experience. While findings suggested that girls attitudes could be influenced and the change could be measured immediately, such a change cannot be assumed sufficient for changing girls’ stereotypes about programming or robotics, as “changing stereotypes is difficult, even among children” (Master et al. 2017, p. 101). Yucel and Rızvanoğlu (Yücel and Rızvanoğlu 2019) found gender differences in all of the nine attributes they examined: perceived competence, perceived coding difficulty, identification, perceived game difficulty, perceived success, level of enjoyment, level of anxiety, likelihood of playing another time and likelihood of trying new features. Overall, girls found Code Combat—a code learning game—and programming less attractive than boys did. This aligns with Master et al. (2017) where after a short intervention which generated a positive experience, the technology motivation of girls and boys were statistically at the same level, while in the control group (without the positive robotic experience) the technology motivation of girls was especially low compared to that of the boys. However, other research indicated, that interacting with visual programming environments (such as Scratch) had a positive effect on children’s attitude toward programming (Gunbatar and Karalar 2018; Sáez-López et al. 2016), and after the interaction no significant gender difference could be found in children’s attitude toward programming (Gunbatar and Karalar 2018; Kalelioǧlu 2015; Kalelioǧlu and Gülbahar 2014; Zuckerman et al. 2009). Gunbatar and Karalar (2018, p. 931) conclude that “when teaching programming through visual programming environments, the gap between gender differences can be closed in terms of many variables”. Hackathons might also serve as an event to make programming more attractive for young females. In their study, Ruiz-Garcia et al. (2016) designed a hackathon specially for girls, including a mentorship program. They found that 100 from the 111 participating girls were absolute novices to hackathons, and their results indicated that the participating girls “will continue exploring on their own the technologies they learned, as well as explaining them to their friends. The most successful feedback is that they are now more interested in studying engineering degrees” (Ruiz-Garcia et al. 2016, p. 255). Another study (Richard et al. 2015) reported on a hardware hackathon, in which they used the LillyPad Arduino to design wearables, this way aiming to attract more female participants. They concluded that their specific focus on wearable design was successful in diversifying participation, in other words, in attracting more than usual females to the hackathon.

A recent study (Munro 2018) investigating Canadian children’s attitude toward coding found that 72% of the surveyed boys, and 57% of the surveyed girls were very- or extremely interested in careers that involve use of digital technologies. However, 50% of the boys and 27% of the girls said to be very- or extremely interested in having a career that involves coding or programming. Regarding children’s attitudes about programming the research findings indicated that “boys were 15 percentage points more likely than girls to describe coding as interesting; 13 percentage points more likely to describe it as cool; and 14 percentage points more likely to describe it as important. Girls were 14 percentage points more likely than boys to characterize coding as difficult”. (Munro 2018, p. 9). They found not only a difference in the attitudes toward programming, but in the programming-related self-confidence as well: “While 41 per cent of boys say that they are somewhat or totally confident in their coding and programming abilities, only 28 per cent of girls exhibits these levels of confidence”. (Munro 2018, p. 10). They also noted that “boys’ higher self-reported confidence in their coding abilities is not necessarily evidence that they are more skilled than girls” (Munro 2018, p. 11). This is supported by the findings by Papavlasopoulou et al. (2019) who concluded that girls do not lack in related skills and competences compared to boys.

Regarding the learning outcomes while learning to code with Scratch, studies suggested no gender difference (Papavlasopoulou et al. 2019; Su et al. 2014). On the other hand, the use of other methods based on physical computing principles, decreased the gender difference in the learning outcomes (Rubio et al. 2015). Papavlasopoulou, Sharma and Giannakos (2018, p. 57) reported that “children with higher levels of excitement had the same characteristics as those who reported high learning”, indicating that the reported learning scores might be biased by the experienced level of excitement. Another study using eye-tracking to assess engagement found that “children’s level of engagement during coding activities moderates the relationships between their intention to participate in the activity and [perceived] learning” and “children’s level of engagement during coding activities moderates the relationship between their intention to participate in the activity and enjoyment” (Sharma et al. 2019, p. 71).

Concerning emotions and gender differences in the technology-based learning environments Loderer et al. (2020) found weak relationships between both positive and negative emotions and gender. Regarding designing gender specific coding activities Master et al. (2017) stated that they may backlash with unintended consequences as dividing children by gender can lead to increased stereotyping and making STEM superficially appealing for girls can lead to later disappointments. Additionally, they noted that huge individual gender differences exist among boys and girls, hence there are less technology inclined boys, and more technology inclined among girls as well. Yücel and Rızvanoğlu (2019) also emphasised the importance of developing genderless or gender-neutral activities and code-learning environments for children.

In sum, previous findings indicate a gender difference in attitude towards-, and participation in coding activities while scientific evidence supports that boys and girls are cognitively equally skilled. It has also been shown that with positive interventions children’s attitude can be positively shaped. However, the current state of art is equivocal as to whether designing gender-specific coding activities are necessary or useful for increasing girls’ participation in coding, neither is there a clear view on what factors influence children’s attitudes toward programming and knowledge acquisition.

Research aim

In the remainder of this paper we present an exploratory case study in which we set out to investigate what factors influence children’s attitude towards programming and their knowledge acquisition while learning to code, with special regards to the role of fun and state-level emotions such as happiness, excitement and control play, taking into account possible gender differences. Accordingly, we formulated the following research questions:

  • How does the workshop influence children’s emotional state (happiness, excitement and control)?

  • What factors influence children’s attitude about programming?

  • What factors influence children’s self-reported and measured learning?

  • What is the role of the experienced fun on children’s attitude about programming, the reported learning and the measured learning?

  • Is there any gender difference present in the investigated relationships?

Methods

The activity

We designed a playful coding workshop in collaboration with SkillsDojo, an open-source company that develops and disseminates technologies and applications for children aged 6–14. The workshop was a non-formal activity, building on children’s intrinsic motivation for participation, and applied a learning-by-doing approach (Kangas et al. 2017), hence, playfulness was by nature inherent to it. Furthermore, children were invited to follow a video guide, in which playfulness was reflected in the tone and introduction of the task and the visual design. Additionally, the workshop also evoked children’s creativity by encouraging them to use their own ideas to solve the tasks. For the workshop we used three of the SkillsDojo videos (www.kidzcourse.com/workshop) to introduce coding with micro:bitsFootnote 2 to children in a fun and playful way. The first video introduces the basics by teaching children how to display their names on the LED panel of the micro:bit. The second video shows children how to make a rock-paper-scissors game from the micro:bits. Finally, the third video shows children how to create their own micropet which reacts to kinetic stimuli. When selecting the videos we considered the followings:

  • Suitable for novices (the first video introduces the micro:bit and basic programming terms).

  • Difficulty increases gradually (the second video is more complex than the first, and the third one is more challenging than the second).

  • Equally suitable for boys and girls (we speculated that there is no gender difference in the liking of the stone-paper-scissors game, and that making a micro:pet is interesting for both boys and girls—especially given that children could develop their own design besides the pre-printed monkey, cat and bunny templates).

The workshop was designed as a single-occasion, two-hour long activity with the following structure:

  1. 1.

    Introduction of the topic and the structure of the workshop (5 min)

  2. 2.

    Pre-activity data collection (10 min)

  3. 3.

    Creative coding with micro:bits supported by the three videos (90 min)

  4. 4.

    Post-activity data collection (10 min)

After the introduction the researcher handed out the pre-workshop questionnaire to the children. Each child was equipped with a Chromebook and a micro:bit. Once the questionnaires were collected, children were asked to explore the micro:bits, assemble and plug them in the Chromebooks. Then, the first video was played for all on the whiteboard and was paused according to the instructions so that each child could understand the procedure and the way the videos work. After watching the first video together, children were asked to follow the second video at their own speed, each on their own Chromebook. They could work alone or together with their classmates, depending on their own preference. The teacher and the researcher were walking around in the class, helping children and facilitating interaction among classmates. Help was mainly asked when children encountered difficulties for example when their code was not working, so the researcher helped them debug their code; or when they needed technical assistance (e.g. how to save the code on the micro:bit). After the second video, children could follow the third video or they could create their own code. For making the body of the micropets children were allowed to use color pencils, glue, scissors and (pre-printed) paper. When the time was up, children were asked to tidy up their table and the post-workshop questionnaire was handed to them.

Participants

For the workshop and hence for participation in this study, Dutch teachers could sign up their classes. Despite that the workshop was held in a classroom setting during school hours, children’s participation was voluntary. Accordingly, informed consent was obtained from both the children and their parents/caretakers. The herein described study was conducted in June 2019 in a Dutch primary school with a group of 23 children between age 10 and 12 (mean = 10.96, SD = 0.767; 10 boys, 13 girls).

Prior to the workshop we asked children about their previous experience with coding across two 5-step Likert-type questions: ‘Do you have any idea about programming?’ (1—Not at all; 5—I am a pro) and ‘How many coding workshops have you participated before?’ (1—None; 5—Six or more). 26.1% (6 children) report on not having participated before in any coding-related workshop and 30.4% (7 children) report on having no previous knowledge on programming.

Measures

To address children’s emotions, attitude, learning and the fun they have experienced during the workshop, we used a number of previously validated measurement tools.

At the beginning and at the end of the workshop for the measurement of children’s state-level emotions we used 5-step bi-polar scales (happy–unhappy, calm–excited, controlled–feeling in control). These pairs were selected from the Semantic Differential Scale (Mehrabian and Russell 1974) and highly correlated with the dimensions of the Self-Assessment Manikin (Bradley and Lang 1994), which are both developed for the assessment of affective reactions. The internal consistency of the three emotional bipolar scales is acceptable (α > 0.6; Hair et al., (2014)) (Cronbach’s αpre-workshop = 0.772, αpost-workshop = 0.939).

To assess children’s attitude (i.e., feeling or opinion about something) towards programming we used a single item measure that addresses children’s general attitude about the topic: ‘Programming is my thing’. This item we have consciously selected from earlier research (Tisza and Markopoulos 2021a) based on its simplicity, general nature and validity provided by cross-validation. The general reliability of single-item measures in comparison with multiple item measures was proved by earlier research (Bergkvist and Rossiter 2007).

For the assessment of fun, at the end of the workshop we recorded FunQ (Tisza and Markopoulos 2021b). FunQ is questionnaire that is specifically developed for and validated with adolescents for the assessment of the experienced fun while learning. The questionnaire is evaluated across eighteen 5-step Likert-type questions along six dimensions. The internal consistency of the scale in the current sample is acceptable (Cronbach’s α = 0.784). Autonomy measures whether one feels in control over their participation (i.e., voluntary participation or not) and the activity (i.e., Does one feel they can have an influence on what happens during the activity?). Challenge assesses the experienced challenge. Delight monitors the positive emotions and related desires. Immersion measures the loss of time and space. Loss of Social Barriers measures social connectivity. Finally, Stress monitors negative emotions.

For the assessment of learning, we utilized two measures that address different levels of learning according to Bloom’s taxonomy (Bloom 1956). The self-reported measure (i.e. reported learning; linked to the Evaluation level) measures children perceived learning. Considering that knowledge tests can never cover every single detail of a learning process, hence usually fail to capture all learning that has taken place, self-report measures can be a good indication for learning given that they provide the respondents the freedom to take aspects into account that have not been investigated by the knowledge test. Reported and measured learning have thus a complementary nature, as reported learning has the potential to capture learning that is not examined by the knowledge assessment test. For the measurement of the reported learning we used a single-item measure, adopted from earlier research (Papavlasopoulou et al. 2018; Tisza and Markopoulos 2021a).

The knowledge assessment test (linked to the Knowledge level) addresses the factual knowledge children gained as a result of the workshop. We administered the knowledge assessment test both before and after the workshop. The knowledge assessment test was developed by the researchers in agreement with SkillsDojo. It contained seven questions with four response options. Four out of the seven questions were about terms related to programming, which are introduced and explained during the videos (e.g. “What/Who is a variable?”). Three questions were on programming scripts that are the foundation of the workshop and their way of working is explained thorough in the videos (see example Fig. 1). Accordingly, the knowledge test aligns well with the learning objectives of the video content. The measured learning was calculated by subtracting the pre-workshop knowledge assessment scores form the post-workshop scores as suggested by previous research in the field (Sim et al. 2006). Using difference scores is a commonly accepted way among educators for addressing learning gain, and its reliability has been proven by various authors previously (Bezruczko et al. 2016; Ragosa and Willett 1983; Thomas and Zumbo 2012; Zimmerman and Williams 1982). The internal consistency of both the pre- and post-workshop test is acceptable (Cronbach’s αpre-workshop = 0.708, Cronbach’s αpost-workshop = 0.818).

Fig. 1: Example from the knowledge assessment test.
figure 1

The figure shows questions 6 of the knowledge assessment test, the related block of code and the four response options.

The completion time for both the pre- and post-workshop questionnaires was approximately 10 min. The dimensions investigated by the questionnaires are summarized in Table 1.

Table 1 The investigated dimensions, their operational definitions and their respective measures.

Data analysis

For the data analysis SPSS Statistics version 25 software was used. For the assessment of the attitude and emotional state change, and for the learning gain, paired-sample t-tests were applied. The effect of gender on the aforementioned relationships was tested by repeated measures ANOVA. Correlation analysis was applied to investigate the relationship between the measured variables, and we used linear regression to test influential factors on children’s attitude, on the fun they experienced while learning, and on their learning outcomes.

Results

Emotional state and attitude toward programming

We aimed to assess whether the workshop affected children’s attitudes towards programming. Therefore, we asked children to indicate on a 5-point smiley-face scale whether they think that programming was their thing at the beginning and at the end of the workshop. Paired sample t-test indicates that children’s attitude toward programming changed significantly (p = 0.012, t = 2.732, Cohen’s d = 0.570). In other words, children found programming at the beginning of the workshop less of their thing (mean = 3.39, SD = 1.118) than at the end of the workshop (mean = 3.96, SD = 1.107).

We also investigated whether children’s state-level emotions changed in the course of the workshop. Hence, we asked children to indicate their emotional state on three bipolar scales at the beginning and at the end of the workshop. We found that children felt significantly happier (p = 0.035, t = 2.297, Cohen’s d = 0.541), more excited (p = 0.003, t = 3.543, Cohen’s d = 0.859) and more in control (0.041, t = 2.236, Cohen’s d = 0.559) at the end of the activity than at the beginning of it.

To assess whether is a gender difference in the above described tendencies, we tested the effect of gender applying repeated measures ANOVA. The results suggest no significant gender difference in the attitude change (p = 0.253, F = 1.384, partial η2 = 0.062) or in the attitude scores (ppre = 0.123, t = 1.608, Cohen’s d = 0.669; ppost = 0.597, t = 0.536, Cohen’s d = 0.226) and (see Fig. 2). Additionally, we found no significant gender difference on the reported emotional states: neither happiness (p = 0.755, F = 0.101, partial η2 = 0.006), nor excitement (p = 0.381, F = 0.815, partial η2 = 0.052), nor feeling in control (p = 0.200, F = 1.806, partial η2 = 0.114) appears to be gender dependent. Thus, the workshop had the same effect on both girls and boys.

Fig. 2: Attitude change: ‘Programming is my thing’ scores before and after the workshop.
figure 2

The chart shows per gender students’ attitude change.

Regarding the participants’ previous knowledge, we found that at the beginning of the workshop boys reported significantly higher values than girls for the question whether they have any idea about programming (p = 0.005, F = 9.964, η2 = 0.333). This significant difference does not hold true for the number of coding workshops boys and girls had participated in (p = 0.057, F = 4.124, η2 = 0.186).

Influential factors on children’s attitude about programming

To start with, we applied correlation analysis to investigate the relationship between children’s post-workshop attitude about programming and their pre-workshop attitude, pre- and post-workshop emotional states, the level of fun (FunQ), happiness (FunQ Delight) and stress (FunQ Stress) they have experienced during the workshop and their learning outcomes. The analysis reveals an association between children’s post-workshop attitude and the pre-workshop attitude score (r = 0.602, p = 0.002), the pre-workshop emotional state excited (r = 0.501, p = 0.025), the Delight dimension score of FunQ (r = 0.436, p = 0.048), the Stress dimension score of FunQ (r = −0.478, p = 0.038), and the reported learning (r = 0.524, p = 0.012) and measured learning (r = 0.432, p = 0.040) scores.

To determine the direction of the relationships found by the correlation analysis, we applied a stepwise regression analysis to model children’s post-workshop attitude scores. We added the pre-workshop attitude, pre- and post-workshop emotional states, the level of fun (FunQ), happiness (FunQ Delight) and stress (FunQ Stress) they have experienced during the workshop and their learning outcomes as possible predictors. The analysis resulted in three consecutive, nested models. The final model, Model C explains the 87.2% of the variance (R2 = 0.872). The significant predictors in the model are the measured learning (p = 0.001, t = 4.877, βstd = 0.618), the pre-workshop attitude score ((p = 0.006, t = 3.661, βstd = 0.482) and the perceived learning (p = 0.017, t = 2.995, βstd = 0.394).

Learning outcomes

To assess whether children learned during the workshop we used a knowledge assessment test and a self-report measure. In this section we introduce the study findings in relation to learning.

Reported learning

To assess the perceived learning, at the end of the workshop we asked children to indicate on a 5 step Likert-type scale whether they learned something new during the workshop (see Table 2). On average, children reported to have learned much (mean = 4.05, SD = 0.899). Independent sample t-test indicates no significant gender difference in the reported learning scores (p = 0.510, t = −0.671, Cohen’s d = −0.291). The results indicate that we did not encounter a ceiling effect.

Table 2 ’Have you learned something new today about programming?’ response rates. 1 response (4.2%) is missing.

Measured learning

We compared how children scored on the knowledge assessment test at the beginning and at the end of the workshop to assess whether they gained factual knowledge (see Fig. 3). The average score on the pre-workshop test is 4.09 (SD = 1.98), while the average score on the post-workshop test is 4.96 (SD = 2.18). We conclude that we did not encounter a ceiling effect. Paired sample t-test shows that in general, children scored significantly higher on the post-workshop knowledge assessment test on the pre-workshop test (p = 0.016, t = −2.600, Cohen’s d = −0.542). To calculate the learning gain, we subtracted the pre-workshop knowledge test scores from the post-workshop knowledge test scores. Independent sample t-test indicates no significant difference between genders (p = 0.667, t = −0.436, Cohen’s d = −0.184) in their learning gain (i.e., measured learning). Both the pre- and post-workshop knowledge test scores were higher for boys, but not significantly (ppreworkshop = 0.285, t = 1.098, Cohen’s d = 0.462; ppostworkshop = 0.521, t = 0.653, Cohen’s d = 0.275).

Fig. 3: Knowledge assessment test scores before and after the workshop.
figure 3

The chart shows per gender the knowledge assessment scores before and after the workshop.

Influential factors on children’s learning

In order to assess how different factors influence learning, we applied linear regression analysis with stepwise selection, using both the reported- and the measured learning as outcome variables. As predictor variables we used the pre-workshop programming experience, the pre- and post-workshop attitude, pre- and post-workshop emotional states, and the level of fun (FunQ), happiness (FunQ Delight) and stress (FunQ Stress) children have experienced during the workshop.

Reported learning

When modelling the possible influential factors of the reported learning (i.e. “Have you learned something new today about programming?”) the regression analysis finds that the post-workshop in control emotional state is the only significant predictor (p = 0.024, t = 32.714 βstd = 0.671), explaining 45.0% of the variance of the measured learning scores (R2 = 0.450). From these results we conclude that children with high reported, thus perceived learning were the ones who felt in control at the end of the workshop.

Measured learning

When modelling the possible influencing factors of the measured learning (pre-workshop learning assessment score subtracted from post-workshop score) the regression analysis results in a single significant predictor. The FunQ Stress score explains the 63.9% of the variance of the measured learning scores (R2 = 0.639; p = 0.003, t = −3.993, βstd = −0.799). Explaining the findings we conclude that children with high learning gain were the ones who experienced low levels of stress during the workshop.

Fun

For assessing the fun value of the workshop, we recorded the FunQ (Tisza and Markopoulos 2021b) with the participating children at the end of the workshop. For the statistical testing we reverse coded the Stress dimension, summed the scores of each dimension, and we calculated the grand total FunQ score as well (possible minimum score is 18 and possible maximum score is 90). The calculated grand total FunQ score ranges between 49 and 84 (mean = 70.06, SD = 10.18) of which we can conclude that approximately covers the higher half of the possible score range.

Regarding the average scores on the separate dimensions (possible minimum score is 3 and possible maximum score is 15 on each dimension), we can conclude that the Stress factor (negative emotions) has the lowest average score (mean = 4.11, SD = 2.35) while the Delight factor (positive emotions) has the highest (mean = 13.14 SD = 1.90). Based on the separate dimension scores and the grand FunQ score we conclude that the workshop was stressful for children, it evoked positive emotions and children experienced it as fun. This finding is further supported by the spontaneous positive feedback by the teacher the day after the workshop: “This morning I asked my class about yesterday’s lesson. All of them were very enthusiastic. Group 8 said that they will be jealous if we could do this lesson again next year!!”

We investigated whether is a gender difference in the grand total FunQ scores between boys and girls. The results of the independent sample t-test suggest that girls and boys experienced the workshop equally fun as no significant difference found between them (p = 0.932, t = 0.086, Cohen’s d = 0.047). Furthermore, there was no significant difference found between boys and girls for the separate dimension scores of the FunQ (pautonomy = 0.645, t = 0.468, Cohen’s d = 0.214; pchallenge = 0.950, t = −0.063, Cohen’s d = −0.028; pdelight = 0.461, t = −0.752, Cohen’s d = −0.332; pimmersion = 0.955, t = −0.057, Cohen’s d = −0.026; plossofsocialbarriers = 0.190, t = −1.364, Cohen’s d = −0.634; pstress = 0.807, t = 0.248, Cohen’s d = 0.118).

For modelling fun—as measured by the FunQ sum score—by linear regression we used the pre-workshop programming experience, the pre- and post-workshop attitude, the pre- and post-workshop emotional states, and the reported and measured learning scores as possible predictors. The analysis resulted in two nested models. The more complex model, model B explains the 78.1% of the variance (R2 = 0.781) and has the number of workshops the child previously participated in (p = 0.001, t = 5.317, βstd = 1.058) and the pre-workshop attitude score (p = 0.036, t = −2.524 βstd = −0.502) as significant predictors. In other words, children’s positive attitude at the beginning of the workshop had a negative effect on the experienced fun during the workshop, while the previous experience with coding (measured by the number of workshop students participated before) had a positive effect on the experienced fun. This previous finding, we speculate, could be due to expectation-management, but we propose further examination.

Discussion

Increasing children’s engagement in STEM fields and in computer science in specific has become a worldwide pursuit, however, our knowledge is limited on influential factors on children’s’ willingness to participate in related activities. Among the underlying reasons the importance of emotions has been argued, but there is as yet no scientific consensus on which emotions and in what ways play a key role in the technology-based learning environment (Graesser 2019). As indicated by Mayer (2019), there is a need for broadening our knowledge on emotions that play a key role on learning and for the understanding the causes and consequences of those. While the effect of some emotions in the academic environment has widely been studied in the last decades, our understanding on the key influential factors on the willingness to learn programming is more limited. A second possible influential factor on children’s’ interest and willingness to participate in science-related activities could be children’s attitude towards STEM subjects, and closely related to this, their gender, as earlier research often found that boys, in general, bear with a more positive attitude towards scientific topics than girls (e.g., Master et al. 2017; Munro 2018; Yücel and Rızvanoğlu 2019). Furthermore, observations from informal and non-formal science learning places (such as FabLabs, coding clubs, and hackathons) suggests the importance of having fun while learning about scientific topics.

In accordance, the herein introduced research aimed to expand our knowledge on the possible factors that potentially influence children’s attitude toward coding, hence, indirectly affect their willingness for participation in coding activities. Along with children’s programming-related attitude, we investigated their state-level emotions and the experienced fun, and possible interactions between those and the reported and measured learning, while controlling for gender differences. For this purpose, we collected data from Dutch primary school students before and after participating in a playful coding workshop. The results showed that children’s attitude and state-level emotions positively changed during the workshop, that children’s attitude is greatly influenced by the experienced stress and fun, and that the state-level emotions and the experienced stress play a key role on the measured learning accordingly. Throughout our analyses, we found no significant gender differences.

Evaluating the workshop in general, we conclude that children found it fun and it had a positive influence on their emotional state. Children felt happier, more excited and more in control at the end of the workshop than at the beginning of it regardless their gender. Therefore, we suggest for designers of similar learning activities to build on playfulness, as it makes the activity inviting in advance and engaging while it lasts, and it positively influences children’s emotional state. A noteworthy finding is that at the beginning of the workshop boys reported higher values for the question whether they have any idea about programming than girls. While we cannot check the validity of these claims, we emphasize that boys programming-related self-confidence can play a role just as found at Canadian children (Munro 2018). Such an explanation is supported by the fact that boys’ attitude about programming was more positive at the beginning of the workshop than that of the girls. Nevertheless, children’s attitude about programming—regardless of their gender—changed significantly and positively during the workshop. This finding aligns with previous work indicating that interacting with visual programming environments influences positively children’s attitude toward programming (Gunbatar and Karalar 2018; Sáez-López et al. 2016) and that after the interaction no significant gender difference is present in children’s attitude toward programming (Gunbatar and Karalar 2018; Kalelioǧlu 2015; Kalelioǧlu and Gülbahar 2014; Zuckerman et al. 2009). However, previous studies did not examine possible underlying effects.

Addressing the research question on possible influential factors on children’s attitude about programming, our research indicates that experiencing excitement at the beginning of the workshop and having a sense of learning during the workshop has a positive impact on children’s attitude about programming let them be boys or girls. However, we also found that the experienced fun was affected by children’s initial attitude about programming and the number of coding activities they have participated previously. This reflects the reciprocal relationship—known from cognitive psychology (Kim and Pekrun 2014)—between emotions, cognitive processes and strategies, decision making and motivation. Accordingly, for similar activities in the future we propose the introduction of the activity in advance in a way that makes children excited about the topic as being excited at the beginning of the activity can have a positive effect on participants’ attitude about programming.

Concluding the learning section, we found that when children felt more in control of their participation then they felt like they have learned a lot, but in fact, they learned more when the level of perceived stress/negative emotions was low. Therefore, for the designers of similar activities we suggest providing participants with the freedom of choice, as feeling in control can contribute to their perceived level of learning but aim to keep the level of stress low as this can have a downshifting effect on the learning gain.

Regarding the learning gain, both the reported and the measured learning indicated that children learned during the course of the workshop regardless their gender. While some of the above-referred studies have examined the learning outcomes in terms of self-reported measures (Sharma et al. 2019), our study results highlights the need for examining various levels of learning given that they are complementary in nature. As a knowledge assessment test can never capture all learning that has taken place, the reported learning provides students with the freedom to consider additional elements of learning (e.g., soft-skills) that are not scrutinized by the knowledge test. Therefore, it is important to take into account that the reported learning is complementary to the measured learning, and hence, related scores might not be overlapping. In our study we found that children’s reported learning has a positive association with their state-level emotions - also found by (Papavlasopoulou et al. 2018) -, and that the measured learning is negatively influenced by high levels of stress. These latter results are in synchrony with Pekrun’s control-value theory (Pekrun 2014) with regards to negative deactivating emotions. We conclude that high arousal negative emotions interfere with active engagement with the task, therefore with the learning process as well.

Our results on the influential role of fun on learning are in contrast with the previous findings of Sim et al. (Sim et al. 2006) and Iten and Petko (Iten and Petko 2016) who did not find significant correlation neither between the observed nor the reported fun and the learning outcomes. They are in line with the work of others (Nandi and Mandernach 2016; Papavlasopoulou et al. 2018; Sáez-López et al. 2016), who discussed the coding activity in terms of students having fun while the coding activity increased students’ attitude toward coding and their learning outcomes and observed a higher GPA among hackathon participants compared with non-participating student—although in those studies researchers did not examine the relationship, just report on the co-existence. According to our findings, we propose for successful coding activities in the future to be challenging enough, but not too much, thus, to meet the knowledge level of the participants to keep participants engaged while not stressing them with a too difficult task as stress can have a downshifting effect on the measured learning. Additionally, we suggest making similar activities fun as it can contribute to participants’ positive attitude about programming.

Since in our study we did not encounter the previously frequently reported gender differences (e.g., Master et al. 2017; Munro 2018; Yücel and Rızvanoğlu 2019), we presume that this can be partially originated from the design of the learning activity. Therefore, we emphasize the importance of making similar activities inclusive by selecting the topic, content, and used material suitable for both genders, along with using visual programming environments, which have the potential of overcoming the gender gap in attitudes about programming.

In sum, previous findings indicated a gender difference in attitude toward coding that could be positively shaped and hence equalized by providing positive coding experiences for children, e.g., by introducing coding with a visual programming environment. Our study results provide further support for such findings. However, the current state of the art has no clear view on what influences children’s attitude toward programming, and hence their willingness for participation in coding activities. Our research contributes greatly to a better understanding of children’s programming-related attitude by investigating possible underlying factors, and the interplay of those with the learning outcomes. Based on the herein introduced results we conclude that children’s attitude about programming is greatly influenced by their learning experience and is in relation with the experienced fun while learning to code, which has further impact on knowledge acquisition. Crucially, our study suggests that related research needs to attend to the difference due to the complementary nature of the reported and the measured learning, which can explain contradictory or surprising results of earlier studies. Further, our results draw attention to the downshifting effect of high arousal negative emotions on the measured learning. Further studies in different contexts are needed to be able to draw such generalized guidance and a more detailed picture on the possible influential factors and key-emotions in the technology-based learning environment. We call for further investigation on the role that fun plays on learning in general, and on learning to code in specific, and the investigation of the long-terms effect of the interventions on children’s attitude change toward programming.

Limitations and future work

The herein introduced exploratory case study has been conducted with one school class. As a consequence, our findings are not representative for all. Replicating the study in different contexts eventually with more students would be beneficial for the assessment of the generalizability of the results. Additionally, by the application of quantitative methods, future research could investigate in-depth and explain the stated relationships. Moreover, future research should address the long-term effects of such interventions on children’s attitudes to cover the existing research gap noted by Master et al. (2017).