Graphical programming job correction method and device, electronic equipment, storage medium and program product

By generating a structured description of graphical programming jobs and using a large language model, the problem of being unable to analyze various errors in graphical programming jobs in the prior art is solved, and accurate correction and guidance prompts for graphical programming jobs are realized.

CN120295614AActive Publication Date: 2025-07-11BEIJING SIMING QICHUANG TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510357464.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-11
Estimated Expiration
2045-03-25

AI Technical Summary

Technical Problem

The prior art cannot effectively analyze programming errors outside the coverage of answers in graphical programming assignments, and cannot give targeted guidance tips.

Method used

By obtaining the program source code of the graphical programming job, analyzing the configuration information and operation logic of the building blocks, generating structured descriptions, and using a large language model to correct them, providing guidance tips.

Benefits of technology

It can accurately identify and analyze various errors in graphical programming operations, give targeted guidance tips, and improve the accuracy and effectiveness of corrections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295614A_ABST
    Figure CN120295614A_ABST
Patent Text Reader

Abstract

The invention provides a graphic programming job correction method and device, electronic equipment, a storage medium and a program product, and the method comprises the steps: obtaining a program source code of a graphic programming job; for each building block, acquiring configuration information of the building block from the program source code; the parameter information and the text display information of the building blocks are combined according to the relative position relation between the text display information and the parameter information, and character description of the building blocks is obtained; operation logic among the building blocks is obtained according to the program source codes; combining the character descriptions of the building blocks according to the operation logic among the building blocks to obtain the structured description of the graphical programming operation; and inputting the structured description of the graphical programming job into a preset large language model. In this way, the graphical programming job can be corrected through the large language model, the cause of the error in the graphical programming job can be known, and then a guide prompt can be given according to the cause of the error.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of graphical programming technology, and in particular, to a method, device, electronic device, storage medium, and program product for grading graphical programming assignments. Background Art

[0002] Graphical programming has been widely used in the field of education, especially in the field of children's programming education. The graphical programming platform uses graphical building blocks or modules to replace traditional text coding, making programming more visible and user-friendly, and lowering the programming threshold.

[0003] In the teaching practice of graphical programming, students need to carry out a large number of graphical programming assignment exercises. Grading the graphical programming assignments of students and guiding them to answer correctly is beneficial for students to understand and master graphical programming skills more quickly.

[0004] Currently, the method of answer matching is usually used to grade students' graphical programming assignments and give guiding hints. However, the set answers generally can only cover several graphical programming errors, and the errors in graphical programming assignments are diverse. For programming errors outside the coverage of the answers, the real reasons for the occurrence of graphical programming errors cannot be analyzed, nor can targeted guiding hints be given. Summary of the Invention

[0005] The purpose of the embodiments of this application is to provide a method, device, electronic device, storage medium, and program product for grading graphical programming assignments, so as to solve the problem in the related technology that for programming errors outside the coverage of the answers, the real reasons for the occurrence of graphical programming errors cannot be analyzed, nor can targeted guiding hints be given.

[0006] In a first aspect, the embodiments of this application provide a method for grading graphical programming assignments, including:

[0007] Obtain the program source code of the graphical programming assignment; the graphical programming assignment includes multiple building blocks with splicing relationships;

[0008] For each building block, obtain the configuration information of the building block from the program source code; the configuration information includes the parameter information, text display information, and the relative position relationship between the text display information and the parameter information of the building block;

[0009] Combine the parameter information and text display information of the building block according to the relative position relationship between the text display information and the parameter information to obtain the text description of the building block;

[0010] Obtain the running logic between the building blocks according to the program source code;

[0011] According to the running logic between each of the building blocks, combine the text descriptions of each of the building blocks to obtain the structured description of the graphical programming assignment;

[0012] Input the structured description of the graphical programming assignment into a preset large language model, so that the large language model corrects the graphical programming assignment according to the structured description and gives guiding prompts.

[0013] A large language model is a model that can generate natural language text or understand the meaning of language text. The above solution in the embodiment of the present application uses the large language model to correct the graphical programming assignment and give guiding prompts. Then, based on the ability of the large language model itself to understand the meaning of language text, it is possible to give the reasons for the occurrence of the analyzed graphical programming errors for various programming errors (including programming errors outside the answer coverage), and give targeted guiding prompts, thereby solving to a certain extent the problems existing in the related technologies, that is, for programming errors outside the answer coverage, the real reasons for the occurrence of graphical programming errors cannot be analyzed, and targeted guiding prompts cannot be given.

[0014] In addition, due to the particularity of the graphical programming technology field, graphical programming assignments are all pieced together by multiple graphical building blocks, which cannot be recognized by the large language model. Therefore, the large language model cannot be directly applied to the scenario of correcting graphical programming assignments in the graphical programming technology field. In the above implementation process, by obtaining the text description of each building block in the graphical programming assignment and the running logic between the building blocks, and then combining the text descriptions of the building blocks according to the running logic between the building blocks, the structured description of the graphical programming assignment is obtained. In this way, it is possible to transform the graphical programming assignment presented in the form of building blocks into a structured description that the large language model can understand. This enables the large language model to understand the true intention of the graphical programming assignment based on the structured description of the graphical programming assignment, so that it is possible to realize the correction of the graphical programming assignment by the large language model, know the reasons for the occurrence of errors in the graphical programming assignment, and then realize giving guiding prompts for the reasons for the occurrence of errors.

[0015] In addition, since what large language models can understand is structured descriptions, the accuracy of structured descriptions will directly affect the effect of the large language model in grading assignments. Also, since graphical programming assignments are formed by users dragging and dropping building blocks for splicing, how to convert graphical programming assignments into structured descriptions that can more accurately describe the internal logic of graphical programming assignments will directly affect the effect of the large language model in grading assignments. For this reason, in the above implementation manner of the embodiments of the present application, by obtaining the program source code of the graphical programming assignment, the program source code composed of the program codes of the building blocks dragged and dropped and spliced by the user is obtained. Furthermore, parameter information and text display information of each building block are obtained from the program source code, and text descriptions of each building block are formed using the parameter information and text display information, so that text descriptions of the building blocks dragged and dropped and spliced by the user can be obtained relatively accurately. Then, according to the running logic between the building blocks, the text descriptions of the building blocks are combined, so that the obtained structured description of the graphical programming assignment can more accurately describe the internal logic of the graphical programming assignment.

[0016] Further, obtaining the configuration information of the building block from the program source code includes: if in the program source code, the field value of the parameter field corresponding to the building block is a parameter value, then determining the parameter value as the parameter information of the building block.

[0017] Since in the case where the field value of the parameter field corresponding to the building block is a parameter value, the parameter value is the specific information passed to the building block. Therefore, in the above implementation process, in the case where the field value of the parameter field corresponding to the building block is a parameter value, without any processing on the parameter value, directly taking the parameter value as the parameter information of the building block, the specific information actually passed to the building block can be obtained. Thus, the text descriptions of the building blocks can be combined more accurately using the parameter information of the building blocks.

