The traditional method in classroom teaching faces many practical problems, such as low teaching efficiency for teachers and low learning enthusiasm for students. With the rapid development of computer and information technology, in order to solve this problem, the computer learning systems have received extensive attention for their convenience, intuitiveness, efficiency and interactive advantages，and have become a promising learning tool in the field of education. Some teams have developed different types of learning systems for courses such as physical chemistry experiments, computer technology, electronic and electrical engineering   . Learning systems for learning computer programming has been greatly developed  .
In recent years, 3D virtual reality technology (VR) has gradually become a hot field. However, the basic problems involved in VR are mostly abstract and difficult to understand, such as virtual scenes, physical effects, animation and human-computer interaction, and there is no real-time 3D observation, this is the reasons why students cannot really understand the concepts of 3D simulation, and become an obstacle to programming learning and stimulating students’ learning motivation. In the existing programming learning system, there is no system to compile the code written by the students in real time to control the objects in the virtual scene, so this method has great development potential in the programming learning system.
In order to realize the above method, this paper designs a VR learning platform for Unity 3D, which as a powerful development tool is widely used in VR field. This platform has a Unity 3D programming interface, which sends C# codes to the console for compiling through Socket communication. If the compilation is successful, the console compiles the code into a DLL file. The system then creates class objects in the DLL file by reflection technology, and dynamically applies these objects to game objects in the 3D scene. The interactive interface can be linked to the corresponding website with learning resources. The advantage of this method is that students can learn programming directly and easily, and obtain learning resources on the Internet, which greatly changes the shortcomings of traditional teaching methods.
2. Related Work
The learning systems for computer programming employed different learning modes, for example, an C++ object-oriented programming laboratory course with framework-assisted is a highly effective way for students to broadening and deepening their object-oriented programming skills . Scratch, one of the most widely used programming environments using functional programming approach, is a learning tool with a drag-and-drop interactive environments . But a simple interface of drag-and-drop interaction is not enough, and it may lead students to build without considering reusability, so in the programming learning system, computational thinking as an important part is introduced, students can design their own solutions . The C language e-learning platform developed by the team of Munich University of Technology embeds a parameter input window and an output window right after the editor, the programmed code may be saved, executed and verified during the execution, and writes the compiler results back to the user’s screen in the browser . The results show that students can solve practical tasks actively. By changing the initial conditions and comparing the results of practice with the expected results, free experimentation and reflection could be achieved .
The integration of computer games into the learning system has been verified by a number of studies as a student-centered learning platform. Educational computer game will provide an interaction context for the students. Role-playing game enable students to collect necessary knowledge in the course of games to solve the problems in learning object-oriented programming, and students could get back the feedback or response immediately . Students can easily understand concepts through participation and interaction. Studies have shown that by analyzing the design of tutorial components and entertainment components, in contrast to games, the learning environment is characterized by extensive learning support and an obvious programming focus . At the same time, timely feedback can improve students’ enthusiasm for learning. In the research of Intelligent Tutoring System Based on flow chart, a Tic-tac-toe online game is designed, which applies the decision process of Bayesian network. Students interested interact with the game and get back the feedback or response immediately. The results show that providing feedback information is more conducive to improving students’ knowledge acquisition through the learning process .
From the above related work, it is important for students to acquire important knowledge concepts, to write core code independently, to compile feedback results in real time and visually display the results. Therefore, the VR learning platform designed in this paper allows students to learn VR knowledge points on the website, download the programming plugin through the website, and then carry out intuitive C# programming. Through this learning process, students can understand the core codes, master the overall coding situation, and improve their abilities of problem solving. At the same time, it can reduce students’ learning pressure and tension, and has a positive impact on students’ learning process in a more attractive virtual learning environment.
3. System Framework
The system is mainly divided into two modules, namely the website module C# programming module, shown in Figure 1. The website module includes the home page and the page presenting knowledge points of VR programing. The
Figure 1. Framework of the system.
home page provides the programming package the learners can directly download. The C# programming package mainly includes a C# console compiler and a 3D scene which can dynamically response to the C# codes.
The programming package interactions with the console program through Socket communication. Students write code in the code edit box, and then send it to the console program for compilation through Socket communication. If a compilation error occurs, the error message is returned to the programming package and shown in the code edit box. If the compilation is successful, the console program compiles the code into a DLL file, and then returns the successful result to the learning platform.
3.1. C# Programming Module
As a learning platform, a clear and concise graphic user interface (GUI) of C# programming module will help improve the learning experience for students. A screen shot of this GUI is shown in Figure 2, which includes a 3D virtual scene built by using UGUI technology of Unity 3D according to the corresponding learning contents, a code editing box, buttons for help linking.
Socket communication realizes the exchange of data between two applications on the network through a two-way communication connection. Here, the C# console module is used as the local server side of socket communication, and run to compile the codes from Unity 3D. Socket technology is used to realize the functionality of receiving and sending data on the server side, and then a class of compiling code and the method of compiling function are redefined. The server side receives the string code from Unity 3D and passes it into the method to compile the code. The compilation results are returned regardless of whether there is a compilation error.
Figure 2. A screen shot of the GUI for C# programming module.
3.2. Website Home Page
The website provides learners with an entrance to start the process of learning, including “Home”, “Unity 3D”, “C#” and “Download”. “Unity 3D” provides main contents of Unity 3D knowledge. On “Home”, students will see a video of instructions for the steps of programming, and then can click the "Download" button (shown in Figure 3) to download the C# programming package.
3.3. Knowledge Points Webpage
The “Unity 3D” button presents the text reading about the learning content, and through which the students can choose one topic to begin with his learning. At this moment, a new page called “Knowledge Points Webpage” (shown in Figure 4), and the students can read the corresponding knowledge. The virtual 3D scene in C# programming module (shown in Figure 2) corresponds to a knowledge point. Each knowledge point webpage generally introduces the principle, and then shows the relevant example code and the 3D dynamic effect diagram. Finally, there are links to blog posts related to this knowledge point.
4. The Implementation and Results
In this section, we introduce the implementation of the learning system based on the design framework described above. Unity 3D is currently a popular development engine in the field of VR, and it is based on the concept of component. Therefore, it is very important for students to understand and master these various components. Here, the transform of 3D game objects is chosen as the learning content of this system to describe the system implementation. Through learning, students should understand the concepts and master the concerned C# programming to control the transform of 3D game objects in different coordinate systems.
Figure 3. Website homepage of the learning system.
The learning process is shown in Figure 5. The first step of a usual learning process is to download and run the C# programming module, making it ready for code writing. As the second step, the students then open the reading materials to learn the knowledge points. The third step, which is also the most significant step, is to practice the C# programming according to the basic principle, for example, the transform method of game objects in 3D scenes. At this step, the students can correct their codes step by step under the tutoring provided by the system until the compilation success is achieved (shown in Figure 6). Then, the students can modify the codes and watch the 3D scene to understand how it works, as shown in Figure 7.
Figure 4. Webpage for knowledge points corresponded with the learning contents.
Figure 5. Learning process.
Figure 6. (a) Error information when the code is compiled error; (b) Feedback information when the code is compiled successfully.
Figure 7. 3D presentation for the results of C# programming.
Real-time compiling of source codes to control and watch the game objects in the 3D scene is proposed in this paper for the VR learning. Through combining knowledge points and C# programming practices into the same learning platform, this system can greatly improve the learning efficiency and enthusiasm of the students.
The development of this learning system is at the beginning stage. Our future work will be focused on three aspects: 1) expanding the learning contents to cover all of basic knowledge for VR programming; 2) designing an intelligent tutoring module and further enhancing the interaction between the platform and students; 3) embedding the C# programming module into the webpage to realize the online programming.
This work is supported by “Guangdong Innovation Program for Postgraduate Education (No.2017SFKC-01)”.