Keywords

1 Introduction

Game-based teaching is the integration of game elements and design concepts into the teaching process to stimulate students’ learning motivation and make them actively participate in the classroom so as to promote students’ learning effect [1]. With the development of information technology and the update of game-based teaching theory, teachers can create a relaxed and happy teaching situation by adding reasonable game elements into the teaching design, and fully mobilize students’ intrinsic motivation, so as to achieve the purpose of improving the teaching effect [2]. At the same time, experiments have been conducted to prove that gamification has a significant positive impact on computer subjects [3].

Under the influence of national strategic development requirements, Chinese primary and middle schools are actively implementing programming courses, aiming to cultivate innovative talents with hands-on skills and computational thinking. Through a questionnaire survey of a sample of primary and middle schools nationwide, it was found that 93.49% of middle schools offer AI-related courses, such as programming courses, robotics courses, and maker courses [4]. However, the programming teaching system offered by most schools needs to be improved, teachers mostly adopt traditional teaching methods in teaching programming, and teachers’ teaching ability of programming education needs to be improved. Therefore, how to design and conduct an effective programming classroom, combine programming education with students’ cognitive characteristics, and design interesting teaching activities to stimulate learning motivation is the current problem that needs to be solved in middle school programming education.

Python is one of the most popular programming languages today, with features such as simple syntax, intuitive and easy to learn, and support for rich third-party libraries, which is suitable for beginners to learn programming. At present, Python language has become an important part of learning in China’s middle IT education, and is the mainstream language for middle programming education [5].

In primary and middle school programming education, children at the elementary school level mainly use Scratch, a graphical programming software from MIT, to learn programming. Scratch has a clear and concise interface and uses a modular command language that allows students to create simple animations and interactive games, making it an enlightening tool for children’s programming education [6]. The Python language, on the other hand, is a new addition to middle school programming education in recent years. It is difficult to learn from the experience of teaching programming at the elementary school level, and the specialized Python teaching system at the higher education level cannot be applied to adolescents at the middle school level, and in general, middle school Python programming education has just started recently and is still at the stage of development in exploration [7].

For the application of Python teaching in Minecraft, Sun,D and Li,Y selected 20 seventh grade students in Hangzhou, China, who had never been exposed to programming before, and randomly divided the 20 students into 10 groups of two students for pair programming to write, debug, and run the python language in Minecraft. The results of the study showed that students’ creativity, critical thinking, and their attitudes toward programming improved after learning to program in the python language in Minecraft [8]. Andrei Grigorivich uses the Minecraft game environment for python language programming to learn loops and discusses the possibility of using python programming in primary and middle schools [9]. This shows that there are advantages of Minecraft in teaching programming and that there is a possibility of applying Minecraft to teaching programming in middle school.

In this context, based on the investigation of the current situation of middle school programming education, this paper uses the sandbox game minecraft as a teaching tool and applies it to middle school python programming education based on gamification teaching theory. Using minecraft game to design the framework and content of middle school programming teaching activities, attract students’ interest in learning, stimulate learning motivation, and cultivate middle school students’ computational thinking, creative thinking and problem solving ability. This paper uses gamification instead of traditional teaching to provide new directions and ideas for middle school programming education exploration, thus achieving the purpose of promoting the development of middle school programming education.

2 Teaching Design of Python Programming in Middle School Based on Minecraft

2.1 Teaching Objectives and Content Analysis of Python in Middle School

Based on the series of high school information technology textbooks published by Shanghai Education Edition of China, the teaching objectives of programming at the middle school level can be summarized as enabling students to use a programming language to write programs, implement simple algorithms, experience the whole process of computer problem solving, and improve the ability of using information technology to solve problems [10].

The teaching content of Python programming language in the book includes the following Table 1:

Table 1. Main Contents of Python Programming Teaching in Middle School

It can be seen that the teaching of Python in middle school includes the basic understanding of programming, the basic syntax and functions of python, nested modularization and so on.

2.2 Gamification Teaching Environment Design

To carry out minecraft programming in the middle school, we first need to build a teaching environment, including a multimedia teaching environment, a game platform environment and a code editing environment.

The multimedia teaching environment is the place where teachers and students communicate with each other and issue tasks. You can use software such as Tencent conference or electronic classroom management system.

Game platform environment is the environment that supports python programming in minecraft, including minecraft game, java runtime environment, minecraft bukkit server, and RaspberryJam plugin [11].

The code editing environment is the Python programming environment, including python and pycharm.

2.3 Gamified Teaching Activity Design

Game-based teaching design is to integrate game elements into the classroom teaching process with the understanding of teaching contents and purposes, so that students can learn in an interesting and educational teaching environment and thus enhance the teaching efficiency [12]. In this paper, the specific design of game-based teaching activities includes four parts: introduction, teaching, practice and evaluation. The details are shown in the Table 2:

Table 2. Design of Game Programming Teaching Activities

2.4 Gamification Teaching Task Design Outline