[0018] Further, obtaining the configuration information of the building block from the program source code includes: if in the program source code, the field value of the parameter field corresponding to the building block is the building block identifier of another building block, then taking the text description of the other building block as the parameter information of the building block.

[0019] Since the literal description of the building block corresponding to the building block identifier is the specific information actually passed to the building block when the field value of the parameter field corresponding to the building block is the building block identifier. Therefore, in the above implementation process, if in the program source code, the field value of the parameter field corresponding to the building block is the building block identifier of another building block, then the literal description of the other building block is used as the parameter information of the building block. In this way, the specific information actually passed to the building block can be obtained, so that the literal description of the building block can be more accurately combined using the parameter information of the building block. Moreover, this can enable building blocks with a nested relationship to accurately reflect the original nested relationship when converted into a structured description.

[0020] Further, if in the program source code, the field value of the parameter field corresponding to the building block is the building block identifier of another building block, then using the literal description of the other building block as the parameter information of the building block includes: when it is determined that the field value of the parameter field corresponding to the building block is the building block identifier of another building block, obtaining the configuration information of the other building block from the program source code, and combining the parameter information and the text display information of the other building block according to the relative position relationship between the text display information and the parameter information of the other building block to obtain the literal description of the other building block; using the literal description of the other building block as the parameter information of the building block.

[0021] In the above implementation process, when it is found that the field value of the parameter field of a building block is the building block identifier of another building block, the configuration information of the other building block is obtained from the program source code, and the parameter information and the text display information of the other building block are combined according to the relative position relationship between the text display information and the parameter information of the other building block to obtain the literal description of the other building block. Then, the literal description of the other building block is used as the parameter information of the building block. In this way, the on-demand acquisition of the literal description of the building block can be realized, avoiding obtaining a large number of literal descriptions according to the program source code at one time, and reducing the pressure on the server.

[0022] Further, obtaining the running logic between the building blocks according to the program source code includes: parsing the program source code to obtain the abstract syntax tree corresponding to the program source code; obtaining the running logic between the building blocks from the abstract syntax tree.

[0023] Since large language models cannot directly obtain the running logic between the building blocks in a graphical programming assignment based on the graphical programming assignment itself or the program source code of the graphical programming assignment. Therefore, in the above implementation process, the program source code is parsed to obtain the abstract syntax tree corresponding to the program source code. Since the abstract syntax tree can clearly show the hierarchical and nested relationships between the codes in the program source code, and the program source code is composed of the program codes of multiple building blocks with a splicing relationship, the abstract syntax tree actually shows the hierarchical and nested relationships between multiple building blocks with a splicing relationship. Therefore, the running logic between the building blocks can be obtained from the abstract syntax tree, so as to use the running logic between the building blocks to form a structured description that can be understood by the large language model, so that the large language model can understand the true meaning of the graphical programming assignment and realize the correction of the graphical programming assignment.

[0024] Further, the running logic includes the running order and running conditions between the building blocks; according to the running logic between the building blocks, the text descriptions of the building blocks are combined to obtain the structured description of the graphical programming assignment, including: determining the delimiters corresponding to the running conditions according to the running conditions between the building blocks; arranging the text descriptions of the building blocks according to the running order between the building blocks, and using the delimiters corresponding to the running conditions to separate the text descriptions between the arranged building blocks to obtain the structured description of the graphical programming assignment.

[0025] Since in the abstract syntax tree, the running logic between the building blocks is realized through the node types of the abstract syntax tree and the connection structure between the nodes. Therefore, after obtaining the running logic between the building blocks from the abstract syntax tree, this running logic still cannot be directly understood by the large language model. Therefore, in the above implementation process, the running conditions that cannot be understood by the large language model are converted into delimiters, and the execution order between the building blocks is converted into the arrangement order of the text descriptions of the building blocks. Finally, the text descriptions between the arranged building blocks are separated by the delimiters corresponding to the running conditions to obtain the structured description of the graphical programming assignment, so that the large language model can understand the running logic and running purpose between the building blocks in the graphical programming assignment through the structured description of the graphical programming assignment, so as to realize the correction of the graphical programming assignment.

[0026] Further, inputting the structured description of the graphical programming assignment into a preset large language model includes: filling the structured description of the graphical programming assignment into the filling position of the corresponding programming assignment description in the preset prompt word template; inputting the filled prompt word template into the large language model.

[0027] In the above implementation process, by filling the structured description of the graphical programming assignment into the filling position of the corresponding programming assignment description in the preset prompt template, and then inputting the filled prompt template into the large language model. In this way, it is possible to unify the data formats of different graphical programming assignments, and avoid the large language model having a misunderstanding of the graphical programming assignment due to different expressions of data formats.

[0028] Further, before inputting the filled prompt template into the large language model, the method for grading the graphical programming assignment further includes:

[0029] Obtain the role definition for the large language model;

[0030] Fill the role definition for the large language model into the position of the corresponding role description in the prompt template, so that the large language model outputs guiding prompts for the graphical programming assignment according to the prompt form corresponding to the role definition.

[0031] In the above implementation process, by filling the role definition for the large language model into the position of the corresponding role description in the prompt template. In this way, the large language model can clarify its own responsibilities and functions based on the role definition in the prompt template, and then can give guiding prompts for the graphical programming assignment according to its responsibilities. Therefore, by obtaining different role definitions for the large language model, customization of the large language model can be achieved, and the user experience can be enhanced.

[0032] Further, before inputting the filled prompt template into the large language model, the method for grading the graphical programming assignment further includes:

[0033] Obtain the task objective of the graphical programming assignment;

[0034] Fill the task objective into the position of the corresponding task objective description in the prompt template.

[0035] In the above implementation process, by obtaining the task objective of the graphical programming assignment and filling the task objective into the position of the corresponding task objective description in the prompt template. In this way, the large language model can obtain the grading basis of the graphical programming assignment, that is, the task objective, from the prompt template, and thus can grade the graphical programming assignment by judging whether the graphical programming assignment meets the task objective.

[0036] Further, before inputting the filled prompt template into the large language model, the method for grading the graphical programming assignment further includes:

[0037] Obtain the stage description information of the stage corresponding to the graphical programming assignment;

[0038] Fill the stage description information into the position of the corresponding stage description in the prompt template.

[0039] In the above implementation process, by obtaining the stage description information of the stage corresponding to the graphical programming assignment and filling the stage description information into the position of the corresponding stage description in the prompt template. In this way, the large language model can obtain the stage description information through the prompt template, so that the large language model can correct the graphical programming assignment more accurately based on the stage description information.

[0040] Further, before inputting the filled prompt template into the large language model, the method for correcting the graphical programming assignment further includes:

