An mpython programming operation question automatic scoring system and method

CN122887655APending Publication Date: 2026-10-09SHENZHEN ZHUOFAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611373869.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

然而,积木在复制、删除、重新插入或文件重新保存后,其内部标识可能发生变化;同一编程逻辑也可能采用不同的积木排列或编辑过程实现

Benefits of technology

本发明通过对mPython文件进行块节点解析和端口化处理,以块类型、结构路径及端口连接关系建立节点对应,降低积木内部标识变化对评分结果的影响,提高答案识别准确性。通过提取新增、删除及重连连接边,并按照端口连接闭合关系反演插入、移动、包裹、拆分和替换等操作事务,能够将局部程序差异准确关联至具体评分项。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122887655A_ABST
    Figure CN122887655A_ABST
Patent Text Reader

Abstract

The application provides an mPython programming operation question automatic scoring system and method, the method comprises the following steps: obtaining a question template file, a standard answer file, a candidate answer file and a question configuration file, and analyzing to generate a corresponding block node tree and a port connection edge set; by establishing the corresponding relationship between the template block node and the candidate answer block node, extracting the newly added, deleted and reconnected connection edges, and inversing the candidate operation transaction according to the port closure relationship; based on the data dependency relationship of the standard operation transaction, screening the transformable objects, generating a hidden transformation parameter set and a hidden isomorphic template; mapping the candidate operation transaction and the standard operation transaction to the hidden isomorphic template and performing atomic replay according to the transaction dependency relationship, forming the candidate hidden program and the standard hidden program; finally, combining the structure verification, the code dependency verification, the original parameter running verification and the hidden parameter running verification to generate the automatic scoring result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer-aided instruction and automatic program evaluation technology, and in particular to an automatic scoring system and method for mPython programming exercises. Background Technology

[0002] With the development of graphical programming instruction, mPython is increasingly being used in programming skills assessments. Students complete their answers by dragging and dropping blocks, setting field parameters, and adjusting the order, nesting, and parameter connections between blocks, submitting their answers as .mxml files. These files contain both block content information and connection structure information, making them difficult to score using traditional text-based answer comparison methods.

[0003] Current scoring methods typically compare the block identifiers, block types, field values, program structure, or generated code in a candidate's answer directly with the standard answer. However, the internal identifiers of blocks may change after copying, deleting, re-inserting, or the file being resaved; the same programming logic may also be implemented using different block arrangements or editing processes. Therefore, direct comparison can easily lead to incorrect judgments of answers that are logically correct but have different operational paths. It is also difficult to identify specific operations such as block insertion, movement, wrapping, splitting, or replacement from differences in local connections, making it difficult to accurately correspond the difference results to the scoring items.

[0004] Furthermore, existing methods mostly verify the results under the original parameters of the question. When test takers directly input the original calculation results, sensor return values, or branch outputs, they may still obtain the same results as the standard answer, thus causing misjudgments when answering with fixed parameters. If the question parameters are directly and randomly modified, the program structure or control branches may be changed, affecting the comparability between the test taker's program and the standard program.

[0005] Therefore, this invention proposes an automatic scoring system and method for mPython programming exercises. The information disclosed in the background section is only for enhancing understanding of the background of this disclosure and may therefore contain prior art information that is not common knowledge to those skilled in the art. Summary of the Invention

[0006] The purpose of this invention is to address the shortcomings of existing technologies by providing an automatic scoring system and method for mPython programming exercises, thereby resolving the technical problems mentioned in the background section.

[0007] To achieve the above objectives, the present invention provides the following technical solution: An automatic scoring method for mPython programming exercises includes the following steps: S1. Obtain the question template file, standard answer file, candidate answer file, and question configuration file. Parse the first three files and generate the corresponding block node tree and port connection edge set. S2. Establish the correspondence between template block nodes and candidate answer block nodes, compare the template port connection edge set with the candidate port connection edge set, extract the newly added, deleted and reconnected connection edges to form the candidate port connection throughput difference set, and perform closed decomposition based on the operation transaction template library to obtain the candidate operation transaction set; S3. Extract the standard operation transaction set from the template block node tree and the standard answer block node tree, filter transformable objects based on data dependencies, generate a hidden transformation parameter set, and construct a hidden isomorphic template and node, port and variable mapping table; S4. Based on the mapping table, convert the candidate operation transaction set and the standard operation transaction set into a mapping operation transaction sequence, and perform atomic replay on an independent copy of the hidden isomorphic template according to the transaction dependency to generate the candidate hiding program and the standard hiding program. S5. Establish the correspondence between candidate operation transactions and standard operation transactions, perform structural verification, code dependency verification, original parameter execution verification and hidden parameter execution verification on candidate hidden programs and standard hidden programs, and generate automatic scoring results based on the verification results and question configuration files.

[0008] S1 specifically includes: obtaining the question template file, standard answer file, candidate answer file, and question configuration file; performing format, integrity, and version checks; establishing a scoring task and writing it to the shared task data pool; parsing the blocks, fields, nesting, order, parameters, and variable labels of each file; determining the block node relationships, field values, and variable declarations; establishing internal node keys according to the standard structure path; forming the corresponding initial block node tree and variable declaration table; configuring predecessor ports, successor ports, nested entry ports, parameter input ports, and parameter output ports according to the block type and label relationships; establishing successor connection edges, nested connection edges, and parameter connection edges; and generating the corresponding block node tree, port connection edge set, index table, and port conflict exception record.

[0009] S2 specifically includes: establishing templates and candidate node relationships based on the original Block ID, block type, parent block relationship, and connection relationship; converting the template port connection edge set and the candidate port connection edge set into normalized connection records; extracting deleted, added, and reconnected connection edges to form a candidate port connection throughput difference set; using unassigned difference items as seeds, aggregating shared block nodes, shared ports, and adjacent difference items, matching them with the operation transaction template library, and generating candidate candidate operation transactions of the insertion, move, wrap, split, or replacement types; determining the objective function value based on difference item coverage, port closure, and the number of operation transactions; performing minimum closure decomposition on the candidate candidate operation transactions to obtain the candidate operation transaction set and abnormal operation records.

[0010] S3 specifically includes: generating a set of valid standard operation transactions from the template block node tree and the standard answer block node tree according to the node correspondence with the same operation transactions as the candidate, port difference extraction, transaction template matching, and minimum closure decomposition rules, and determining the direct read object, direct write object, and target output; establishing a data dependency graph based on the objects, filtering transformable objects that can affect the target output but are not directly set by the candidate, and generating a set of hidden transformation parameters verified by running and output changes within the allowed value range; writing the set of hidden transformation parameters into the question template file, generating and reviewing the hidden isomorphic template, and establishing a template node mapping table, a template port mapping table, and a template variable mapping table.

