623
Puzzle Based Programming Learning Support System with Learning History Management Yuji Yoneyamaa, Kotaro Matsushitab, Kenneth J. Mackinb Masanori Ohshirob, Kazuko Yamasakib, Eiji Nunohirob a Graduate School of Tokyo University of Information Sciences, Japan b Tokyo University of Information Sciences, Japan
[email protected] Abstract: In this paper, a new puzzle based e-learning system for programming training is introduced, which provides a simple game-like user interface, and features management of learning history for each user. The proposed system applies genetic algorithm to the programming problem generation algorithm, so that the system can automatically generate many different patterns of programming problems which are suited for each learner’s progress level. Keywords: E-learning, Programming, Genetic algorithm, Puzzle
Introduction In programming education for beginner level students, it is effective to repeatedly practice programming problems that are suited for the student’s skill level, while also arousing interest of the student towards programming. Training support system design should also consider this issue. There has been various research reported on development of programming training support systems for beginner students [1],[2].But for these past research, it is difficult to measure the individual level of comprehension for each user, and providing a large number of programming problems appropriate for the student’s current attainment. On the other hand, there has been past research on automatic programming problem creation [3],[4]. But for these past researches, the predefined programming problem is only automatically converted to a specified question format, and each programming problem must be created in advance by the administrator. In order to overcome these problems, we have been developing a programming training support system applying genetic algorithm, which automatically creates a large number of programming problems suited for each student’s skill level [5]. After applying the proposed programming training support system in an actual programming course, we collected feedback evaluating the training results, operability and functionality of the system. In this paper, we describe the outline of the improved learning support system with user requested features added, including the learning history management feature. 1. Outline of Programming Training Support System 1.1 Configuration of the system The proposed system evaluates the student's current level of progress from past training history, and automatically generates programming exercises which match the student's level of progress.
624
1.2 Processing flow of programming training support system Processing flow of programming training support system is described in the following. (1) System shows a problem to user according to the learning contents such as a syllabus of program practice or algorithm that user wishes. (2) User selects a problem to answer from the problem that system showed (3) System breaks up a program into puzzle pieces depending on user level by using genetic algorithm to determine the location and number of separation for the program. (4) User reconstructs the program by selecting the correct program puzzle pieces in the correct order. (5) System estimates user's result, and accumulates as the user history. 2. Program puzzle creation 2.1 Process of program puzzle creation The programming problem is created by the following steps. (1) Source code analysis Analyze the program source code by determining for each program statement, the control depth, variable reference and scope count. (2) Partition difficulty calculation Calculate the difficulty level for each statement using the above control and reference information. (3) Partition pattern selection Apply genetic algorithm search to find the optimal combination of partition-points which best match the progress level of the user. 2.2 Source code analysis Each line of code is analyzed for data to be used in determining the difficulty of the partition. For each line of code, (a) the control depth, (b) the variable reference and (c) the scope count are calculated to measure the complexity of the source code. (a) Control depth The control depth measures the depth or dependence of a specific flow control within the program. Control depth is increased by 1 when the following statement is found. Loop structure such as a while or for statement if statement A statement which depends on the result of another statement (b) Variable reference The variable reference measures the use of variables in a statement. The variable count is increased by 1 for each of the following conditions. A variable is defined A variable is referenced (c) Scope count The scope count measures the number of variables in scope during a specific statement. The scope count is increased when a variable defined earlier is referenced in a later line. For example, in Fig.1, when variable x2 defined in line 2 is referenced in line 4, then variable x2 is “in scope” in line 3. 1: 2: 3: 4:
x1 = 10; x2 = 0; x3 = x1; x4 = x2;
Fig.1 Example of scope count
625
The source code is analyzed by the above 3 points. An example of the source code analysis is shown in Fig. 2. Program 1: public class Test{ 2: public static void main (String[] args) { 3: int i; 4: int even = 0; 5: int odd = 0; 6: for ( i = 0; i < 10; i ++) { 7: if ( i % 2 = = 0 ) { 8: even = even +1; 9: } else { 10: odd = odd + 1; 11: } 12: } 13: System.out.println(even); 14: System.out.println(odd); 15: } 16: }
Control depth 0 0 1 1 1 1 2 3 2 3 2 1 1 1 1 0
Reference count 0 0 1 (define 1) 1 (define 1) 1 (define 1) 4 (define 2, refer 2) 1 (refer 1) 2 (define 1, refer 1) 0 2 (define 1, refer 1) 0 0 1 (refer 1) 1 (refer 1) 0 0
Scope count 0 0 0 1 2 2 2 2 3 2 3 3 1 0 0 0
Fig.2 Source code analysis 2.3 Partition difficulty calculation The program puzzle pieces are created by selecting partition points between two lines of code. The difficulty of the puzzle is dependent on the number of pieces and the location of the partition points. If a partition occurs at a location with high control depth and high reference count, the puzzle can be assumed to have a high difficulty. From this assumption, we define the following function to evaluate the difficulty of the partition. Partition difficulty Pk is the evaluated difficulty when a partition occurs after program code statement k. Partition difficulty P k is defined as: p k nd (nr n p )
(1)
Where nd is control depth, nr,is reference count , np is scope count. 2.4 Partition pattern selection The partition pattern (number of partitions and location of partitions) is selected using the user's progress level and partition difficulty for each possible partition point. We apply genetic algorithm (GA) [6] to select the partition pattern. 2.4.1 Chromosome expression in GA The partition pattern expressed as a binary string is used as the chromosome in the genetic algorithm. The length of the chromosome is 1 less than the lines of code (statements) in the program. In the chromosome, the value 1 indicates a partition at that location (line), and 0 indicates no partition at that location. Fig.3 illustrates the relationship between chromosome and partition points. In Fig. 2 an example of a 16 line program is shown, and the partition points are the locations where the chromosome value is 1, i.e. after lines 2, 5, 6, 8, 10, 16. 2.4.2 Evaluation of programming problem The difficulty of the puzzle problem created from the original programming problem is defined by the following 3 factors. Algorithm used in the original program Programming language specification used in the original program Puzzle difficulty The difficulty of algorithm and language specification is specific to each of the original programming problems, and the difficulty is specified as shown in Table 1 and
626
Table 2. A larger the level number signifies a higher (difficult) level, and contents of a higher level includes the contents of lower levels. Chromosome 0 1 0 0 1 1 0 1 0 1 0 0 0 0 0 1
Line number
Program
1: public class Test{ 2: public static void main (String[] args) { 3: int i; 4: int even = 0; 5: int odd = 0; 6: for ( i = 0; i < 10; i ++) { 7: if ( I % 2 = = 0 ) { 8: even = even +1; 9: } else { 10: odd = odd + 1; 11: } 12: } 13: System.out.println(even); 14: System.out.println(odd); 15: } 16: }
Fig.3 Relationship of GA chromosome and program partition points Table1 Algorithm level Level 1 2 3 : : : : 22
Table2 Language specification level
Contents Four basic operations Comparison of values Average : : : : Connected list
Level 1 2 3 : : 10
Contents Standard I/O if,switch for : : Class and instance control
The puzzle difficulty is the sum of the partition difficulty value for the given program puzzle chromosome, calculated with the following equation. N
ptotal ( p k chrk )
(2)
k 1
Where Ptotal is the puzzle difficulty, N is number of lines of code - 1, Pk is the puzzle difficulty at position k, Chrk is the value of the chromosome at position k. Difficulty D of the puzzle problem is defined by the following equation using algorithm level a, language specification level g, and puzzle difficulty ptotal : D a g ptotal
(3)
where 1 22 , 1 g 10 . 2.4.3 Fitness evaluation of created puzzle problem The fitness of the created puzzle problem is used as the fitness value of the genetic algorithm to create a programming puzzle problem to match the student’s level of progress. Fitness F is defined as equation (4). The fitness is defined to be best when the fitness value F from equation (4) is 0. This means that by selecting puzzle difficulty D close to user comprehension level U, a puzzle problem matching the student’s level of progress can be created.
F U D
(4)
627
U is a predefined constant value indicating the student’s comprehension level. When the student solves a puzzle problem with difficulty D, then the value U is incremented so that a more difficult problem is created for the student. From the above method, a puzzle problem is automatically created from the original programming problem to match the student’s level. 4. Learning History Management Feature In this research, the following features including learning history management were implemented, based on feedback from past use in classrooms as well as comments from corporate education section managers. Time-ordered score graphing feature Visually display the change in comprehension and scores as a graph. Problem completion confirmation feature The attainment table visually shows the percentage correct for each level. Automatic creation of false puzzle pieces When a puzzle piece contains conditionals (as in if statements), false pieces with wrong conditionals are automatically created. Automatic indentation feature Indentation in the source code within each puzzle piece can be turned on/off. Source code of the completed program configured by the selected puzzle pieces is automatically indented correctly. 5.Conclusion In this paper, a puzzle-based learning support system applying genetic algorithm is introduced, and the system design as well as improved features and man-machine interface A learning history management feature and visual display to check the progress of comprehension was implemented. From these additional features, the improvement of the effectiveness of the proposed learning support system is expected. For future works, evaluation of the system usability and problem presentation is planned. Porting the system to a web-based system is also being considered. References [1] Y.Yamamoto (2003). Use of the programming learning support system simultaneously displaying the flow chart and the source code, Transactions of Japanese society for information and system in education, vol.20, no.4, pp.380-384 (in Japanese) [2] S.Cho, M.Kai, A.Kawai, T.Hino, S.Maeshima, K.Kakehi (2004). Nigari – A programming language and environment for the first stage, leading to Java world, Transactions of information processing society of japan, vol.45, no.SIG9, pp.25-46 (in Japanese) [3] Kobayashi E., Nagashima S. and Hayase M. (2001) Programming-free Web-based Automatic Online Drill/Quiz Creator, Proceedings of the 6th World Conference on Education Multimedia, Hypermedia and Telecommunication, pp.990-991. [4] Farah H. and Saddik A.E (2002). iQUIZ: A Tool Making Internet Quizzes Easy to Develop and Use, Proceedings of the 7th World Conference on E-Learning in Corporate, Government, Healthcare, & Higher Education, pp.1461-1464. [5] E.Nunohiro, K.J.Mackin, M.Ohshiro, K.Matsushita, K.Yamasaki (2007). Implementation of a GA driven programming training support system, The 12th International symposium artificial life and robotics, pp.517-522. [6] D.E.Goldberg (1989). Genetic algorithms in search, optimization, and machine learning, Addison Wesley.