[0041] Obtain the names and functions of each preset building block; the preset building blocks are the building blocks allowed to be used in the graphical programming assignment;

[0042] Fill the names and functions of each preset building block into the position of the corresponding building block description in the prompt template.

[0043] In the above implementation process, by filling the names and functions of the preset building blocks into the position of the corresponding building block description in the prompt template, in this way, the large language model can obtain the names and functions of the building blocks allowed to be used in the graphical programming assignment through the prompt template, so as to more accurately understand the true intention of the graphical programming assignment by using the known names and functions of the preset building blocks, so as to more accurately correct the graphical programming assignment.

[0044] Further, before inputting the filled prompt template into the large language model, the method for correcting the graphical programming assignment further includes:

[0045] Obtain the assignment inspection information, where the assignment inspection information includes the building blocks required to be inspected in this assignment;

[0046] Fill the assignment inspection information into the position of the corresponding assignment inspection information description in the prompt template, so that the large language model corrects the graphical programming assignment according to the assignment inspection information.

[0047] In the above implementation process, by filling the building blocks required to be inspected in this assignment into the position of the corresponding assignment inspection information description in the prompt template. In this way, the large language model can obtain the assignment inspection information through the prompt template, so as to judge whether the graphical programming assignment uses the building blocks required to be inspected in this assignment, that is, to judge whether the graphical programming assignment achieves the assignment inspection purpose, so as to assist the user to better understand the key points of the graphical programming assignment.

[0048] Further, before inputting the filled prompt template into the large language model, the method for grading graphical programming assignments further includes:

[0049] Obtain a preset reference answer;

[0050] Fill the reference answer into the position described by the corresponding reference answer in the prompt template.

[0051] In the above implementation process, by filling the reference answer into the position described by the corresponding reference answer in the prompt template. In this way, the large language model can obtain the reference answer through the prompt template, so as to grade the graphical programming assignment based on the reference answer, determine the real reason for the error in the graphical programming assignment, and give more targeted guiding prompts.

[0052] In a second aspect, an embodiment of the present application further provides a device for grading graphical programming assignments, including:

[0053] A first acquisition module, configured to acquire the program source code of the graphical programming assignment; the graphical programming assignment includes multiple building blocks with splicing relationships;

[0054] A second acquisition module, configured to, for each building block, acquire the configuration information of the building block from the program source code, where the configuration information includes the parameter information, text display information, and the relative position relationship between the text display information and the parameter information of the building block;

[0055] A first combination module, configured to combine the parameter information and text display information of the building block according to the relative position relationship between the text display information and the parameter information to obtain the text description of the building block;

[0056] A third acquisition module, configured to acquire the running logic between the building blocks according to the program source code;

[0057] A second combination module, configured to combine the text descriptions of the building blocks according to the running logic between the building blocks to obtain the structured description of the graphical programming assignment;

[0058] An input module, configured to input the structured description of the graphical programming assignment into a preset large language model, so that the large language model grades the graphical programming assignment according to the structured description and gives guiding prompts.

[0059] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a memory, and a communication bus; the communication bus is used to implement connection communication between the processor and the memory; the processor is used to execute one or more programs stored in the memory to implement the method for correcting any one of the above graphical programming operations.

[0060] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for correcting any one of the above graphical programming operations.

[0061] In a fifth aspect, an embodiment of the present application further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, it implements the method for correcting any one of the above graphical programming operations. Description of the Drawings

[0062] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0063] FIG. 1(a) is a schematic diagram of a graphical programming interface capable of performing graphical programming operations provided by an embodiment of the present application;

[0064] FIG. 1(b) is a schematic diagram of a stage area provided by an embodiment of the present application;

[0065] FIG. 1(c) is a schematic diagram of an object area provided by an embodiment of the present application;

[0066] FIG. 1(d) is a schematic diagram of a block menu bar provided by an embodiment of the present application;

[0067] FIG. 1(e) is a schematic diagram of a block work area provided by an embodiment of the present application;

[0068] Figure 2 is a schematic flowchart of a method for correcting a graphical programming operation provided by an embodiment of the present application;

[0069] Figure 3 is a schematic diagram of a graphical programming operation provided by an embodiment of the present application;

[0070] Figure 4 is a schematic diagram of a structured description of a graphical programming operation provided by an embodiment of the present application;

[0071] Figure 5 It is a schematic flowchart of a method for constructing a prompt template provided by an embodiment of the present application;

[0072] Figure 6(a) is a schematic diagram of another graphical programming interface provided by an embodiment of the present application;

[0073] Figure 6(b) is a schematic diagram of the correction result of a large language model provided by an embodiment of the present application;

[0074] Figure 7(a) is a schematic diagram of another graphical programming interface provided by an embodiment of the present application;

[0075] Figure 7(b) is a schematic diagram of the correction result of a large language model provided by an embodiment of the present application;

[0076] Figure 8(a) is a schematic diagram of another graphical programming interface provided by an embodiment of the present application;

[0077] Figure 8(b) is a schematic diagram of the correction result of a large language model provided by an embodiment of the present application;

[0078] Figure 9 It is a schematic structural diagram of a device for correcting graphical programming assignments provided by an embodiment of the present application;

[0079] Figure 10 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0080] Next, the technical solutions in the embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application.

[0081] Embodiment 1:

[0082] In order to solve the problem that for programming errors outside the answer coverage range, the real cause of graphical programming errors cannot be analyzed, and no targeted guiding prompts can be given, an embodiment of the present application provides a method for correcting graphical programming assignments. Figure 1(a) is a schematic diagram of a graphical programming interface that can perform graphical programming assignments provided by this embodiment. As shown in Figure 1(a), the graphical programming interface may include a stage area 1, an object area 2, and a code area 3.

[0083] Specifically, the stage area 1 can be as shown in FIG. 1(b). The stage area 1 is used to display the stage of the graphical programming assignment. The object area 2 can be as shown in FIG. 1(c). The object area 2 is used to display the operation objects allowed for the graphical programming assignment, such as Hemu and grid roads. The code area 3 includes a building block work area and a building block menu bar. The building block menu bar can be as shown in FIG. 1(d). The building block menu bar is used to display the building blocks allowed for the graphical programming assignment, such as "Move (10) steps", "Face (90) degrees", "Say (Hello) (2) seconds", "Play sound (Determine Wulahuu 24) wait for playback", "When (Start) is clicked", "Wait (1) second", "Repeat (10) times". The building block work area can be as shown in FIG. 1(e). The building block work area is used for splicing building blocks to form a graphical programming assignment. The building block work area can also include the task objectives of the graphical programming assignment, such as: help Hemu turn around and return to the carrot forest. The building block work area can also include the prompt information of graphical programming, such as: The [Face... degrees] code block is in the [Motion] module.