[0011] S4 specifically includes: based on template nodes, ports, and variable mapping tables, converting existing template objects in the candidate operation transaction into corresponding objects in the hidden isomorphic template, retaining the type, fields, and internal connections of newly added blocks, and generating a candidate mapping operation transaction sequence; generating a standard mapping operation transaction sequence according to the same rules, extracting the creation, reading, and modification resources of each transaction, establishing transaction dependencies, and performing topological sorting to obtain the candidate transaction replay sequence and the standard transaction replay sequence; and performing atomic replay of pre-checks, port verification, structure verification, and failure rollback according to the corresponding transaction replay sequence on an independent copy of the hidden isomorphic template, generating the candidate hidden program, the standard hidden program, and replay exception records.

[0012] S5 specifically includes: establishing a one-to-one correspondence between candidate operation transactions and standard operation transactions based on transaction type, start and end ports, read / write objects, and target output; checking nested regions, parameter connections, port closures, and replay states to form structural verification evidence; standardizing transaction code and constructing an operation dependency graph; running the candidate hidden program and the standard hidden program under original and hidden parameters; collecting target outputs, conditional branches, and loop termination states to form code verification evidence and runtime verification evidence; combining structural verification evidence, code verification evidence, runtime verification evidence, and replay anomaly evidence into a scoring evidence package; calculating scores based on the full score of the scoring items and verification weights; determining error types and reasons for point deductions; and generating automatic scoring results.

[0013] An automatic scoring system for mPython programming exercises, comprising: The module includes a file parsing module, a transaction inversion module, an isomorphic transformation module, a transaction replay module, and a scoring and verification module. The file parsing module is used to obtain the question template file, standard answer file, candidate answer file and question configuration file, parse the block nodes and connection relationships in the first 3 files, and generate the corresponding block node tree and port connection edge set; The transaction inversion module is used to establish the correspondence between template block nodes and candidate answer block nodes, compare the template port connection edge set with the candidate port connection edge set, extract the added, deleted and reconnected connection edges to form the candidate port connection throughput difference set, and perform closed decomposition on the candidate port connection throughput difference set according to the operation transaction template library to obtain the candidate operation transaction set. The isomorphic transformation module is used to extract the standard operation transaction set from the template block node tree and the standard answer block node tree, filter transformable objects based on data dependencies, generate a hidden transformation parameter set, and construct a hidden isomorphic template, template node mapping table, template port mapping table, and template variable mapping table. The transaction replay module is used to convert the candidate operation transaction set and the standard operation transaction set into a mapping operation transaction sequence according to the mapping table, and perform atomic replay on an independent copy of the hidden isomorphic template according to the transaction dependency relationship to generate the candidate hiding program and the standard hiding program. The scoring and verification module is used to establish the correspondence between the candidate's operation transactions and the standard operation transactions. It performs structural verification, code dependency verification, original parameter execution verification, and hidden parameter execution verification on the candidate's hidden program and the standard hidden program, and generates automatic scoring results based on the verification results and the question configuration file.

[0014] The beneficial effects of this invention are as follows: This invention parses and portes mPython files into block nodes, establishing node correspondences based on block type, structural path, and port connection relationships. This reduces the impact of changes in internal block identifiers on scoring results and improves answer recognition accuracy. By extracting added, deleted, and reconnected edges, and reversing insertion, movement, wrapping, splitting, and replacement operations according to port connection closure relationships, it can accurately associate local program differences with specific scoring items.

[0015] This invention combines differences through minimal closed decomposition, reducing the repetitive interpretation of the same difference or the incorrect splitting of different operations, thus improving the reliability of complex block editing processes. By filtering transformable objects that affect the target output and constructing hidden isomorphic templates, the problem parameters are changed while maintaining the block structure and connection relationships, effectively identifying answer methods that directly write fixed results.

[0016] This invention restores operation results in both the candidate's program and the standard program by using transaction dependency sorting, atomic replay, and failure rollback, avoiding local anomalies from disrupting subsequent verification and improving the scoring stability of multi-step answers. Through structural verification, code dependency verification, and joint verification of original and hidden parameters, it distinguishes between missing operations, structural errors, fixed parameters, operational logic errors, and additional interference, and outputs traceable scores and reasons for point deductions. Attached Figure Description

[0017] Figure 1 This is a flowchart of an automatic scoring method for mPython programming exercises according to the present invention; Figure 2 This is an architecture diagram of an automatic scoring system for mPython programming exercises according to the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Example 1: As Figure 1 As shown in the figure, this embodiment provides an automatic scoring method for mPython programming operation questions, including the following steps: S1. Obtain the question template file, standard answer file, candidate answer file, and question configuration file. Parse the first three files and generate the corresponding block node tree and port connection edge set. S2. Establish the correspondence between template block nodes and candidate answer block nodes, compare the template port connection edge set with the candidate port connection edge set, extract the newly added, deleted and reconnected connection edges to form the candidate port connection throughput difference set, and perform closed decomposition based on the operation transaction template library to obtain the candidate operation transaction set; S3. Extract the standard operation transaction set from the template block node tree and the standard answer block node tree, filter transformable objects based on data dependencies, generate a hidden transformation parameter set, and construct a hidden isomorphic template and node, port and variable mapping table; S4. Based on the mapping table, convert the candidate operation transaction set and the standard operation transaction set into a mapping operation transaction sequence, and perform atomic replay on an independent copy of the hidden isomorphic template according to the transaction dependency to generate the candidate hiding program and the standard hiding program. S5. Establish the correspondence between candidate operation transactions and standard operation transactions, perform structural verification, code dependency verification, original parameter execution verification and hidden parameter execution verification on candidate hidden programs and standard hidden programs, and generate automatic scoring results based on the verification results and question configuration files.

[0020] S1 specifically includes the following sub-steps: S110. Obtain the question template file, standard answer file, candidate answer file, and question configuration file, and establish a scoring task. The question template file, standard answer file, and question configuration file are uploaded by the teacher. The standard answer file is created by the teacher after completing the block operation based on the question template file and saving it. The candidate answer file is received by the examination platform.

[0021] The question configuration file includes the question identifier, knowledge point type, scoring items, maximum score for each scoring item, field value range, execution restrictions, and verification weight. The examination platform associates the aforementioned files with a single scoring task and generates a task identifier based on the question identifier, examinee identifier, and submission batch.

