Program code debugging method and device based on AI
The AI-based program code debugging method addresses inefficiencies in large-scale grading by using an AI model to analyze student codes with teaching points, improving efficiency and accuracy in Python online education.
Patent Information
- Application Number
- CN202411486846.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2024-12-27
AI Technical Summary
Existing technologies face inefficiencies and inaccuracies in grading large-scale student assignments, particularly in Python online education, due to manual grading's time-consuming nature and limitations of automated tools in identifying logical errors.
An AI-based program code debugging method and device that utilizes an AI big model to analyze student codes using teaching points and evaluation criteria, integrating automated workflows for efficient and accurate grading.
Enhances grading efficiency and accuracy by automating the correction process, reducing teacher workload, and providing personalized feedback, while ensuring consistent evaluation standards.
Smart Images

Figure CN119203984A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to an AI-based program code debugging method and device. Background Art
[0002] With the popularity of programming education, more and more people choose to learn Python online, and online Python teaching platforms have gradually become mainstream. At present, most platforms still use the traditional teaching method, that is, teachers manually correct students' homework. This method can provide personalized guidance, but it exposes the following problems when facing a large number of students: First, it is inefficient, and teachers need to check student codes one by one, which takes a lot of time; second, manual correction has accuracy problems, and teachers may make misjudgments due to fatigue or negligence; in addition, teachers have high programming ability requirements and need to have solid Python knowledge to correctly evaluate students' homework performance.
[0003] In order to improve efficiency, there are also some automated auxiliary tools in the existing technology. For example, automatic code checking tools can help teachers identify grammatical errors, but these tools are usually unable to identify logical errors or conduct in-depth evaluation of the code. Online assessment systems automatically score by pre-setting standard answers, but their flexibility is limited and it is difficult to cope with diverse programming solutions. These shortcomings of the existing technology cannot effectively solve the problem of fast and accurate correction of large-scale student assignments.
[0004] The present invention proposes an AI-based Python code debugging method. By combining the AI big model, the teaching points and evaluation criteria are used to deeply analyze and debug the students' codes, effectively solving the problem that traditional manual grading and simple automation tools cannot cope with large-scale homework grading.
[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0006] The embodiments of the present invention provide an AI-based program code debugging method and device to at least solve the technical problem that the prior art cannot solve in terms of fast and accurate marking of large-scale student assignments.
[0007] According to one aspect of an embodiment of the present invention, there is provided an AI-based program code debugging method, comprising: obtaining a program code to be debugged and a standard code corresponding to the program code to be debugged; obtaining a lesson plan of a current course corresponding to the program code to be debugged, and extracting key teaching points and evaluation criteria from the lesson plan of the current course as a basis for AI to evaluate the program code to be debugged; based on the basis and the standard code, using an AI big model to debug the program code to be debugged.
[0008] According to another aspect of an embodiment of the present invention, there is also provided an AI-based program code debugging device, comprising: a code acquisition module, configured to acquire a program code to be debugged and a standard code corresponding to the program code to be debugged; a basis acquisition module, configured to acquire a lesson plan of a current course corresponding to the program code to be debugged, and extract key teaching points and evaluation criteria from the lesson plan of the current course as a basis for AI to evaluate the program code to be debugged; and a debugging module, configured to debug the program code to be debugged using an AI big model based on the basis and the standard code.
[0009] In an embodiment of the present invention, the program code to be debugged and the standard code corresponding to the program code to be debugged are obtained; the lesson plan of the current course corresponding to the program code to be debugged is obtained, and key teaching points and evaluation criteria are extracted from the lesson plan of the current course as a basis for AI to evaluate the program code to be debugged; based on the basis and the standard code, the program code to be debugged is debugged using the AI big model. Through the above scheme, the technical problem that the existing technology cannot solve the problem of fast and accurate correction of large-scale student assignments is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0011] Figure 1 is a flowchart of an AI-based program code debugging method according to an embodiment of the present application;
[0012] Figure 2 is a flowchart of another AI-based program code debugging method according to an embodiment of the present application;
[0013] Figure 3 is a flowchart of a method for performing code analysis by an AI analysis module according to an embodiment of the present application;
[0014] Figure 4 is a flowchart of a method for generating personalized feedback according to an embodiment of the present application;
[0015] Figure 5 is a structural diagram of an AI-based program code debugging device according to an embodiment of the present application;
[0016] Figure 6 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0017] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0018] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0019] According to an embodiment of the present invention, a method embodiment of an AI-based program code debugging method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0020] Figure 1 is a method for debugging program code based on AI according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0021] Step S102: obtaining a program code to be debugged and a standard code corresponding to the program code to be debugged.
[0022] For example, a line number is added to the program code to be debugged; based on the course ID corresponding to the program code to be debugged, a standard code of the current course is obtained as the standard code corresponding to the program code to be debugged.
[0023] Step S104, obtaining the lesson plan of the current course corresponding to the program code to be debugged, and extracting key teaching points and evaluation criteria from the lesson plan of the current course as a basis for AI to evaluate the program code to be debugged.
[0024] Step S106, based on the basis and the standard code, using the AI big model to debug the program code to be debugged.
[0025] First, call the clustering interface of the program code to obtain the MD5 value of the cluster; if the MD5 value exists on the same day, obtain the AI correction content under the MD5 value as the preliminary correction result; if the MD5 value does not exist on the same day, call the AI big model to debug the program code to be debugged. For example, use the first AI model to analyze the program code to be debugged, identify and mark grammatical errors and logical errors; based on the identified grammatical errors and logical errors, provide corresponding improvement suggestions to generate the preliminary correction result.
[0026] Then, the teaching points, evaluation criteria, and the correction results are input into the trained second AI model, and the second AI model returns a personalized correction result. For example, the second AI model adjusts the correction results based on the teaching points and evaluation criteria to obtain the personalized correction results; the second AI model returns the personalized correction results.
[0027] The core innovation of the present invention is to apply artificial intelligence technology to the homework correction process of online Python teaching, and improve teaching efficiency and quality through automation and intelligent means. Specifically, first, AI code analysis technology is adopted, which can understand the syntax and logic of Python code, automatically detect errors in the code and provide improvement suggestions. Secondly, the personalized feedback generation mechanism generates personalized feedback reports based on the AI analysis results to provide targeted guidance for students. In addition, the present invention also provides an automated workflow, covering code submission, analysis and feedback, which significantly reduces the workload of teachers and improves the efficiency of homework correction. Finally, the key teaching points and evaluation criteria in the course lesson plan are integrated into the AI model to ensure the accuracy and consistency of the evaluation.
[0028] This application improves the efficiency and quality of homework grading in Python online teaching by providing the following: a specific algorithm structure of the AI model, especially a neural network architecture for code analysis and error detection; a personalized feedback algorithm designed to generate a personalized feedback report based on the AI analysis results; a specific design of the automated workflow, including steps such as adding line numbers to the code, obtaining standard code, and integrating teaching plans; and a method for integrating teaching points and evaluation criteria into the AI model to ensure a mechanism for evaluation accuracy and consistency, thereby improving the efficiency and quality of homework grading in Python online teaching.
[0029] The present application embodiment also discloses another AI-based program code debugging method, which introduces artificial intelligence technology and combines it with the workflow of the online Python teaching platform to achieve intelligent analysis and debugging of the code submitted by students. The core of this method is to use the AI model to perform preliminary code analysis, identify errors, generate personalized feedback, and improve the efficiency of code correction. The method provided in this embodiment can automate the entire process including multiple steps such as AI model construction, code processing, feedback generation, and result display. Figure 2 As shown, the method comprises the following steps:
[0030] Step S202, receiving and parsing the code submitted by the student.
[0031] After students complete their Python homework on the platform, the system prompts them to submit their code. When submitting the code, the system automatically performs a format check to ensure that the code can be parsed correctly. The system determines whether the code is valid by identifying the grammatical structure of the code. If a grammatical error is found, the system prompts students to make modifications before submission.
[0032] Specifically, the Python code analysis module is used to receive, parse and process Python code, and generate its corresponding MD5 hash value. First, introduce libraries, including hashlib (for generating MD5 hash values), ast (abstract syntax tree for parsing Python code), requests (for sending HTTP requests), re (for regular expression processing), and Flask (for building Web applications, supporting request and response processing). Next, create a new request session session to prepare for subsequent HTTP requests. Then, define the MD5 hash function, which receives a string as input, generates and returns the MD5 hash value of the string by encoding it in UTF-8 format. This process is to provide a unique identifier for the code content in subsequent processing.
[0033] The python_analyse function receives two parameters: request (containing HTTP request data) and app (Flask application instance). Inside the function, first extract the JSON data from the request and log it. Then, get the Python code to be analyzed (field pythonCode). If this code is not provided, the function returns an empty dictionary. If the code to be analyzed is successfully obtained, the function uses ast.parse() to parse it into an abstract syntax tree (AST), converting the Python code into a tree structure for subsequent analysis and processing. Next, use the ast.dump() method to convert the AST into a string format for further operation. The function then calculates and returns the MD5 hash value of the AST string, returned as a dictionary with the key group. This hash value can be used to uniquely identify the structure of the Python code.
[0034] During the processing, if any exception is encountered, the code will return the MD5 hash value of the Python code to be analyzed as an alternative result. In this way, the system can automatically identify problems in the code, thereby improving the efficiency of teaching and learning.
[0035] Step S204, automatically adding line numbers.
[0036] In order to facilitate subsequent analysis and feedback positioning errors, the present invention introduces the function of automatically adding line numbers to the code. It is implemented through the code processing module of the system. The code processing module first converts the code submitted by the student into a text format, and adds a unique line number identifier at the beginning of each line. The addition of line numbers follows the standard Python code format to ensure that it does not affect the normal execution of the code. In this way, it is convenient for the AI model to accurately indicate the problem location in the code in the feedback, and it is also helpful for teachers to conduct a secondary review. The code processing module also supports automatic recognition of different code styles to ensure the consistency of the code format.
[0037] Step S206, obtaining the standard code.
[0038] In order to evaluate the accuracy of the student code, the standard code corresponding to the student's assignment is obtained as a reference for analysis. The standard code generation module retrieves the pre-stored standard code from the database, or it can automatically generate a standard code based on a specific assignment.
[0039] The acquisition of standard codes can be based on the following two dimensions: 1) Code matching: The system matches the code corresponding to the student's assignment from the pre-uploaded standard assignment library. If the student's assignment is a customized task, the system dynamically generates a standard code based on the requirements of the assignment. 2) Version management: The system supports the version control function of the standard code. Teachers can update the standard code according to teaching needs to ensure that AI analysis is based on the latest evaluation standards.
[0040] Step S208, extracting the lesson plan.
[0041] In order to achieve personalized code debugging, the system extracts key teaching points and evaluation criteria from the lesson plan of the current course as the basis for AI to evaluate code quality. The lesson plan extraction module retrieves lesson plans from the database and uses natural language processing (NLP) technology to analyze the content of the lesson plans and extract the core teaching objectives and code evaluation criteria related to the assignment.
[0042] The extracted teaching points usually include: 1) Grammatical points: basic grammatical rules of Python language, such as variable declaration, conditional judgment, loop structure, etc. 2) Logical structure: how to design a program structure that meets the requirements of the question. 3) Performance optimization: how to write efficient code while meeting the requirements of the question. Through the lesson plan extraction module, AI can judge the correctness and rationality of students' code based on the specific teaching content and generate targeted improvement suggestions.
[0043] Step S210: submit the code to the AI analysis module.
[0044] When the system obtains the code submitted by the student, the standard code, and the evaluation criteria of the lesson plan, the code will be automatically submitted to the AI analysis module, i.e. the first AI model, for debugging. The AI analysis module is based on a pre-trained deep learning model that can understand the syntax and logic of Python code and identify potential errors and optimization points. Figure 3 The following steps are shown:
[0045] S2102, receiving code.
[0046] The code submitted by the students, the standard code, and the relevant teaching evaluation standards will be obtained by the system. At this time, the student's code will be automatically transferred to the AI analysis module, i.e. the first AI model, which is usually a pre-trained deep learning model. The main task of this model is to perform syntax and logic analysis on the code to find potential errors and optimization points.
[0047] The submitted code will be directly fed into the first AI model, which is trained based on a large number of Python code data sets and has code understanding capabilities. The first AI model will first deal with basic formatting issues of the code, such as whether it follows Python's syntax specifications. Specifically, it will check basic elements such as variable declarations, function definitions, code indentation, data types, etc. to ensure that the code complies with programming rules.
[0048] Step S2104, code syntax check.
[0049] After receiving the code, the syntax of the code is checked. The first AI model performs syntax parsing operations, similar to the syntax analysis of a compiler, to detect common syntax errors in the code, such as improper variable naming, lack of necessary indentation, incorrect statement terminators, etc. The first AI model parses the code line by line through a lexical analyzer and a syntax analyzer to ensure that the code meets the basic requirements of the Python language.
[0050] For example, the system automatically identifies statement structures that do not conform to Python standards and marks them as errors. The system not only points out the specific location of the error, but also provides correction suggestions, allowing students to quickly understand the problem and make corrections.
[0051] Step S2106, line-by-line comparison and difference analysis.
[0052] After the syntax check is completed, the line-by-line comparison phase begins. At this point, the AI analysis module compares the student's code with the standard code line by line. In order to better identify the differences between the codes, the system uses a code feature extraction method based on deep learning to generate a feature vector for each line of code.
[0053] Each line of code will be mapped into a vector, which represents the syntax, logical structure, context and other features of the line of code. Then, the AI model will compare the feature vectors of the corresponding lines of the student code and the standard code one by one to find out the inconsistencies. For each difference, the system will generate improvement suggestions based on the judgment of the pre-trained model. It should be noted that this line-by-line comparison method does not rely entirely on literal matching, but on the semantic understanding ability of the deep learning model.
[0054] In some embodiments, the system will identify parts of the student's code that are different but still correct. In this case, the AI analysis module will further analyze these differences to avoid giving misleading suggestions for improvement. For example, if the student used a different algorithm or structure to implement the same function, the AI module will identify this legitimate difference and will not suggest that the student make changes.
[0055] Step S2108: logic analysis and error detection.
[0056] Based on the line-by-line comparison, the AI analysis module will then analyze the logical structure of the code. At this point, the system will check the code's control flow, conditional judgment, loop structure and other logical elements to ensure that the code can complete the function of the question as expected.
[0057] For example, the AI model will determine whether the conditional statements in the student's code correctly implement the business logic and whether the loop structure has the correct loop boundary conditions. In this process, the system not only pays attention to the surface differences in the code, but also goes deep into the execution logic of the code. For example, some students may use unreasonable exit conditions when implementing the loop. The AI analysis module can identify such errors through its powerful logical reasoning ability and provide improvement suggestions.
[0058] In addition, the AI module also detects reference issues, including whether functions, variables, or external libraries are correctly referenced. To do this, the AI model extracts contextual features from the code and maps them into a high-dimensional vector space for analysis through a deep learning model. This allows the system to identify complex logical errors in the code and avoid misjudgments caused by relying solely on literal comparisons.
[0059] Step S2110, feature coupling and principal component analysis.
[0060] In some embodiments, the AI analysis module will further perform feature coupling and fusion processing on the extracted code feature vectors. Specifically, the system will perform an order-up process on the first feature vector of the context code and the second feature vector of the code to be detected. By using a multi-channel convolution kernel, the two feature vectors are coupled to obtain a main embedded feature matrix and an auxiliary embedded feature matrix. Next, the two feature matrices are expanded along the preset dimensional direction to form multiple sub-matrices. Each sub-matrix will undergo singular value decomposition (SVD) to extract the core subspace representation and factor matrix. In this way, the principal component differences can be extracted from the complex code structure, and the code can be analyzed based on these differences. Specifically, the first feature vector of the context code and the second feature vector of the current code to be detected are extracted respectively, and the first feature vector and the second feature vector are respectively increased in order according to the extended rank criterion, and the first feature vector and the second feature vector are feature-coupled and fused using a multi-channel convolution kernel to obtain the coupled main embedded feature matrix and the auxiliary embedded feature matrix. The above matrix is expanded along the direction of the extended dimension to form multiple sub-matrices. Each sub-matrix is subjected to singular value decomposition to extract the core subspace representation and factor matrix. The principal component differences between the main feature matrix and the auxiliary feature matrix are calculated based on the core subspace representation and the factor matrix to extract the core features, thereby effectively identifying problems in the code.
[0061] This application allows for the identification of subtle differences in code in high-dimensional space, especially in complex logic or reference issues. For example, students may have referenced inappropriate external libraries in their code, or used incorrect functions, which are often difficult to identify through line-by-line comparison. Through principal component analysis, the AI module can effectively identify these potential problems and provide precise improvement suggestions.
[0062] Step S2112, generating feedback and suggestions.
[0063] After the aforementioned analysis process, the AI analysis module will summarize all detected differences and logical errors and generate a feedback report, providing personalized improvement suggestions based on the specific problems of the student's code. The AI analysis module will not only point out the specific location of the error, but also explain the cause of the error in detail and provide specific modification suggestions.
[0064] In some embodiments, the feedback may also include optimization suggestions. Even if the student's code has already implemented the correct function, the system can suggest how to further optimize the performance or readability of the code. These optimization suggestions are usually based on best practices to help students improve their programming skills.
[0065] Through the above steps, the AI analysis module can efficiently and accurately analyze the Python code submitted by students. From syntax checking to logic analysis, to feature coupling and principal component analysis, the AI analysis module can deeply explore potential problems in the code and provide improvement suggestions. This deep learning-based analysis method greatly improves the accuracy of code detection, especially when dealing with complex logic and structure, which can avoid misjudgment and provide students with more valuable feedback.
[0066] Step S212: Generate personalized feedback.
[0067] like Figure 4 The method for generating personalized feedback comprises the following steps:
[0068] Step S2122, perform target analysis based on teaching points.
[0069] The second AI model analyzes the code submitted by students according to the teaching objectives pre-set by the system. The extraction of teaching points relies on a set of predefined teaching standards, which are provided by the teaching plan content and reflect the programming skills and knowledge points that students need to master. The system extracts the key elements of the teaching objectives, such as function usage, control flow, code efficiency, etc., through text processing algorithms.
[0070] On this basis, the second AI model matches and analyzes each part of the student's code with the teaching objectives. Specifically, the system compares the differences between the code implementation method and the teaching standards to determine which parts do not meet the expected learning objectives. Through the deep learning model's understanding of the code, the AI model can detect which parts do not meet the teaching standards and generate corresponding improvement suggestions.
[0071] Step S2124: code analysis and personalized improvement suggestions.
[0072] After the teaching point extraction and target analysis, the second AI model will conduct further in-depth analysis on the parts of the student code that do not meet the teaching objectives, including the logical structure of the code, performance issues, and the integrity of the functional implementation. For example, the AI model analyzes the control structures (such as loops and conditional judgments) in the student code to determine whether they conform to correct logical reasoning. For example, if the student uses unreasonable conditional judgments, the model will detect the problem and make suggestions for improvement. In some embodiments, the second AI model will also evaluate the performance of the code. By analyzing the execution efficiency of the code, the model can identify performance bottlenecks. For example, it is detected that the student did not choose the optimal solution when using certain data structures, resulting in unnecessary performance loss. In this case, the second AI model will give specific performance optimization suggestions, such as using more efficient data structures or algorithms. In addition, the system will check whether the code fully achieves the expected functional goals. If it is found that some parts do not implement the functions required by the question, the second AI model will mark these defects and propose modification plans to help students complete the complete functional implementation.
[0073] Step S2126, generating a personalized feedback report.
[0074] After the analysis is completed, the system will automatically generate a personalized feedback report, which mainly includes the following parts:
[0075] 1) Error positioning
[0076] The system will first clearly mark the specific line number of the error in the code. By directly matching each error to a line of code, students can quickly locate the problem. For each error, the system will further describe its type, such as whether it is a syntax error or a logic error. Syntax errors include incorrect indentation and undeclared variables, while logic errors involve loop structures and logical problems in conditional judgments. In addition, the feedback will also point out the specific cause of the error. For example, the system points out that a variable is used improperly, or there is an infinite loop in the code, which helps students understand the root cause of the problem more deeply.
[0077] 2) Suggestions for improvement
[0078] The AI system will provide specific improvement suggestions for the detected problems. The improvement suggestions are based on AI's deep understanding of the code, so they are not just simple prompts, but provide specific steps to help students improve the quality of their code. For example, if the AI system detects performance issues in the code, the feedback report will describe in detail how to optimize the code, such as improving the complexity of the algorithm, adjusting the data structure, reducing redundant calculations, etc.
[0079] In some cases, improvement suggestions can also involve improving code readability. The system will suggest students to use clearer variable names or simplify complex logical structures to enhance the readability and maintainability of the code.
[0080] 3) Learning tips
[0081] In order to help students better understand the parts they need to strengthen in the learning process, the system will also generate targeted learning point prompts. Based on the teaching objectives, i.e. teaching points, extracted from the lesson plans, combined with the errors in the students' code, the system points out to students their deficiencies in specific knowledge points. For example, if students perform poorly in the implementation of recursive algorithms, the system will suggest that they review the relevant course content. The AI model will analyze the knowledge blind spots exposed by students in their code and provide corresponding course review suggestions. Personalized learning point prompts can help students strengthen their grasp of key knowledge points and improve their programming skills.
[0082] 4) Multi-dimensional feedback
[0083] In some embodiments, the feedback report generated by the system will also include multi-dimensional analytical feedback. This feedback is not limited to the code itself, but will also be analyzed from multiple dimensions such as learning progress, code quality, and error frequency. For example, the system can analyze the student's progress by comparing the code submitted by the student multiple times. Based on multi-dimensional feedback, students can get a more comprehensive learning experience, not only understand the problems with the current code, but also clearly see their own learning progress and the direction that needs to be improved in the future.
[0084] 5) Personalized feedback and dynamic adjustment
[0085] The generation of personalized feedback is based on AI's deep understanding of the code and is dynamically adjusted. The system provides targeted help based on the specific situation of each student. For example, for students with a higher level of programming, the feedback contains more performance optimization suggestions and advanced programming techniques; while for beginners, the feedback is more focused on correcting basic grammatical errors. In addition, the system can gradually adjust the content and method of feedback based on the students' multiple code submissions, so that the feedback is more in line with the students' learning progress and needs. For example, based on the students' learning progress, the basic prompts are gradually reduced, and the analysis of complex problems is increased to help students continuously improve their programming skills.
[0086] Through the above steps, the second AI model can deeply analyze the student code and generate a personalized feedback report. This report not only covers error location, improvement suggestions and learning point prompts, but also helps students achieve continuous improvement in programming learning based on multi-dimensional analysis and dynamic adjustment. The system's extraction of teaching points, in-depth analysis of the code and generation of personalized feedback ensure that each student can obtain the most valuable feedback based on their own learning situation, thereby improving learning efficiency and programming level.
[0087] Step S214, feedback.
[0088] The generated personalized feedback report is first presented to the teacher, who can view the results of the AI analysis on the platform and conduct review and adjustments. The system provides teachers with a convenient review tool, and teachers can fine-tune the code score based on the AI feedback results, or directly accept the AI-generated feedback.
[0089] Through the system interface, teachers can quickly browse the feedback generated by AI and confirm the key issues. If teachers think that some suggestions from AI need to be supplemented or modified, the system allows teachers to add their own comments to the feedback report.
[0090] The feedback report reviewed by the teacher will eventually be presented to the students. Students can view their homework feedback through the platform interface, understand the problems in the code and the improvement suggestions given by AI. The system's user interface module is simple and intuitive. Students can not only see a detailed description of each error, but also quickly jump to related learning resources through the hyperlinks in the feedback. The feedback report also supports real-time updates. Students can resubmit their homework after modifying the code. The system will re-analyze the AI and generate new feedback.
[0091] By introducing AI technology, the present invention greatly improves the efficiency of homework grading, significantly reduces the time invested by teachers in manually grading homework, and thus effectively reduces the workload of teachers. At the same time, the application of AI technology improves the accuracy of code analysis, avoids subjective errors that are prone to occur in traditional manual grading, and reduces the possibility of human errors. In addition, the system can provide students with personalized feedback, generate targeted suggestions and improvement measures based on the code they submit, thereby helping students better understand code problems and improve learning effects. Through automated workflows, the present invention simplifies the submission and feedback process of homework, making it more convenient for students and teachers throughout the entire homework management process, and greatly optimizing the user experience. Finally, the present invention also integrates teaching points and evaluation standards into the AI system to ensure that each evaluation follows a unified standard, thereby ensuring the consistency and fairness of the evaluation results and improving the overall teaching quality.
[0092] The present application also provides an AI-based program code debugging device, such as Figure 5 As shown, it includes: a code acquisition module 52, which is configured to acquire the program code to be debugged and the standard code corresponding to the program code to be debugged; a basis acquisition module 54, which is configured to acquire the lesson plan of the current course corresponding to the program code to be debugged, and extract key teaching points and evaluation criteria from the lesson plan of the current course as a basis for AI to evaluate the program code to be debugged; a debugging module 56, which is configured to debug the program code to be debugged using the AI big model based on the basis and the standard code.
[0093] It should be noted that the AI-based program code debugging device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the AI-based program code debugging device provided in the above embodiment and the AI-based program code debugging method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0094] Figure 6 FIG. 1 shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure. It should be noted that: Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0095] like Figure 6 As shown, the electronic device includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0096] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0097] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for debugging program code based on AI, characterized in that: include: Acquire a program code to be debugged and a standard code corresponding to the program code to be debugged; Obtain the lesson plan of the current course corresponding to the program code to be debugged, and extract key teaching points and evaluation criteria from the lesson plan of the current course as a basis for AI to evaluate the program code to be debugged; based on the basis and the standard code, use the AI big model to debug the program code to be debugged.
2. The method according to claim 1, characterized in that Acquiring a program code to be debugged and a standard code corresponding to the program code to be debugged, including: Adding line numbers to the program code to be debugged; Based on the course ID corresponding to the program code to be debugged, a standard code of the current course is acquired as the standard code corresponding to the program code to be debugged.
3. The method according to claim 1, characterized in that Based on the basis and the standard code, the program code to be debugged is debugged using the AI big model, including: Inputting the program code to be debugged and the standard code into a trained first AI model, and the first AI model returns a preliminary correction result of the program code to be debugged; The teaching points, evaluation criteria and correction results are input into a trained second AI model, and the second AI model returns a personalized correction result.
4. The method according to claim 1, characterized in that: The program code to be debugged and the standard code are input into a trained first AI model, and the first AI model returns a preliminary correction result of the program code to be debugged, including: Analyzing the program code to be debugged by using the first AI model to identify and mark syntax errors and logic errors; Based on the identified grammatical errors and logical errors, corresponding improvement suggestions are provided to generate the preliminary correction results.
5. The method according to claim 3, characterized in that: The teaching points, the evaluation criteria and the correction results are input into the trained second AI model, and the second AI model returns a personalized correction result, including: The second AI model adjusts the correction result based on the teaching point and the evaluation standard to obtain the personalized correction result; The second AI model returns the personalized correction result.
6. The method according to claim 3, characterized in that Debugging the program code to be debugged using the AI big model includes: Call the clustering interface of the program code to obtain the MD5 value of the cluster; If the MD5 value exists on the same day, obtain the AI correction content under the MD5 value as the preliminary correction result; When the MD5 value does not exist on the current day, the AI big model is called to debug the program code to be debugged.
7. A program code debugging device based on AI, characterized in that: include: A code acquisition module, configured to acquire a program code to be debugged and a standard code corresponding to the program code to be debugged; A basis acquisition module is configured to acquire a lesson plan of a current course corresponding to the program code to be debugged, and extract key teaching points and evaluation criteria from the lesson plan of the current course as a basis for AI to evaluate the program code to be debugged; The debugging module is configured to debug the program code to be debugged using the AI big model based on the basis and the standard code.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 6.
9. A computer device, characterized in that: include: Memory and processor, The memory stores a computer program; The processor is used to execute the computer program stored in the memory, and when the computer program is run, the processor is enabled to execute the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.