[0084] In this way, the user can analyze the task objectives of the graphical programming assignment and the stage of the graphical programming assignment, obtain the operation objects required for the graphical programming assignment, and the code running logic that can achieve the task objectives of the graphical programming assignment. Then, the user can select the operation objects in the object area and drag the building blocks from the building block menu bar to the building block work area according to the code running logic for splicing to obtain the graphical programming assignment.

[0085] Similarly, as shown in FIG. 1(a), the task objectives of the graphical programming assignment are, for example: help Hemu turn around and return to the carrot forest. By analyzing the task objective of the graphical programming assignment "help Hemu turn around and return to the carrot forest", it can be determined that the operation object of the graphical programming assignment is "Hemu". And by analyzing the stage area, it can be determined that Hemu is 4 grid distances away from the carrot forest. And Hemu is facing away from the carrot forest. Among them, when the character moves 10 steps, it represents 1 grid distance in the stage area. Therefore, the code running logic to achieve the task objectives of the graphical programming assignment can be to splice 4 "[Move 10 steps]" programming building blocks and control "Hemu" to face the carrot forest.

[0086] The following uses specific embodiments to elaborate in detail on the technical solution of the present application and how the technical solution of the present application solves the above technical problems.

[0087] It can be seen from Figure 2 shown Figure 2 that the following is a schematic flowchart of a method for grading a graphical programming assignment provided in an embodiment of the present application, including:

[0088] Step S201: Obtain the program source code of the graphical programming assignment. The graphical programming assignment includes multiple building blocks with a splicing relationship.

[0089] In an alternative embodiment of the present application, the program source code of the graphical programming assignment can be obtained when the graphical programming assignment is completed. In some embodiments, it can be determined that the graphical programming assignment is completed when the button representing the graphical programming assignment is clicked. Examples of the button representing the graphical programming assignment include: submitting the assignment.

[0090] The type of the starting building block of the graphical programming assignment is an event trigger block, and the event trigger block represents the execution condition of the graphical programming assignment. When the execution condition in the event trigger block is met, it can be determined that the graphical programming assignment is completed, and the graphical programming assignment can be executed.

[0091] The event trigger block can be, for example, "when start is clicked". Correspondingly, when the user clicks the start button on the stage, it can be determined that the graphical programming assignment is completed, and the graphical programming assignment is executed. The event trigger block can also be, for example, "the value of the timer is greater than A". Correspondingly, when the value of the timer is greater than A, it can be determined that the graphical programming assignment is completed, and the graphical programming assignment is executed.

[0092] In another alternative implementation manner of the present application, the program source code of the graphical programming assignment can also be obtained during the process of the graphical programming assignment. The process of the graphical programming assignment is the process in which the user drags and drops and splices the building blocks. Correspondingly, when the user drags and drops and splices the building blocks, the program source code of the already spliced building blocks can be obtained.

[0093] The program source code of the graphical programming assignment is implemented based on the graphical programming environment. In the graphical programming environment, the code exists in the form of building blocks. At the same time, from the graphical programming environment, the program code corresponding to each building block can be obtained. And the form in which the program code exists can be in JSON format. The program source code of the graphical programming assignment includes the program codes of multiple building blocks with a splicing relationship, and the running logic between the program codes of multiple building blocks.

[0094] Step S202: For each building block, obtain the configuration information of the building block from the program source code. The configuration information includes the parameter information of the building block, the text display information, and the relative position relationship between the text display information and the parameter information.

[0095] The program source code includes the program code corresponding to each building block respectively. And in the program code of each building block, there are multiple fields, such as: parameter field, text display field, building block type field, building block identification field.

[0096] Correspondingly, for each building block, a field value can be obtained from the parameter field of the program code of the building block, and when the field value of the parameter field corresponding to the building block is a parameter value, it is determined that the parameter value is the parameter information of the building block. Alternatively, for each building block, a field value can be obtained from the corresponding parameter field of the building block, that is, the field value is obtained from the parameter field in the program code of the building block, and when the field value of the parameter field corresponding to the building block is the building block identifier of another building block, the text description of the other building block is used as the parameter information of the building block. The other building block is any building block other than the building block itself.

[0097] Exemplarily, when it is determined that the field value of the parameter field corresponding to the building block is the building block identifier of another building block, a matching operation can be performed using the building block identifier of the other building block in the preset correspondence between the building block identifier and the text description. If the text description of the other building block is obtained, the text description of the other building block is directly used as the parameter information of the building block. If the text description of the other building block is not obtained, the configuration information of the other building block can be obtained from the program source code, and the parameter information and the text display information of the other building block are combined according to the relative position relationship between the text display information and the parameter information of the other building block to obtain the text description of the other building block; the text description of the other building block is used as the parameter information of the building block.

[0098] In some embodiments, the graphical programming assignment includes a building block B1. For the building block B1, the configuration information of the building block B1 can be obtained from the program source code. If in the program source code, the field value of the parameter field corresponding to the building block B1 is the building block identifier of another building block, such as B2. Then the configuration information of the building block B2 can be obtained from the program source code, and the parameter information and the text display information of the building block B2 are combined according to the relative position relationship between the text display information and the parameter information of the building block B2 to obtain the text description of the building block B2. The text description of the building block B2 is used as the parameter information of the building block B1.

[0099] Similarly, the text display information of the building block, as well as the relative positional relationship between the field value of the parameter field of the building block and the text display information of the building block, can be obtained from the text display field corresponding to the building block. The display content on the building block includes the text display information and the field value of the parameter field of the building block. Similarly, the building block identifier of the building block can also be obtained from the building block identifier field corresponding to the building block. The building block type of the building block can also be obtained from the building block type field corresponding to the building block. The field value in the building block type field is one of event trigger, control, action, and variable modification. When the type of the building block is event trigger, the building block is used to represent the condition for triggering the execution of the graphical programming task. An example of a building block of the event trigger type is: when [Start] is clicked. When the type of the building block is control, the building block is used to describe the control logic. An example of a building block of the control type is: repeat (10) times, if... then.... When the type of the building block is action, the building block is used to describe the specific operation. An example of a building block of the action type is: move (10) steps, set the variable [sum] to 0. When the type of the building block is variable, the building block is used to describe the setting and change of variables. An example of a building block of the variable type is: add i to [sum], increment the variable [i] by 1.

[0100] Step S203, combine the parameter information and text display information of the building block according to the relative positional relationship between the text display information and the parameter information, to obtain the text description of the building block.

[0101] Exemplarily, the relative positional relationship between the text display information and the parameter information characterizes the spatial position of the text display information and the parameter information on the building block. Specifically, it may include the distance between the text display information and the parameter information, and the directional relationship between the text display information and the parameter information.

[0102] The text description of the building block can be at least one of Chinese description, symbols, and English description.

[0103] Step S204, obtain the running logic between the building blocks according to the program source code.

[0104] Exemplarily, the program source code can be parsed to obtain the abstract syntax tree corresponding to the program source code. Then, the running logic between the building blocks can be obtained from the abstract syntax tree.