[0022] The three .mxml files are sequentially checked for format, integrity, and version: the format check confirms that the file has the .mxml extension and can be read in UTF-8 encoding; the integrity check confirms that the file has a unique XML root element, the block, field, statement, value, next, and shadow tags meet the pairing requirements, and the block tag has a type attribute; the version check first reads the editor version field in the root element or metadata node, and if the version field is not read, it extracts the tag name set, attribute name set, and block type set and matches them with the system's pre-stored mPython version feature table.

[0023] The mPython version feature table records unique combinations of tags and attributes in XML files exported from different version editors. For example, the V1.0 feature table records the unique block type tag as... <shadow type="math_number">In the V2.0 features, the unique block type label is recorded as... <block type="mpython_display">.

[0024] The mPython version feature table is derived from sample files exported by each supported editor version. The system also pre-stores an editor version-MicroPython interpreter version mapping table, an mPython version code generation rule library, mPython block type definition files, and a virtual peripheral configuration table, derived from the corresponding version's runtime environment, underlying component interfaces, and hardware simulation parameters. If file versions are inconsistent but each has a corresponding parsing rule, they are parsed separately; if no corresponding parsing rule exists, the scoring task is stopped.

[0025] The checked files and question configuration files, along with task identifiers, question identifiers, examinee identifiers, file types, version identifiers, and storage addresses, are written to the shared task data pool. The shared task data pool stores input, output, and exception records for each stage, using a joint index formed by task identifiers and data types. The multi-agent system includes a file parsing agent, a port difference agent, a transaction decomposition agent, an isomorphic transformation agent, a transaction replay agent, and a scoring and verification agent. Each agent has independent inputs, processing rules, and outputs. When all three .mxml files pass the check, the task scheduler sends a parsing instruction.

[0026] S120: The file parsing agent parses three .mxml files, forming initial block node trees for the template, standard answer, and candidate answer. The root block node is the block tag directly subordinate to the XML root element; when multiple root block nodes exist, their order is determined by the x-coordinate, y-coordinate, and tag position. Each block tag is parsed into a regular block node, recording the original BlockID, block type, node role, set of field values, set of transformed attributes, parent block node, connection relationship, nested region, and sibling order index.

[0027] The `name` attribute of the `field` tag serves as the field name, and the tag text serves as the field value. Field values ​​are standardized according to the mPython block type definition file: numeric fields are converted to standard decimal strings, boolean fields are uniformly set to TRUE or FALSE, and variable fields record the display name and internal variable identifier. The `variables` tag parses into a variable declaration table, recording the variable's display name, internal variable identifier, and variable data type.

[0028] The `statement` tag is parsed as a nested region, with its `name` attribute serving as the identifier for the nested region. The first `block` tag inside is the entry block node, and the `block` tags within the `next` tag are the sequential successor block nodes. The `value` tag is parsed as a parameter input region, with the `block` tags within it parsed as explicit parameter blocks and the `shadow` tag parsed as default parameter blocks. When both types of tags are present, the explicit parameter block is used.

[0029] The mutation tag is written to the mutation attribute set, which is used by S130 to determine the dynamic port and by S430 to generate MicroPython code; block nodes with the disabled attribute set to true are recorded as disabled block nodes.

[0030] To avoid missing or duplicate original Block IDs, a standardized structural path is established for each block node: ; in, Represents the canonical structural path of block node n; Indicates the parent block node; This indicates one type of connection relationship: ROOT, NEXT, STATEMENT plus nested region identifier, or VALUE plus parameter input region name. This indicates the sibling index starting from 0 under the same connection relationship.

[0031] Internal node keys are composed of the canonical structure path, block type, and node role. The original Block ID is used for indexing when it is unique, and the internal node key is used when it is missing or duplicated. For example, if two display blocks with the same original Block ID are located in the root block's next chain and the nested region of the circular block DO0 respectively, they will form different internal node keys due to their different canonical structure paths.

[0032] S130: The file parsing agent performs porting processing on the three initial block node trees, generating three block node trees and corresponding port connection edge sets. Block nodes that can receive sequential connections are configured with a predecessor port, those with a next tag are configured with a successor port, each statement tag is configured with a nested entry port, and each value tag is configured with a parameter input port. Block nodes and shadow nodes that can generate numeric values, strings, boolean values, or object references are configured with parameter output ports.

[0033] The connection from the successor port to the predecessor port of the successor block node is called the successor connection edge; the connection from the nested entry port to the predecessor port of the nested region entry block node is called the nested connection edge; and the connection from the parameter output port to the parameter input port of the parent block node is called the parameter connection edge.

[0034] The set of port connection edges is represented as: ; Where E represents the set of port connection edges; , and These represent the set of successor edges, the set of nested edges, and the set of parameter edges, respectively.

[0035] Each connection edge records the connection edge type, source block and source port, target block and target port. A successor port, nested entry port, or parameter input port can only connect to one actual target object; duplicate use generates a port conflict exception record. For example, if the VALUE parameter input area contains both a default value shadow block and an explicit operation block, only the connection edge from the explicit operation block to the VALUE parameter input port is established.

[0036] After porting is completed, a block identifier index table, a block node index table, and a port connection edge index table are established. The three block node trees, the port connection edge set, the index table, the variable declaration table, and the port conflict exception record are written into the shared task data pool as inputs to S210 and S310.

[0037] S2 specifically includes the following sub-steps: S210. The port differential agent reads the template block node tree, the candidate answer block node tree, the template port connection edge set, the candidate port connection edge set, the corresponding index table, and the port conflict exception record from the shared task data pool, and establishes the template-candidate node correspondence. If the original Block ID exists in both files, is unique, and has the same block type, the node correspondence is established directly; if the original Block ID is missing, duplicated, or the same original Block ID corresponds to different block types, the process switches to structure correspondence processing.

[0038] Calculate the corresponding score for the template block node u and the candidate's answer block node v: ; in, Indicates the score corresponding to the structure; Indicates block type consistency; Indicates consistency of parent block type; This indicates consistency between the connection type and the nested region. Indicates the matching ratio between the predecessor block type and the successor block type; This represents the matching ratio of the set of parameter input port names, with each value ranging from 0 to 1. The weights are derived from historically manually confirmed correct and incorrect matching samples; if no historical samples are available, the aforementioned fixed values ​​are used.

[0039] Node pairs with a structure-correspondence score of not less than 0.75 are included in the candidate correspondence relationship; when a template block node has multiple candidate candidate answer block nodes, they are filtered in order of structure-correspondence score, length of common prefix of standard structure path, absolute value of difference of same-level sequential index and number of field value matches, and one candidate answer block node is limited to a maximum of one template block node.