Based on the middle school python teaching objectives and content, combined with the characteristics and knowledge of minecraft game, the following programming teaching task outline is designed. The details are shown in the Table 3:

Table 3. Game Programming Teaching Task Design Outline

3 Gamified Teaching Evaluation Design

Gamified programming teaching activities based on minecraft are different from traditional classroom teaching. Traditional teaching evaluation emphasizes learning the mastery of objective knowledge and cultivating learners’ ability to integrate cognition, which pays too much attention to the results and does not reflect objectively and comprehensively on teaching evaluation. Game-based learning not only focuses on the mastery of learning contents, but also emphasizes students’ interest, problem-solving ability, and computational thinking [13]. Therefore, the evaluation of this gamified programming teaching is carried out in the following three aspects.

3.1 Questionnaire Survey on Students’ Interest in Programming

In this paper, we refer to Deng Rui’s “Computer Students’ Interest in Learning Scale” from Hunan Normal University for the design of the questionnaire, including pre-test and post-test. This questionnaire has been tested and modified by Si-Xin Gao and Yu-Yue-Wen for many times with good reliability and validity, and it is a mature test scale [14]. The questionnaire was divided into five response levels using the Likert option, i.e. 1. strongly disagree 2. disagree 3. neither agree nor disagree 4. agree 5. strongly agree. Reliability and validity analyses were conducted before the use of the questionnaire. The pre and post test questionnaires are specified in the following Table 4 and Table 5.

Table 4. Questionnaire on Students’ Interest in Programming (pre-test)
Table 5. Questionnaire on Students’ Interest in Programming (post-test)

3.2 Student Python Performance Evaluation

The python language paper is divided into five types of questions: multiple choice, judgment, program reading, program fill-in-the-blank, and program design, for a total of 15 questions and 100 points [15].

3.3 Student Interviews

The purpose of designing follow-up interviews with students is mainly twofold: first, to understand students’ interest in the gamified learning course through direct communication and to understand students’ interest in learning python. Second, the students who participated in the teaching case study will inevitably have certain learning experiences generated in the learning process, so it is important to understand their feelings about the learning process from the students’ perspective and ask their opinions about the teaching design, so as to provide reference for the subsequent teaching improvement. The student interviews were conducted in three main dimensions: firstly, students’ feelings about this gamified programming teaching, whether they had unique effects and feelings under the new teaching method; secondly, we investigated students’ process situation in this gamified teaching, including difficulties and knowledge mastery; and thirdly, the impact of gamified teaching on students’ interest in learning programming in the future. The outline of the interview is shown in the following Table 6.

Table 6. Student Interview Outline

4 Analysis of the Implementation and Results of Teaching Python Programming in Middle Schools Based on Minecraft

4.1 Implementation of Teaching Activities

The gamified programming teaching activity was conducted in L city. The experiment was conducted as an online interest class during the winter break due to the coronavirus, and the number of experimental students was controlled to 50, with gender parity of students as much as possible. Due to the ample time available during the winter break, each student was able to learn the entire course systematically. The course implementation process followed the instructional activity design and task outline. The subjects were randomly divided into two classes, A and B. Class A was randomly selected as the control group and class B as the experimental group. Class A was taught with traditional Python programming and class B was taught with gamified programming. In order to reduce errors and control irrelevant variables, both class A and class B were taught by the author as the teacher.

The teaching experiment was conducted using a quasi-experimental research method, and the study used a pre- and post-test experimental design with an experimental group and a control group. The details are shown in the Table 7:

Table 7. Experimental Design

The research process was divided into three main steps.

Pre-experimental Test:

The subjects were randomly grouped, informed of the experimental purpose and experimental requirements, and issued programming interest questionnaires for the pre-test.

Experimental Process:

According to the activity design and task outline of minecraft-based middle school python programming teaching, the experimental group B was taught. The project-based teaching was conducted for the control group A according to the Shanghai version of the high school IT textbook. The total duration of teaching was 18 class hours, 45 min per class, divided into three weeks.

Experimental Post-test:

The same set of high school python language test papers were distributed to control group A and experimental group B at the end stage of the course, post-test programming interest questionnaires were distributed, and student interviews were conducted.

4.2 Teaching Case Presentation

This part of the author chose the fourth teaching theme of Pyramid to demonstrate the educational case, due to the whole lesson time is long, the following will be a brief demonstration of the teaching process.

Introduction Before Class:

Teacher leads students into a virtual campus in Minecraft and tells them the legendary story of the Egyptian pharaohs and the pyramids and the unsolved mystery of how the ancient Egyptians built the pyramids. The teacher briefly introduces the structure of the pyramids, asks students to recall the way they placed gold blocks in minecraft using Python code, and thinks about how to build pyramids in minecraft using python programming.

Teach Knowledge:

Teacher explains the for loop structure in Python and demonstrates the use of for loops to print all integers between 1 and 99. After students have basic knowledge of the syntax of the for loop, the teacher again explains the structure of the pyramid, shows the Python code that uses the for loop to build the pyramid, and explains to students the meaning of each line of code:

figure a

Practice Consolidation:

Teacher guides students to build their own pyramids using different cube materials. In this process, students conduct independent investigation and practice, and the teacher gives timely guidance to students’ problems.

Summary and Evaluation:

Teacher randomly selects students to run the programs they have written and then shares the results with the group, organizes other students to comment on them, and students compare and reflect on the programs they have written and improve them. Finally, the teacher will summarize the learning of the lesson.

4.3 Analysis of the Results of Teaching Activities

Analysis of Students’ Programming Interest Results:

In order to test the significance of the differences between the three dimensions of the pretest data of control group A and experimental group B, the author conducted independent samples t-test on the pretest data of the three dimensions of programming interest of control group A and experimental group B. The scores of the three dimensions of programming interest, affective, cognitive, and behavioral, overall, were 10, 15, 15, and 40, respectively. The specific data analyzed are shown in Table 8.

Table 8. Pre-test Data Analysis of Programming Interest of Control Group and Experimental Group

In order to test the significance of the difference between the three dimensions of post-test data of control group A and experimental group B, the author conducted an independent sample t-test on the post-test data of three dimensions of programming interest of control group A and experimental group B. The overall scores of the three dimensions of programming interest, emotion, cognition and behavior, are 10 points, 15 points, 15 points and 40 points respectively. See table for specific analysis data. The specific data analyzed are shown in Table 9.

Table 9. Post-test Data Analysis of Programming Interest of Control Group and Experimental Group

The mean values of each dimension are shown in the table, and the analysis of the results shows that the post-test mean value of each dimension has increased to different degrees compared to the pre-test mean value, with the cognitive dimension increasing the most, by 1.2 points, and the behavioral dimension increasing the least, by 0.76 points.

From the analysis results, it can be seen that the overall p-value of programming learning interest is 0.000, which is much less than the 0.05 significant level, which can prove that there is a significant difference in students’ programming learning interest before and after the experiment of gamified programming teaching. The behavioral dimension p = 0.065 has increased but not significantly, while the affective dimension p < 0.01 and the cognitive dimension p < 0.01 have increased significantly.

Analysis of Student Performances:

In this study, the python language test was administered to students in control group A and experimental group B through high school python language test papers, and further independent sample t-tests were conducted on the python test scores of the two experimental groups, and the results of the analysis are shown in the following Table 10.

Table 10. Data Analysis of Python Performance of the Experimental Group in the Control Group

The results of the independent sample t-test for the results of the experimental group of the control group showed that the mean value of the results of the control group was 83.76 and the mean value of the results of the experimental group was 83.16, p > 0.05, the difference was not significant, indicating that the results of the python results of the experimental group of the control group were similar and did not change significantly.

4.4 Student Interview Analysis

The student interviews were conducted by online voice after the course, and the interviews were recorded and analyzed descriptively. Ten students were randomly interviewed in the experimental group, and the interviews focused on three aspects: feelings, process, and interests.

In terms of feelings, the interviews showed that the students had a strong interest in programming and a new understanding of it after the teaching activities, and they highly approved of the game-based teaching method. “It feels fun to learn programming in a game”. Students said that learning in a game environment greatly increases their learning autonomy, that they pay high attention to the teaching objectives arranged by the teacher, and that they have more autonomy in learning compared to traditional teaching.

In terms of process, the interviews showed that the students basically mastered the programming knowledge in the course and could recall the basic parts of the class, but when it came to the difficulties in the learning process, some of them mentioned that “the learning content was increased because there were more game operations in the course.” The introduction of games as an educational medium in the teaching process makes it difficult to grasp the depth and breadth of the teaching content compared to traditional teaching, and slightly increases the learning task of students, which is a key issue to be addressed in the future to improve the teaching of game-based programming.

In terms of interest most of the students expressed their expectation for the new curriculum of gamified programming and said they would pay attention to courses and books about programming in their lives and hope to master the new programming language and work in programming-related jobs in the future. It significantly reflects the role of gamification teaching in promoting students’ interest in learning.

5 Conclusion

Due to the current situation that some teachers lack of appropriate teaching methods in middle programming education, the author use Minecraft to develop the teaching of python programming which based on the theory of gamification teaching in middle schools. According to the analysis of the results of the teaching experiment, compared with those who received traditional teaching, students who received gamification teaching have approximately equal scores in python class, while they are more interested in learning, especially in the affective and cognitive dimensions. And they have a new understanding of programming learning and a willingness to work in programming in the future, which proves the feasibility and effectiveness of gamification teaching in the field of middle school programming education. Applying the concept of gamification in the process of programming teaching and making students learn driven by game tasks can improve the teaching effect and students motivation. This game teaching mode provides a new idea for middle school programming education and shows the great potential of applying gamification teaching in programming education, which is important for the development of middle school programming education.