[0105] Step S205, combine the text descriptions of the building blocks according to the running logic between the building blocks, to obtain the structured description of the graphical programming task.

[0106] Exemplarily, the running logic includes the running order and running conditions among the building blocks. According to the running logic among the building blocks, the textual descriptions of the building blocks are combined, and the structured description of the graphical programming assignment can be achieved in the following way: According to the running conditions among the building blocks, the delimiters corresponding to the running conditions are determined. The textual descriptions of the building blocks are arranged according to the running order among the building blocks, and the delimiters corresponding to the running conditions are used to separate the textual descriptions among the arranged building blocks, so as to obtain the structured description of the graphical programming assignment. The delimiter can be "space", "\", ";", starting a new line, indenting the first line by 2 characters, etc.

[0107] In some embodiments, the running conditions among the building blocks include one of sequential running, conditional running, and loop running. Sequential running means that the building blocks are executed in sequence according to the set execution order. Conditional running means that the building blocks are executed in sequence according to the set execution order only when the set conditions are met. Loop running means that the building blocks are repeatedly executed.

[0108] Step S206, input the structured description of the graphical programming assignment into a preset large language model, so that the large language model corrects the graphical programming assignment according to the structured description and gives guiding prompts.

[0109] A large language model is a model that can generate natural language text or understand the meaning of language text. The above solution of the embodiments of the present application uses the large language model to correct the graphical programming assignment and give guiding prompts. Then, based on the ability of the large language model itself to understand the meaning of language text, it is possible to give the reasons for the occurrence of the analyzed graphical programming errors for various programming errors (including programming errors outside the answer coverage range), and give targeted guiding prompts, thereby solving to a certain extent the problems existing in the related art that for programming errors outside the answer coverage range, the real reasons for the occurrence of the graphical programming errors cannot be analyzed, nor can targeted guiding prompts be given.

[0110] In addition, due to the particularity of the graphical programming technology field, graphical programming assignments are composed of multiple graphical building blocks spliced together, which cannot be recognized by large language models. As a result, large language models cannot be directly applied to the scenario of grading graphical programming assignments in the graphical programming technology field. In the above implementation process, by obtaining the text description of each building block in the graphical programming assignment and the running logic between the building blocks, and then combining the text descriptions of the building blocks according to the running logic between the building blocks, a structured description of the graphical programming assignment is obtained. In this way, the graphical programming assignment presented in the form of building blocks can be transformed into a structured description that can be understood by large language models. This enables large language models to understand the true intention of the graphical programming assignment based on the structured description of the graphical programming assignment, so that the grading of the graphical programming assignment can be realized through large language models, the reasons for the errors in the graphical programming assignment can be known, and then guiding prompts can be given for the reasons for the errors.

[0111] In addition, since what large language models can understand is structured descriptions, the accuracy of the structured descriptions will directly affect the assignment grading effect of large language models. Also, since graphical programming assignments are formed by users dragging and dropping building blocks for splicing, how to convert graphical programming assignments into structured descriptions that can more accurately describe the internal logic of graphical programming assignments will directly affect the assignment grading effect of large language models. For this reason, in the above implementation manner of the embodiments of the present application, by obtaining the program source code of the graphical programming assignment, the program source code composed of the program codes of the building blocks dragged and dropped and spliced by the user is obtained. Furthermore, the parameter information and text display information of each building block are obtained from the program source code, and the text description of each building block is formed by using the parameter information and text display information, so that the text description of the building blocks dragged and dropped and spliced by the user can be obtained more accurately. Then, according to the running logic between the building blocks, the text descriptions of the building blocks are combined, so that the obtained structured description of the graphical programming assignment can more accurately describe the internal logic of the graphical programming assignment.

[0112] Embodiment 2

[0113] This embodiment further illustrates the present application on the basis of Figure 2 the embodiment.

[0114] The graphical programming assignment, for example Figure 3As shown, this graphical programming task is composed of the building blocks "when (start) is clicked", "glide (10) steps", "if (x)? then (y)", "glide (10) steps", "touch (mouse pointer ▼)", and "say (hello) (2) seconds". Among them, the building block "when (start) is clicked" has the building block "glide (10) steps" spliced below it, the building block "glide (10) steps" has the building block "if (x)? then (y)" spliced below it, and the building block "if (x)? then (y)" has the building block "glide (10) steps" spliced below it. Also, the building block "touch (mouse pointer ▼)" is nested at the position of x in the building block "if (x)? then (y)", and the building block "say (hello) (2) seconds" is nested at the position of y in the building block "if (x)? then (y)". For this graphical programming task, the program source code of this graphical programming task can be obtained first, and then the configuration information of each building block can be obtained from the program source code of this graphical programming task. And the parameter information and text display information of each building block are combined according to the relative position relationship between the text display information and parameter information of each building block to obtain the text description of each building block.

[0115] Exemplarily, the parameter information of the building block "when (start) is clicked" is start. The relative position relationship between the text display information and parameter information of the building block "when (start) is clicked" is for example: when () is clicked. Further, the text description of the building block "when (start) is clicked" can be obtained: when start is clicked. Among them, () is the filling position of the parameter information. The parameter information of the building block "glide (10) steps" is start. The relative position relationship between the text display information and parameter information of the building block "glide (10) steps" is for example: glide () steps. Further, the text description of the building block "glide (10) steps" can be obtained, that is: glide 10 steps.

[0116] For the building block "touch (mouse pointer ▼)", the parameter information of the building block "touch (mouse pointer ▼)" is mouse pointer, and the relative position relationship between the text display information and parameter information of the building block "touch (mouse pointer ▼)" is for example touch (). Therefore, the text description of the building block "touch (mouse pointer ▼)" is: touch mouse pointer.

[0117] For the building block "say (hello) (2) seconds", the parameter information of the building block "say (hello) (2) seconds" includes hello and 2. The relative position relationship between the text display information and parameter information of the building block "say (hello) (2) seconds" is say () () seconds. Therefore, the text description of the building block "say (hello) (2) seconds" is: say hello 2 seconds.

[0118] The relative positional relationship between the text display information and the parameter information of the building block "if (x)? then (y)" is, for example: if ()? then (). The field values of the parameter fields of the building block "if (x)? then (y)" include the building block identifier S1 of the building block "touch (mouse pointer ▼)" and the building block identifier S2 of the building block "say (hello) (2) seconds". Then, the text description of the building block "touch (mouse pointer ▼)" and the text description of the building block "say (hello) (2) seconds" can be used as the parameter information of the building block "if (x)? then (y)", that is, when touching the mouse pointer, say hello for 2 seconds.