[0040] Field values ​​are not required as necessary conditions to avoid candidates misidentifying the original block as a new block after modifying the field values. Each group of corresponding nodes is assigned a corresponding group identifier, and the two groups of port connection edges are converted into standardized connection records that include the connection edge type, source corresponding group identifier, source port, target corresponding group identifier, and target port.

[0041] First, extract identical persistent connection edges. Then, identify cases where the same source port points to the original target block in the template and to the new target block in the candidate's answer as reconnection relationships, and split them into one deleted connection edge and one newly added connection edge with the same reconnection identifier. The remaining connection edges that only exist in the template are marked as deleted connection edges, and the remaining connection edges that only exist in the candidate's answer are marked as newly added connection edges.

[0042] The candidate port connection throughput difference set is formed by deleting connection edges, adding connection edges, and conflict difference items, and the template-candidate node correspondence table is written into the shared task data pool.

[0043] S220. The transaction decomposition agent reads the candidate port connection throughput difference set and calls the operation transaction template library to generate a candidate candidate operation transaction set.

[0044] An operation transaction is a single, continuous block editing operation that can be completed by the mPython editor, which involves block nodes, deletion of connecting edges, and addition of connecting edges. The operation transaction template library is established by the system by summarizing the changes in the .mxml files generated after the mPython editor performs block insertion, block movement, block wrapping, block splitting, and block replacement. Each transaction template records the types of connecting edges that must appear, the types of ports that can be used, the number of connecting edges, and the port closure conditions.

[0045] Taking "Insert Transaction Template" as an example, the necessary conditions for its recording include: disconnecting one successor connection edge from the original source port to the original target port, adding one connection edge from the original source port to the predecessor port of the inserted block, and adding one connection edge from the successor port of the inserted block to the original target port, and all input ports of the inserted block are occupied by actual parameter blocks to satisfy the port closure condition.

[0046] The transaction decomposition agent selects the difference items that have not yet been assigned to the candidate operation transaction as seed difference items, extracts other difference items that share the same block node, share the same port, or are located in the predecessor block, successor block, parent block and 1-level nested sub-block, and matches them one by one with each transaction template.

[0047] For candidate operation transactions The net change in connection at port p is calculated using the following formula: ; in, Indicates candidate operation transactions Net change in connection at port p; This indicates the number of new connection edges involving port p; This indicates the number of deleted connection edges involving port p.

[0048] Port connection conservation means that external ports that continue to be used in the original program will restore a single valid connection after the transaction is completed, the internal ports of the newly added block will be closed, the original position of the moved block will form a repaired connection, and there will be no disconnected ports that cannot be explained by the transaction.

[0049] Insertion transactions require that the block does not exist in the template but exists in the candidate's answer; movement transactions require that the block has corresponding nodes in two files, and simultaneously forms original position repair and target position access; replacement transactions require that the original block in the template and the new block in the candidate occupy the same external port role; wrapping transactions require that the original block is linked into the nested entry port of the newly added control block; splitting transactions require that the original continuous block chain form two or more closed block chains.

[0050] When all the necessary conditions of the transaction template are met, a candidate operation transaction is generated, and the transaction type, involved block nodes, connecting edges, transaction start and end ports, original position port, target position port, and corresponding difference items are recorded. For example, if block A in the template connects to block B, and the candidate inserts block C between block A and block B, deleting A to B, adding A to C, and adding C to B together constitute one insertion transaction.

[0051] S230. The transaction decomposition agent performs minimal closure decomposition on the candidate operation transaction set. Let U be the number of differences covered by unselected operation transactions, O be the number of differences repeatedly covered by two or more selected operation transactions, D be the number of unclosed ports in selected operation transactions, and H be the number of selected operation transactions. Calculate the objective function value of the transaction combination according to the following formula: ; Where J represents the objective function value of the transaction combination; the coefficients 1000, 100, 10 and 1 are used to prioritize reducing uncovered difference items, duplicate covered difference items, unclosed ports and the number of operation transactions, respectively, and are not used as training parameters.

[0052] Candidate operation transactions are sorted by the number of covered differences from most to least, and then selected or skipped sequentially through backtracking. Expansion stops when the lower bound of the objective function of the current combination is greater than the minimum objective function value already obtained, and the transaction combination with the smallest J is finally selected. If J is the same, combinations with fewer unclosed ports, higher transaction template matching, and fewer involved block nodes are selected sequentially.

[0053] The transaction template matching degree is determined by the ratio of the number of actual necessary conditions met to the total number of necessary conditions in the transaction template. Differences that cannot be covered by any candidate operation transaction, duplicate port occupancy, orphaned new blocks, and illegal circular joins form abnormal operation records; for example, when a new block is not connected to the predecessor port, nested entry port, or parameter input port, it is marked as an orphaned new block and no valid operation transaction is generated.

[0054] Ultimately, a set of candidate operation transactions and abnormal operation records are formed. Each candidate operation transaction saves the transaction closure state, transaction template matching degree and corresponding set of differences, and writes them into the shared task data pool for S410 to perform mapping and S530 to perform error attribution.

[0055] S3 specifically includes the following sub-steps: S310, the port differential agent and the transaction decomposition agent read the template block node tree, standard answer block node tree, template port connection edge set, standard answer port connection edge set, corresponding index table, operation transaction template library and minimum closure decomposition parameters from the shared task data pool, and form a standard operation transaction set according to the same node correspondence, standardized connection record generation, port connection throughput difference extraction, candidate operation transaction generation and minimum closure decomposition rules from S210 to S230.

[0056] Based on the code generation mechanism of the open-source Blockly framework, it calls the block-to-code mapping rule library corresponding to the mPython editor version determined by S110 (the rule library defines the string mapping correspondence between block types and MicroPython syntax text), traverses the standard answer block node tree, translates each node, and concatenates them into the standard answer MicroPython code in topological order. Only standard operation transactions that are closed, have a transaction template matching degree of 1, involve no port conflicts, and can generate and pass syntax parsing of MicroPython programs after being replayed to the question template file are identified as valid standard operation transactions; if there are orphaned blocks, unclosed ports, or illegal circular connections, the question is marked as having a standard answer configuration error and the generation of hidden isomorphic templates is stopped.

[0057] For each valid standard operation transaction, based on the standard answer block node tree and the standard answer MicroPython code, the set of directly read objects, the set of directly write objects, the set of target outputs, and the control branch in which they are located are recorded. Directly read objects include variables, constants, and virtual sensor responses read by operand blocks, condition blocks, or output blocks; directly write objects include variables, fields, and virtual peripheral states directly changed by assignment blocks, set blocks, or peripheral control blocks; target outputs include the displayed results, the final values ​​of variables, the final states of virtual peripherals, and the execution status of the specified control branch.