[0119] At the same time, the graphical programming assignment can also be parsed to obtain the abstract syntax tree of the graphical programming assignment. Then, the running logic between the building blocks in the graphical programming assignment can be obtained from the abstract syntax tree of the graphical programming assignment. Exemplarily, the running condition between the building block "when (start) is clicked" and the building block "glide (10) steps" is sequential execution, and the building block "when (start) is clicked" is executed first, and then the building block "glide (10) steps" is executed. The running condition between the building block "glide (10) steps" and the building block "if (x)? then (y)" is sequential execution, and the building block "glide (10) steps" is executed first, and then the building block "if (x)? then (y)" is executed. However, the running condition between the building block "touch (mouse pointer ▼)" and the building block "say (hello) (2) seconds" is conditional execution, that is, when touching the mouse pointer, it will say hello. Finally, according to the running conditions between the building blocks, the delimiters corresponding to the running conditions are determined, the text descriptions of the building blocks are arranged according to the running order between the building blocks, and the text descriptions between the arranged building blocks are separated by the delimiters corresponding to the running conditions, obtaining as Figure 4 the structured description of the graphical programming assignment shown.

[0120] Example 3:

[0121] Based on the above embodiment, in order for the large language model to better understand the true meaning of the graphical programming assignment, a method for constructing a prompt template is provided based on the structured description of the graphical programming assignment, combined with Figure 5 as shown, the method for constructing a prompt template may include the following steps:

[0122] Step S501, fill the structured description of the graphical programming assignment into the filling position of the corresponding programming assignment description in the preset prompt template.

[0123] Step S502, obtain the role definition for the large language model, and fill the role definition for the large language model into the position of the corresponding role description in the prompt template.

[0124] The role definition for the large language model is used to assist the large language model in clarifying its own responsibilities and functions. This enables the large language model to give guiding hints for graphical programming tasks according to its responsibilities.

[0125] An example of the role definition for the large language model is: You are a programming teacher. We need to write code blocks for the specified role to control the characters in the stage area to complete the task objectives.

[0126] Step S503: Obtain the task objective of the graphical programming task; and fill the task objective into the corresponding position of the task objective description in the prompt template.

[0127] The graphical programming problem can be obtained, and the task objective of the graphical programming task can be obtained from the graphical programming problem. Examples of the task objective of the graphical programming task are: Control the motorcycle to slide onto the elevator.

[0128] Step S504: Obtain the stage description information of the stage corresponding to the graphical programming task, and fill the stage description information into the corresponding position of the stage description in the prompt template.

[0129] When the graphical programming platform presents a graphical programming problem, the graphical programming platform will provide the stage corresponding to the graphical programming problem, and the stage includes information such as the scene and the operating objects.

[0130] When the graphical programming task is running, in this stage, the operating objects specified by the graphical programming task will move, talk, etc. in the scene of this stage according to the running logic of the graphical programming task.

[0131] Exemplarily, the user can specify the operating object in the stage area and describe the attributes and states of the operating object at the same time. The large language model can generate stage description information by using the received operating object and the attributes and states of the operating object.

[0132] Step S505: Obtain the names and functions of the preset building blocks, and fill the names and functions of the preset building blocks into the corresponding positions of the building block descriptions in the prompt template. The preset building blocks are the building blocks allowed to be used in the graphical programming task.

[0133] Exemplarily, the building block "when clicked at the start" represents the start of running. The building block "slide 10 steps" represents making the operating object slide 10 steps, representing 1 grid distance in the stage area. The building block "slide 20 steps" represents making the operating object slide 20 steps, representing 2 grid distances in the stage area. The building block "face →" represents making the operating object turn right.

[0134] Step S506: Obtain the job inspection information and fill the job inspection information into the corresponding position described in the prompt template for the job inspection information. The job inspection information includes the building blocks required for this job.

[0135] The large language model can correct the graphical programming job according to the job inspection information, that is, it is necessary to judge not only whether the graphical programming job meets the task objectives, but also whether the graphical programming job uses the building blocks required for this job. In the case that the building blocks required for this job are not used in the graphical programming job, even if the graphical programming job can meet the task objectives, a prompt message will be sent, that is, the user will be prompted to use the building blocks required for this job for graphical programming.

[0136] Exemplarily, the inspection information is, for example: slide 10 steps, while the building blocks used in the graphical programming job are jump 10 steps. In this case, even if the graphical programming job can meet the task objectives, a guiding prompt will be sent.

[0137] Step S507: Obtain the preset reference answer and fill the reference answer into the corresponding position described in the prompt template for the reference answer.

[0138] The execution order between the foregoing steps S501 to S507 can be changed arbitrarily. Exemplarily, step S503 can be executed first, and then other steps. Or step S507 can be executed first, and then other steps. The execution order between steps S501 to S507 is not restricted herein.

[0139] Step S508: Input the filled prompt template into the large language model.

[0140] The method for constructing the prompt template provided by the embodiments of the present application can unify the data formats of different graphical programming jobs by constructing the prompt template, avoiding the large language model from having an understanding deviation of the graphical programming job due to different expressions of the data formats, thereby improving the correction accuracy of the large language model for the graphical programming job.

[0141] Combined with the schematic diagram of the graphical programming interface shown in FIG. 6(a), the task objective of the graphical programming job can be obtained from the building block work area in FIG. 6(a): Control the motorcycle to slide onto the elevator. The graphical programming job includes building blocks "when clicked at the start", "face ↑", and "slide 30 steps". And according to the object area in the graphical programming interface shown in FIG. 6(a), it can be determined that the operation object selected by the learner is the motorcycle. At the same time, according to the stage area in the graphical programming interface shown in FIG. 6(a), it can be determined that the motorcycle is 3 grids away from the elevator.

[0142] For the graphical programming assignment shown in Figure 6(a), the grading results of the large language model can be as shown in Figure 6(b):

[0143] You adopted the method of facing upward and sliding 30 steps. However, the initial direction of the motorcycle is to the right. If you let the motorcycle face upward and slide, it may not reach the elevator.

[0144] Hint: The motorcycle is initially facing right, and the elevator is three grids to the right of the motorcycle. Try considering the motorcycle sliding directly to the position of the elevator without changing its direction. By doing so, you can more accurately control the distance the motorcycle moves.

[0145] Try again! You can use the [Slide] code block to slide a certain number of steps to ensure that the motorcycle slides to the elevator facing right.

[0146] Moreover, the large language model can also output the structured description of the graphical programming assignment shown in Figure 6(a):

[0147] The student's code is as follows:

[0148] Code for the <Motorcycle> character:

[0149] Face ↑

[0150] Slide 30 steps

[0151] Combined with the schematic diagram of the graphical programming interface shown in Figure 7(a), the task objective of the graphical programming assignment can be obtained from the block work area in Figure 7(a): Control the motorcycle to slide onto the elevator. The graphical programming assignment includes the blocks "When clicked at the start", "Slide 10 steps", and "Slide 10 steps". And according to the object area in the graphical programming interface shown in Figure 7(a), it can be determined that the operation object selected by the learner is the motorcycle. At the same time, according to the stage area in the graphical programming interface shown in Figure 7(a), it can be determined that the motorcycle is three grids away from the elevator.