[0058] Each target output is associated with the scoring items and full marks in the question configuration file, and the set of valid standard operation transactions and the aforementioned object set are written into the shared task data pool.

[0059] The S320 isomorphic transformation agent reads the set of valid standard operation transactions, template block node tree, standard answer block node tree, question configuration file, mPython block type definition file, and virtual peripheral configuration table to establish a data dependency graph. The data dependency graph uses variables, constants, sensor responses, computation results, conditional results, and peripheral outputs as dependent nodes; when the value of one dependent node is used to calculate, judge, or generate another dependent node, a directed dependency edge is established between the two dependent nodes.

[0060] For standard operation transactions Its set of transformable objects is determined by the following formula: ; in, Indicates standard operation transactions A collection of transformable objects; This indicates that there exists a directed path from object x to the target output y in the data dependency graph (where x represents the dependent node object in the data dependency graph). Represents the target output set; This indicates that the data is written directly to the collection of objects.

[0061] Therefore, only initial values ​​of variables, numerical constants, character parameters, virtual sensor responses, or initial states of virtual peripherals that originate from the question template file, can affect the target output, and are not content that candidates should directly set are selected. The allowed value range of transformable objects is primarily derived from the question configuration file; if the question configuration file is not set, it is derived from the mPython block type definition file and the virtual peripheral configuration table.

[0062] A random seed for the task is generated using the question identifier, the examinee identifier, and the scoring batch identifier. At least three candidate hidden values ​​are generated for each transformable object within the allowed value range, so that the same candidate hidden value is obtained when the same scoring task is executed repeatedly.

[0063] Candidate hidden values ​​must differ from the original values, not trigger division by zero, data out of bounds, type errors, or illegal peripheral states, and ensure that the standard answer functions correctly and at least one target output changes. Their validity is determined by the following formula: ; in, Indicates the validity of the candidate hidden value h; , and The values ​​of the candidate hidden values ​​are respectively: satisfying the value constraints, the standard answer running normally, and the target output changing. A value of 1 is used when all conditions are met, and 0 is used otherwise. Only when these conditions are met... When this happens, the candidate hidden values ​​are written into the hidden transformation parameter set.

[0064] For arithmetic operations, variable assignment, and data display questions, a path-preserving transformation is used, allowing the target output to change without altering the control branch leading to the standard answer. For conditional judgment questions, valid candidate hidden values ​​below and above the condition threshold are generated separately, forming a path-switching transformation. For example, if a question requires the test taker to increase template variable 'a' by 5, the initial value of variable 'a' (10) can be transformed into 37, but the value 5 is directly written to the object and cannot be transformed.

[0065] S330: The isomorphic transformation agent copies the template block node tree, writes the set of hidden transformation parameters into the corresponding fields or the initial state of the virtual peripheral, and generates candidate hidden isomorphic templates without adding or deleting block nodes, changing block types, parent-child relationships, nested regions, port types, or port connection relationships. The hidden isomorphic template maintains a one-to-one structural correspondence with the problem template file, and only the values ​​of the transformable objects change.

[0066] The candidate hidden isomorphic template is reserialized into an .mxml file and re-parsed and ported according to the same rules as S120 and S130 to obtain the hidden template block node tree, the set of hidden template port connection edges, and the hidden template variable declaration table. The candidate hidden isomorphic template is confirmed to satisfy the structural isomorphism condition only when the number of template block nodes, the corresponding block type, the nested region name, the number of ports, the port name, and the port connection relationship are all consistent.

[0067] The connection edges between template ports and hidden template ports should meet the following requirements: ; in, and These represent the set of template port connection edges and the set of hidden template port connection edges, respectively. This represents the node mapping from template block nodes to hidden template block nodes; and These represent the source block node and the target block node, respectively. and These represent the source port and the destination port, respectively; t represents the connection edge type.

[0068] Node mapping is prioritized based on the original Block ID, which is unique in both files and has the same block type. If mapping based on the original Block ID is not possible, it is established according to the standard structural path and block type. After completing the node mapping, template port mapping is established for ports of the same type and name in the corresponding block nodes, and template variable mapping is established based on the template variable declaration table and the hidden template variable declaration table. Each transformable object attempts a maximum of 10 sets of candidate hidden values, and any candidate hidden value that causes structural changes is discarded.

[0069] Finally, the hidden isomorphic template, template node mapping table, template port mapping table, template variable mapping table, hidden transformation parameter set, and target output set are written into the shared task data pool for S410 to perform transaction mapping.

[0070] S4 specifically includes the following sub-steps: S410, the transaction replay agent reads the candidate operation transaction set, abnormal operation record, hidden isomorphic template, template node mapping table, template port mapping table, template variable mapping table, hidden transformation parameter set, mPython block type definition file and virtual peripheral configuration table from the shared task data pool, and performs hidden isomorphic mapping on the candidate operation transactions.

[0071] Mapping is performed only on candidate operations that are closed, have a transaction template matching degree of 1, and do not involve conflicting ports; other candidate operations generate transaction mapping exception records. Hidden isomorphic mapping is the process of converting existing block nodes, existing ports, variable references, and peripheral references from the question template file in candidate operations into corresponding objects in the hidden isomorphic template, while preserving the block type, field configuration, and internal connection relationships between newly added blocks.

[0072] Existing template block nodes and ports are retrieved according to the template node mapping table and template port mapping table, respectively, to obtain their corresponding hidden objects. For newly added blocks by examinees, a transaction local node identifier is generated using the original examinee's operation transaction identifier, the new block's order index within the transaction, and the block type. Ports are then re-established based on the mPython block type definition file. Internal connection edges between newly added blocks remain unchanged, while connection edges between newly added blocks and existing template blocks are reconstructed using the mapped hidden ports.

[0073] When a new block references an existing variable in the template, it is replaced with a hidden internal variable identifier based on the template variable mapping table. When referencing a newly created variable within the same transaction, a transaction-local variable identifier is generated, and all read / write references within the transaction are replaced synchronously. When a field corresponds to a transformable object in the hidden transformation parameter set, hidden values ​​are used. Fields whose content is directly set by the candidate retain the candidate's submitted value. After each mapping, the connection edge checks the port direction, data type, and single-port capacity. Sequential ports must not connect to parameter blocks, and parameter input ports must not connect to two actual parameter blocks.

[0074] After mapping is completed, a candidate mapping operation transaction sequence is generated, and the mapped block nodes, connection edges, transaction start and end ports, variable reference mapping, and port compatibility results are recorded. For example, when a candidate adds a "variable a increases by 5" block, the internal identifier of variable a is replaced with the corresponding identifier in the hidden isomorphic template, while the value 5 remains unchanged.

[0075] S420: The transaction replay agent, following the same object mapping and port compatibility rules as S410, converts the valid standard operation transaction set into a standard mapping operation transaction sequence. The newly added block for the standard answer does not use the original Block ID, but instead generates a hidden block identifier using the task identifier, standard operation transaction identifier, and intra-transaction sequential index.

[0076] For each candidate mapping operation transaction and standard mapping operation transaction, the resource set to be created, the resource set to be read, and the resource set to be modified are extracted respectively. The resource set to be created includes the block nodes, variables, ports and connection positions added by the transaction. The resource set to be read includes the block nodes, variables and ports that must exist before the transaction is executed. The resource set to be modified includes the ports that the transaction needs to disconnect, take over or reconnect to.

[0077] If transaction Creating resource collections and transactions If the sets of resources to be read have an intersection, then a transaction is established. Pointing to transactions Transaction dependency edges: ; in, Representing a transaction Must precede transactions Playback; Representing a transaction Create a collection of resources; Representing a transaction The collection of resources to be read.

[0078] Based on the transaction dependency edges, construct both the candidate transaction dependency directed graph and the standard transaction dependency directed graph, and perform topological sorting. Transactions without dependencies are arranged according to the order of their starting ports in the template specification structure path; if the specification structure paths are the same, they are arranged in ascending order of transaction identifiers. When two transactions modify the same port and there are no create or read dependencies, a transaction resource conflict record is formed. When a cycle exists in the transaction dependency directed graph, a transaction dependency cycle exception record is formed, and transactions within the cycle are not included in the replay sequence.

[0079] For example, when inserting a loop block first, and then inserting a display block into the nested DO0 region of that loop block, the first transaction creates the nested DO0 entry port, and the second transaction reads from that port; therefore, the first transaction must be executed first. The final output includes the candidate transaction replay sequence, the standard transaction replay sequence, and records of sorting anomalies.

[0080] S430. The transaction replay agent copies two hidden isomorphic templates to form a candidate replay copy and a standard replay copy with the same set of hidden transformation parameters and the initial state of the virtual peripheral. Atomic replay is then performed according to the candidate transaction replay sequence and the standard transaction replay sequence, respectively.

[0081] Atomic replay refers to the process where all structural changes within a single transaction are committed only after all checks have passed; if any step fails, the transaction is restored to its pre-transaction state. Before each transaction executes, a snapshot of the local structure—including affected block nodes, ports, variable declarations, and connection edges—is saved, and then the existence of the read resources and target ports is checked.

[0082] Insert transactions sequentially disconnect the original connection, create a new block, and connect the transaction start port and transaction end port; move transactions first repair the original position, then disconnect the original connection at the target position and connect the move block; wrap transactions first disconnect the external connection of the original block chain, create a wrap block and connect it to the original position, and then connect the original block to the corresponding nested entry port; split transactions disconnect the original block chain according to the split edges and establish valid entry points for each split block chain; replacement transactions disconnect the external connection of the original block, mark the original block as invalid, and connect the replacement block according to the original port role.

[0083] Calculate the validity of replay after the transaction is completed: ; in, Representing a transaction The effectiveness of replay; This indicates that the preconditions for the transaction have been met; This indicates that the port is uniquely occupied and the types are compatible; This indicates that the block node tree does not contain duplicate parent nodes, detached required blocks, or XML structure self-referencing loops; This indicates the ability to generate and parse syntax-free MicroPython code; a value of 1 indicates that the code is capable of being generated and parsed, and a value of 0 indicates otherwise. Only when all conditions are met is the value 1. The transaction is committed on time; otherwise, it is rolled back based on the local structure snapshot and a replay exception record is generated.

[0084] After all transactions are completed, the candidate hiding program and the standard hiding program are output, and the hidden block node tree, the set of hidden port connection edges, the generated code, the transaction replay status, the transaction-hidden block node source mapping table, the transaction-generated code range source mapping table, and the replay exception record are saved respectively. These are written to the shared task data pool for use by S510 to S530.

[0085] S5 specifically includes the following sub-steps: S510, the scoring and verification agent reads the candidate's operation transaction set, abnormal operation record, valid standard operation transaction set, target output set, direct read object set, direct write object set, candidate hidden block node tree, standard hidden block node tree, corresponding port connection edge set, transaction replay status, transaction-hidden block node source mapping table, replay abnormal record and question configuration file, and establishes the candidate-standard transaction correspondence.

[0086] For candidates' operational affairs with standard operating transactions Calculate the score corresponding to the transaction: ; in, This indicates the score corresponding to the transaction; Indicates consistency of transaction types; This indicates that the transaction start port and the transaction end port are consistent; This indicates the matching ratio between directly reading the object collection and directly writing the object collection; This indicates the matching ratio of block-level data transfer relationships formed based on the aforementioned set of objects; This indicates that the target output type and output location are consistent, and each value ranges from 0 to 1.

[0087] The weights are derived from historical manually confirmed samples; if no historical samples are available, the aforementioned fixed values ​​are used. Transaction pairs with a corresponding score of at least 0.75 are entered into the candidate matching set. Under the constraint that there is a one-to-one correspondence between candidate operation transactions and standard operation transactions, the combination with the largest sum of transaction matching scores is selected. If the sums are the same, the combinations with more port consistency, more target output consistency, and fewer replay anomalies are selected in that order. Standard operation transactions that do not have a corresponding candidate operation transaction are recorded as missing transactions, and candidate operation transactions that do not have a corresponding standard operation transaction are recorded as additional transactions.

[0088] For each set of transaction relationships, the system checks the transaction type, start and end ports, block type, nested regions, parameter concatenation, port closure, duplicate parent nodes, port occupancy, detached required blocks, and transaction rollback status to form structural verification evidence. The structural verification result is the ratio of the number of passed items to the total number of structural checks. Unclosed ports, incorrect target nested regions, or failed transaction replays are considered gating conditions; if any gating condition is not met, the structural verification result is set to 0.

[0089] S520, the scoring and verification agent reads the candidate-standard transaction correspondence, structural verification evidence, candidate-generated code, standard generated code, and transaction-generated code range source mapping table, and performs normalization processing on the corresponding code segments: renames user variables to VAR1 and VAR2 in the order of their first appearance, renames temporary variables to TMP1 and TMP2 in the order of their first definition, deletes comments, blank lines, and extra spaces that do not affect execution, and standardizes the representation of newline characters, Boolean values, and numeric literals; the constants, operators, comparison operators, and peripheral port numbers set by the candidate remain unchanged.