[0152] For the graphical programming assignment shown in Figure 7(a), the grading results of the large language model can be as shown in Figure 7(b):

[0153] You have successfully made the motorcycle slide 20 steps (which is 2 grids), which is very good! But according to the task objective, the motorcycle needs to slide 3 grids to reach the elevator. Currently, you are one grid short.

[0154] Please think carefully again about how to make the motorcycle slide one more grid? You can try adding or modifying the existing code blocks to complete this task. Come on!

[0155] Moreover, the large language model can also output a structured description of the graphical programming assignment as shown in Figure 7(a):

[0156] Hello, student! Your current code is as follows:

[0157] When start is clicked

[0158] Glide 10 steps

[0159] Glide 10 steps

[0160] Combined with the schematic diagram of the graphical programming interface shown in Figure 8(a), the task objective of the graphical programming assignment can be obtained from the block work area in Figure 8(a): Control the motorcycle to glide onto the elevator. The graphical programming assignment includes the blocks "When start is clicked", "Glide 20 steps", and "Glide 10 steps". And according to the object area in the graphical programming interface shown in Figure 8(a), it can be determined that the operation object selected by the learner is the motorcycle. At the same time, according to the stage area in the graphical programming interface shown in Figure 8(a), it can be determined that the motorcycle is 3 grids away from the elevator.

[0161] For the graphical programming assignment shown in Figure 8(a), the grading result of the large language model can be as shown in Figure 8(b):

[0162] Logically speaking, the student's code can achieve the motorcycle gliding onto the elevator, because the motorcycle is initially 3 grids away from the elevator. After gliding 20 steps (2 grids) and then gliding 10 steps (1 grid), it has glided a total of 3 grids and just reaches the elevator. Therefore, the code is correct.

[0163] However, to help the student better understand and improve, the following tips can be given:

[0164] Clear thinking: You have applied the glide code block well and understood the concept that every 10 steps represents one grid.

[0165] Code optimization: Although your code has achieved the goal, in some cases, concise code is easier to maintain and understand. You can consider whether the same task can be completed with fewer steps.

[0166] Code style: Maintaining code consistency is also a good programming habit. For example, you can consider gliding the same number of steps each time, or indicating in the comments why different numbers of steps are chosen.

[0167] Encourage the student to think:

[0168] Are there other ways to achieve the same effect?

[0169] If the distance between the motorcycle and the elevator changes, can your code still respond flexibly?

[0170] In conclusion, your code is correct, but you can try to achieve this task in a more concise and consistent way. I wish you continued progress in your programming learning!

[0171] In addition, the large language model can also output a structured description of the graphical programming job:

[0172] Hello, classmate! Your current code is as follows:

[0173] <Motorcycle> Character Code:

[0174] When Start is clicked

[0175] Slide 20 steps

[0176] Slide 10 steps

[0177] Embodiment 4:

[0178] Based on the same inventive concept, the present application also provides a graphical programming job correction device 900. Figure 9 , Figure 9 Shows the use of Figure 2 The device 900 is a graphical programming job correction device according to the method shown. The specific functions of the device 900 can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here. The device 900 includes at least one software function module that can be stored in a memory in the form of software or firmware or fixed in the operating system of the device 900. Specifically:

[0179] See also Figure 9 As shown, the apparatus 900 is applied to a service distribution device, and includes: a first acquisition module 901, a second acquisition module 902, a first combination module 903, a third acquisition module 904, a second combination module 905 and an input module 906. Among them:

[0180] The first acquisition module 901 is configured to acquire program source code of a graphical programming operation; the graphical programming operation includes a plurality of building blocks having a splicing relationship.

[0181] The second acquisition module 902 is configured to acquire configuration information of each building block from the program source code, wherein the configuration information includes parameter information, text display information, and the relative position relationship between the text display information and the parameter information of the building block.

[0182] The first combining module 903 is configured to combine the parameter information and the text display information of the building block according to the relative position relationship between the text display information and the parameter information to obtain a text description of the building block.

[0183] The third acquisition module 904 is configured to acquire the operation logic between the building blocks according to the program source code.

[0184] The second combination module 905 is configured to combine the text descriptions of the building blocks according to the operation logic between the building blocks, so as to obtain a structured description of the graphical programming assignment.

[0185] The input module 906 is configured to input the structured description of the graphical programming assignment into a preset large language model, so that the large language model corrects the graphical programming assignment according to the structured description and gives guiding prompts.

[0186] In a feasible implementation manner of the embodiment of the present application, if in the program source code, the field value of the parameter field corresponding to the building block is a parameter value, the second acquisition module 902 is specifically configured to determine that the parameter value is the parameter information of the building block.

[0187] In a feasible implementation manner of the embodiment of the present application, if in the program source code, the field value of the parameter field corresponding to the building block is the building block identifier of another building block, the second acquisition module 902 is specifically configured to use the text description of the other building block as the parameter information of the building block.

[0188] In this embodiment, the second acquisition module 902 is specifically configured to, when determining that the field value of the parameter field corresponding to the building block is the building block identifier of another building block, obtain the configuration information of the other building block from the program source code, and combine the parameter information and text display information of the other building block according to the relative position relationship between the text display information and parameter information of the other building block, so as to obtain the text description of the other building block; use the text description of the other building block as the parameter information of the building block.

[0189] In a feasible implementation manner of the embodiment of the present application, the third acquisition module 904 is specifically configured to parse the program source code to obtain an abstract syntax tree corresponding to the program source code; obtain the operation logic between the building blocks from the abstract syntax tree.

[0190] In a feasible implementation manner of the embodiment of the present application, the second combination module 905 is specifically configured to determine the delimiters corresponding to the operation conditions according to the operation conditions between the building blocks; arrange the text descriptions of the building blocks according to the operation sequence between the building blocks, and use the delimiters corresponding to the operation conditions to separate the text descriptions between the arranged building blocks, so as to obtain a structured description of the graphical programming assignment.

[0191] In a feasible implementation manner of the embodiment of the present application, the input module 906 is specifically configured to fill the structured description of the graphical programming assignment into the filling position of the corresponding programming assignment description in a preset prompt word template; input the filled prompt word template into the large language model.

[0192] In a feasible implementation manner of the embodiment of the present application, the input module 906 is further configured to obtain a role definition for the large language model; fill the role definition for the large language model into the position of the corresponding role description in the prompt template, so that the large language model outputs a guiding prompt for the graphical programming assignment according to the prompt form corresponding to the role definition.

[0193] In a feasible implementation manner of the embodiment of the present application, the input module 906 is further configured to obtain the task objective of the graphical programming assignment; fill the task objective into the position of the corresponding task objective description in the prompt template.