[0090] The normalized code is converted into an operation dependency graph, where nodes represent program operations and edges represent data dependencies or control dependencies. The code validation result is the ratio of the number of matching necessary operation nodes, data dependency edges, and control dependency edges to the total number of standard necessary items.

[0091] The candidate's hidden parameter program and the standard hidden parameter program are copied to create four copies: a candidate's original parameter program copy, a standard original parameter program copy, a candidate's hidden parameter program copy, and a standard hidden parameter program copy. The two original parameter program copies are restored to their original values ​​from the question template file, while the two hidden parameter program copies retain their hidden values. All four program copies run in the same isolated execution environment. The interpreter version is determined based on the editor version-MicroPython interpreter version mapping table, and the task random seed, virtual clock, virtual sensor response, virtual peripheral status, and random function return sequence are standardized.

[0092] Virtual time is measured in milliseconds (ms), with an initial virtual clock value of 0ms. The maximum number of execution steps is primarily determined from the problem configuration file; if not configured, it is determined as 100 times the number of executable block nodes in the standard hidden program, with a minimum of 1000 steps and a maximum of 100,000 steps. During execution, events are collected at the start of transactions, writing of critical variables, conditional checks, loop termination, peripheral read / write operations, and target output to form a runtime status trajectory. Checkpoints are established according to transaction identifiers, event types, and target objects, and aligned in order of occurrence.

[0093] Integers, booleans, strings, and enumeration values ​​are compared precisely. Floating-point values ​​are considered to be identical if they satisfy the following formula: ; in, and These represent the candidate's running value and the standard running value, respectively. and These represent absolute tolerance and relative tolerance, respectively. The value configured in the question is preferred; if not configured, 10 is used for each. -9 and 10 -6 .

[0094] The execution verification results are the ratio of the number of matched target outputs, final values ​​of key write objects, conditional branch results, and loop termination states to the total number of standard checkpoints; if the execution limit is reached but the process has not ended, the execution will stop and an overrun record will be generated.

[0095] S530, the scoring verification agent assembles the transaction-corresponding evidence, structural verification evidence, code verification evidence, original parameter operation verification evidence, hidden parameter operation verification evidence, and replay anomaly evidence into a scoring evidence package according to the standard operation transaction identifier and scoring item identifier.

[0096] When standard operation transaction replay fails, standard program syntax parsing fails, or target output is not generated, the corresponding scoring item will be marked as an abnormal scoring benchmark and no points will be deducted from the candidate; when the candidate's operation transaction replay fails, the code verification result and the execution verification result of the scoring item will both be set to 0; when additional transactions cover the target output, change key variables, or cause peripheral resource conflicts, additional interference evidence will be formed.

[0097] The score for the i-th rating item is calculated using the following formula: ; in, This represents the score for the i-th rating item; This represents the full score for the i-th rating item; , and These represent the structure weight, code weight, and execution weight, respectively. The sum of the three weights is 1. They are primarily derived from the problem configuration file, and if not configured, they are set to 0.2, 0.3, and 0.5, respectively. , and These represent the structure verification result, code verification result, and runtime verification result, respectively, with values ​​ranging from 0 to 1.

[0098] When transaction replay fails and Set to 0; if the target output is incorrect. If the original parameters run correctly, the hidden parameters run incorrectly, and there is no complete dependency path from the transformable object to the target output, the answer is considered a fixed parameter answer. A candidate's operation transaction cannot repeatedly provide core evidence for two standard operation transactions.

[0099] The reasons for point deductions are determined by classifying the primary error type in the following order: abnormal scoring criteria, missing operation answers, structural errors, operational limits exceeding limits, fixed parameters, logical errors, incomplete logic answers, and additional interference. Other errors are recorded as secondary reasons for point deductions. The scores for each scoring item are summed to obtain the total score, and the following information is output: task identifier, question identifier, candidate identifier, transaction correspondence, verification result, error type, reason for point deduction, and scoring evidence package index.

[0100] Example 2: Figure 2 As shown, this embodiment provides an automatic scoring system for mPython programming exercises, including: The module includes a file parsing module, a transaction inversion module, an isomorphic transformation module, a transaction replay module, and a scoring and verification module. The file parsing module is used to obtain the question template file, standard answer file, candidate answer file and question configuration file, parse the block nodes and connection relationships in the first 3 files, and generate the corresponding block node tree and port connection edge set; The transaction inversion module is used to establish the correspondence between template block nodes and candidate answer block nodes, compare the template port connection edge set with the candidate port connection edge set, extract the added, deleted and reconnected connection edges to form the candidate port connection throughput difference set, and perform closed decomposition on the candidate port connection throughput difference set according to the operation transaction template library to obtain the candidate operation transaction set. The isomorphic transformation module is used to extract the standard operation transaction set from the template block node tree and the standard answer block node tree, filter transformable objects based on data dependencies, generate a hidden transformation parameter set, and construct a hidden isomorphic template, template node mapping table, template port mapping table, and template variable mapping table. The transaction replay module is used to convert the candidate operation transaction set and the standard operation transaction set into a mapping operation transaction sequence according to the mapping table, and perform atomic replay on an independent copy of the hidden isomorphic template according to the transaction dependency relationship to generate the candidate hiding program and the standard hiding program. The scoring and verification module is used to establish the correspondence between the candidate's operation transactions and the standard operation transactions. It performs structural verification, code dependency verification, original parameter execution verification, and hidden parameter execution verification on the candidate's hidden program and the standard hidden program, and generates automatic scoring results based on the verification results and the question configuration file.

[0101] All the above formulas are performed using dimensionless numerical calculations; the relevant formulas are based on empirical models that approximate the real situation, obtained through extensive data collection and software simulation fitting. The preset parameters and thresholds involved in the formulas can be conventionally set and adjusted by those skilled in the art according to the physical constraints of the actual application scenario.

[0102] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0103] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0104] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.< / block> < / shadow>

Claims

1. An automatic scoring method for mPython programming exercises, characterized in that, Includes the following steps: S1. Obtain the question template file, standard answer file, candidate answer file, and question configuration file. Parse the first three files and generate the corresponding block node tree and port connection edge set. S2. Establish the correspondence between template block nodes and candidate answer block nodes, compare the template port connection edge set with the candidate port connection edge set, extract the newly added, deleted and reconnected connection edges to form the candidate port connection throughput difference set, and perform closed decomposition based on the operation transaction template library to obtain the candidate operation transaction set; S3. Extract the standard operation transaction set from the template block node tree and the standard answer block node tree, filter transformable objects based on data dependencies, generate a hidden transformation parameter set, and construct a hidden isomorphic template and node, port and variable mapping table; S4. Based on the mapping table, convert the candidate operation transaction set and the standard operation transaction set into a mapping operation transaction sequence, and perform atomic replay on an independent copy of the hidden isomorphic template according to the transaction dependency to generate the candidate hiding program and the standard hiding program. S5. Establish the correspondence between candidate operation transactions and standard operation transactions, perform structural verification, code dependency verification, original parameter execution verification and hidden parameter execution verification on candidate hidden programs and standard hidden programs, and generate automatic scoring results based on the verification results and question configuration files.

2. The automatic scoring method for mPython programming exercises according to claim 1, characterized in that, S1 specifically includes: Obtain the question template file, standard answer file, candidate answer file, and question configuration file; complete the format, completeness, and version checks; establish the scoring task and write it to the shared task data pool. Parse the blocks, fields, nesting, order, parameters, and variable labels of each file to determine the block node relationships, field values, and variable declarations. Establish internal node keys according to the standard structure path to form the corresponding initial block node tree and variable declaration table.

3. The automatic scoring method for mPython programming exercises according to claim 2, characterized in that, Also includes: Configure predecessor ports, successor ports, nested entry ports, parameter input ports, and parameter output ports based on block type and label relationship; establish successor connection edges, nested connection edges, and parameter connection edges; and generate corresponding block node trees, port connection edge sets, index tables, and port conflict exception records.

4. The automatic scoring method for mPython programming exercises according to claim 1, characterized in that, S2 specifically includes: Based on the original Block ID, block type, parent block relationship and connection relationship, establish the template and candidate node relationship, convert the template port connection edge set and the candidate port connection edge set into a normalized connection record, extract the deleted, added and reconnected connection edges, and form a candidate port connection throughput difference set; Using unassigned difference items as seeds, aggregate shared block nodes, shared ports, and adjacent difference items, match them with the operation transaction template library, and generate candidate operation transactions of the type of insertion, move, wrap, split, or replacement. The objective function value is determined based on the coverage of difference terms, port closure, and number of operation transactions. Minimal closure decomposition is performed on the candidate operation transactions to obtain the set of candidate operation transactions and abnormal operation records.

5. The automatic scoring method for mPython programming exercises according to claim 1, characterized in that, S3 specifically includes: Based on the node correspondence, port difference extraction, transaction template matching, and minimum closure decomposition rules that are the same as the candidate's operation transactions, a set of valid standard operation transactions is generated from the template block node tree and the standard answer block node tree, and the direct read object, direct write object, and target output are determined. A data dependency graph is built based on objects, and transformable objects that can affect the target output but are not directly set by the examinee are filtered out. Within the allowed value range, a set of hidden transformation parameters is generated and verified by running and output changes. Write the set of hidden transformation parameters into the question template file, generate and verify the hidden isomorphic template, and establish the template node mapping table, template port mapping table and template variable mapping table.

6. The automatic scoring method for mPython programming exercises according to claim 1, characterized in that, S4 specifically includes: Based on the template node, port, and variable mapping table, the existing template objects in the candidate operation transaction are converted into the corresponding objects in the hidden isomorphic template, while retaining the type, fields, and internal connections of the newly added block, and generating the candidate mapping operation transaction sequence; Generate a standard mapping operation transaction sequence according to the same rules, extract the creation, reading and modification resources of each transaction, establish transaction dependencies and perform topological sorting to obtain the candidate transaction replay sequence and the standard transaction replay sequence.

7. The automatic scoring method for mPython programming exercises according to claim 6, characterized in that, Also includes: On a separate copy of the hidden isomorphic template, perform atomic replays of pre-checks, port checks, structure checks, and failure rollbacks according to the corresponding transaction replay sequence to generate the candidate hiding program, the standard hiding program, and replay exception records.

8. The automatic scoring method for mPython programming exercises according to claim 1, characterized in that, S5 specifically includes: Based on the transaction type, start and end ports, read and write objects, and target output, establish a one-to-one correspondence between the candidate's operation transaction and the standard operation transaction, check nested regions, parameter connections, port closures, and replay status, and form structural verification evidence. Standardize the transaction code and construct the operation dependency graph. Run the candidate hidden program and the standard hidden program under the original parameters and hidden parameters. Collect the target output, conditional branches and loop termination status to form code verification evidence and operation verification evidence.

9. The automatic scoring method for mPython programming exercises according to claim 8, characterized in that, Also includes: The scoring evidence package is composed of structural verification evidence, code verification evidence, runtime verification evidence, and replay anomaly evidence. The score is calculated based on the full score of the scoring item and the verification weight, the error type and the reason for the loss of points are determined, and an automatic scoring result is generated.

10. An automatic scoring system for mPython programming exercises, employing the automatic scoring method for mPython programming exercises as described in any one of claims 1 to 9, characterized in that, include: The module includes a file parsing module, a transaction inversion module, an isomorphic transformation module, a transaction replay module, and a scoring and verification module. The file parsing module is used to obtain the question template file, standard answer file, candidate answer file and question configuration file, parse the block nodes and connection relationships in the first 3 files, and generate the corresponding block node tree and port connection edge set; The transaction inversion module is used to establish the correspondence between template block nodes and candidate answer block nodes, compare the template port connection edge set with the candidate port connection edge set, extract the added, deleted and reconnected connection edges to form the candidate port connection throughput difference set, and perform closed decomposition on the candidate port connection throughput difference set according to the operation transaction template library to obtain the candidate operation transaction set. The isomorphic transformation module is used to extract the standard operation transaction set from the template block node tree and the standard answer block node tree, filter transformable objects based on data dependencies, generate a hidden transformation parameter set, and construct a hidden isomorphic template, template node mapping table, template port mapping table, and template variable mapping table. The transaction replay module is used to convert the candidate operation transaction set and the standard operation transaction set into a mapping operation transaction sequence according to the mapping table, and perform atomic replay on an independent copy of the hidden isomorphic template according to the transaction dependency relationship to generate the candidate hiding program and the standard hiding program. The scoring and verification module is used to establish the correspondence between the candidate's operation transactions and the standard operation transactions. It performs structural verification, code dependency verification, original parameter execution verification, and hidden parameter execution verification on the candidate's hidden program and the standard hidden program, and generates automatic scoring results based on the verification results and the question configuration file.