[0194] In a feasible implementation manner of the embodiment of the present application, the input module 906 is further configured to obtain the stage description information of the stage corresponding to the graphical programming assignment; fill the stage description information into the position of the corresponding stage description in the prompt template.

[0195] In a feasible implementation manner of the embodiment of the present application, the input module 906 is further configured to obtain the names and functions of each preset building block; the preset building blocks are the building blocks allowed to be used in the graphical programming assignment; fill the names and functions of each preset building block into the position of the corresponding building block description in the prompt template.

[0196] In a feasible implementation manner of the embodiment of the present application, the input module 906 is further configured to obtain the assignment assessment information, and the assignment assessment information includes the building blocks required to be examined in this assignment; fill the assignment assessment information into the position of the corresponding assignment assessment information description in the prompt template, so that the large language model corrects the graphical programming assignment according to the assignment assessment information.

[0197] In a feasible implementation manner of the embodiment of the present application, the input module 906 is further configured to obtain a preset reference answer; fill the reference answer into the position of the corresponding reference answer description in the prompt template.

[0198] It should be understood that, for the sake of concise description, some content described in the first embodiment will not be repeated in this embodiment.

[0199] Embodiment Five:

[0200] Based on the same inventive concept, this embodiment provides an electronic device, as shown in Figure 10 which includes a processor 101 and a memory 102. Among them:

[0201] The processor 101 is configured to execute one or more programs stored in the memory 102 to implement the above method for correcting graphical programming assignments.

[0202] It can be understood that the processor 101 can be a processor core or a processor chip, or other circuits that can be programmed and run. The memory 102 can be RAM (Random Access Memory), ROM (Read-Only Memory), flash memory, etc., but this is not restrictive.

[0203] It can also be understood that Figure 10 The structure shown is only illustrative, and the electronic device may also include more or fewer components than those shown Figure 10 in the figure, or have a different configuration from that shown Figure 10 in the figure. For example, it may also have an internal communication bus for implementing communication between the processor 101 and the memory 102; for another example, it may also have an external communication interface, such as a USB (Universal Serial Bus) interface, a CAN (Controller Area Network) bus interface, etc.; for another example, it may also have an information display component such as a display screen, but this is not restrictive.

[0204] Based on the same inventive concept, this embodiment also provides a computer-readable storage medium, such as a floppy disk, an optical disc, a hard disk, a flash memory, a USB flash drive, an SD (Secure Digital Memory Card) card, an MMC (Multimedia Card) card, etc. One or more programs for implementing the above steps are stored in the computer-readable storage medium, and these one or more programs can be executed by one or more processors to implement the above method for grading graphical programming assignments. Details are not described here again.

[0205] Based on the same inventive concept, this embodiment also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the above method for grading graphical programming assignments. Details are not described here again.

[0206] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some communication interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.

[0207] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0208] Furthermore, in each of the embodiments of the present application, the functional modules may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.

[0209] In this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0210] In this document, "a plurality of" means two or more.

[0211] The above description is only for the embodiments of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for grading graphical programming assignments, characterized in that, Including: Obtain the program source code of the graphical programming assignment; the graphical programming assignment includes multiple building blocks with a splicing relationship; For each building block, obtain the configuration information of the building block from the program source code; the configuration information includes the parameter information of the building block, the text display information, and the relative position relationship between the text display information and the parameter information; Combine the parameter information and the text display information of the building block according to the relative position relationship between the text display information and the parameter information to obtain the text description of the building block; Obtain the running logic between the building blocks according to the program source code; Combine the text descriptions of the building blocks according to the running logic between the building blocks to obtain the structured description of the graphical programming assignment; Input the structured description of the graphical programming assignment into a preset large language model, so that the large language model corrects the graphical programming assignment according to the structured description and gives guiding prompts.

2. The method according to claim 1, characterized in that, Obtain the configuration information of the building block from the program source code, including: If in the program source code, the field value of the parameter field corresponding to the building block is a parameter value, determine that the parameter value is the parameter information of the building block.

3. The method according to claim 1, characterized in that Obtain the configuration information of the building block from the program source code, including: If in the program source code, the field value of the parameter field corresponding to the building block is the building block identifier of another building block, use the text description of the other building block as the parameter information of the building block.

4. The method according to claim 1, wherein Obtain the running logic between the building blocks according to the program source code, including: Parse the program source code to obtain the abstract syntax tree corresponding to the program source code; Obtain the running logic between the building blocks from the abstract syntax tree.

5. The method according to claim 1, characterized in that The running logic includes the running order and running conditions between the building blocks; combine the text descriptions of the building blocks according to the running logic between the building blocks to obtain the structured description of the graphical programming assignment, including: Determine the delimiter corresponding to each running condition according to the running conditions between the building blocks; Arrange the text descriptions of the building blocks according to the running order between the building blocks, and separate the text descriptions between the arranged building blocks with the delimiter corresponding to the running condition to obtain the structured description of the graphical programming assignment.

6. The method according to any one of claims 1 to 5, characterized in that, Input the structured description of the graphical programming assignment into a preset large language model, including: Fill the structured description of the graphical programming assignment into the filling position of the corresponding programming assignment description in the preset prompt template; Input the filled prompt template into the large language model.

7. A device for grading graphical programming assignments, characterized in that, Including: The first acquisition module is configured to acquire the program source code of the graphical programming assignment; the graphical programming assignment includes multiple building blocks with a splicing relationship; The second acquisition module is configured to, for each building block, acquire the configuration information of the building block from the program source code, and the configuration information includes the parameter information of the building block, the text display information, and the relative position relationship between the text display information and the parameter information; The first combination module is configured to combine the parameter information and text display information of the building block according to the relative position relationship between the text display information and the parameter information, so as to obtain the text description of the building block; The third acquisition module is configured to obtain the running logic between the building blocks according to the program source code; The second combination module is configured to combine the text descriptions of the building blocks according to the running logic between the building blocks, so as to obtain the structured description of the graphical programming assignment; The input module is configured to input the structured description of the graphical programming assignment into a preset large language model, so that the large language model corrects the graphical programming assignment according to the structured description and gives guiding prompts.

8. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores computer executable instructions that can be executed by the processor. The processor executes the computer executable instructions to implement the method for correcting a graphical programming assignment according to any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium stores computer executable instructions. When the computer executable instructions are called and executed by the processor, the computer executable instructions cause the processor to implement the method for correcting a graphical programming assignment according to any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program, and when the computer program is executed by the processor, the method for correcting a graphical programming assignment according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Graphical programming work evaluation method

    CN113220286A

  • Programming homework correcting method, device and system based on deep learning and medium

    CN113778407A

  • Programming assignment automatic correction method and system, and medium

    CN113793112A

  • Homework correction method and device based on image recognition, equipment and storage medium

    CN115601778A

  • Method for expansion of the functional capability of a configurable control system for the workflow of a software system enabling different systems and protocols to be seamlessly connected together

    DE10136618A1