Automatic evaluation method and system based on Scratch programming environment
By extracting the features and quantity of blocks in the Scratch programming environment, and using a depth-first search algorithm and historical data to adjust the weights, the problem of low accuracy and efficiency of the evaluation system in the Scratch programming environment is solved, and multi-dimensional evaluation reports and adaptation to educational scenarios are realized.
Patent Information
- Application Number
- CN202511780567.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-27
AI Technical Summary
In existing Scratch programming environments, evaluation systems cannot accurately assess the complexity and actual performance of programs, resulting in inaccurate and inefficient evaluation results.
By extracting the features and quantity of building blocks, a depth-first search algorithm is used to recursively access the building blocks. The weight of building block types is dynamically adjusted in combination with historical work data. The basic score of reachable building blocks is calculated, and a multi-dimensional evaluation report is generated.
It enables efficient and accurate evaluation of Scratch programming projects, dynamically adapts to educational needs, avoids the problems of low efficiency and inconsistent standards in traditional assessments, and provides intuitive assessment results and optimization directions.
Smart Images

Figure CN121579376A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of education scoring, in particular to an automatic evaluation method and system based on a Scratch programming environment. BACKGROUND
[0002] Scratch is a core visual tool for programming initiation of teenagers. Through the operation mode of "code block" dragging and splicing, Scratch encapsulates programming language syntax, so that users can create programs such as animations and games without writing pure text codes. Scratch has been widely used in primary and secondary school programming education, after-school training and other scenes. With more than 100 million global users and more than 5 billion cumulative works, the demand for program quality evaluation is increasingly urgent. In the education scene, teachers need to correct a large number of student works, the competition scene needs to screen high-quality works, and users also need to evaluate and feedback to optimize programs.
[0003] In the current Scratch platform, the program works created by users usually need to be evaluated in terms of program quality through an evaluation mechanism or manually. The existing evaluation system is mainly based on static analysis, and can only identify simple invalid blocks, such as unreachable blocks and empty loops, which leads to misjudgment. Such evaluation mechanism cannot accurately evaluate the complexity and actual execution effect of the program, and cannot effectively dynamically optimize the score. SUMMARY
[0004] In order to realize effective dynamic scoring and make the evaluation more efficient and accurate, the application provides an automatic evaluation method and system based on a Scratch programming environment.
[0005] In a first aspect, the application provides an automatic evaluation method based on a Scratch programming environment, which adopts the following technical solution: An automatic evaluation method based on a Scratch programming environment, the method comprising: extracting features and quantities of blocks, the features including types and connection relationships, and the types corresponding to the quantities; recursively accessing the blocks from a starting block according to the connection relationships of the blocks to classify whether the blocks are reachable; obtaining current type dynamic weights and calculating a basic score of reachable blocks, wherein the type dynamic weights are adjusted according to historical work data, and the basic score is obtained according to the quantities, types and type dynamic weights of the reachable blocks; generating an evaluation report according to the basic score and a preset level classification.
[0006] In a possible implementation, the method further comprises: The basic score = (the sum of the number of each type of reachable block * the corresponding type dynamic weight) / the total number of reachable blocks.
[0007] In a possible implementation, after the basic score of the reachable block is calculated, the method comprises: calculating an additional loss score of the unreachable block, the additional loss score being obtained according to the number of the unreachable block, the score proportion, and the basic score; integrating the basic score and the additional loss score to obtain a comprehensive score; generating an evaluation report according to the basic score, the additional loss score, and the comprehensive score.
[0008] In a possible implementation, the unreachable block comprises a logical error unreachable block and a redundant unreachable block.
[0009] In a possible implementation, the current type dynamic weight is obtained by: obtaining a weight initial threshold value; collecting historical work data, and obtaining a weight adjustment value based on the historical work data and corresponding parameters, the historical work data comprising a historical work block type, a usage frequency proportion, a reachable proportion, and a work type proportion; obtaining the type dynamic weight corresponding to the current block type according to the weight initial threshold value and the weight adjustment value.
[0010] In a possible implementation, the type dynamic weight corresponding to the current block type is obtained according to the weight initial threshold value and the weight adjustment value by: the current type dynamic weight = the weight initial threshold value + the weight adjustment value * an adjustment coefficient; wherein the adjustment coefficient is pre-set.
[0011] In a possible implementation, the type dynamic weight corresponding to the current block type is obtained according to the weight initial threshold value and the weight adjustment value by: determining whether the calculation result according to the weight initial threshold value and the weight adjustment value is within a weight boundary range, if yes, the current type dynamic weight is the calculation result of the weight initial threshold value and the weight adjustment value; if no, the current type dynamic weight is a weight boundary range value adjacent to the calculation result of the weight initial threshold value and the weight adjustment value.
[0012] In a second aspect, the application provides an automatic evaluation system based on a Scratch programming environment, which adopts the following technical solution: An automatic evaluation system based on a Scratch programming environment, the device comprising: An extraction module is configured to extract features and quantities of the blocks, the features including types and connection relationships, and the quantities corresponding to the types; A classification module is configured to classify whether the blocks are reachable by recursively accessing the blocks from a starting block according to the connection relationships of the blocks; A calculation module is configured to obtain current type dynamic weights and calculate base scores of the reachable blocks, wherein the type dynamic weights are adjusted according to historical work data, and the base scores are obtained according to the quantities, types and type dynamic weights of the reachable blocks; An output module is configured to generate an evaluation report according to the base scores and preset level classifications.
[0013] In a third aspect, the present application provides an automatic evaluation device based on a Scratch programming environment, which adopts the following technical solution: An automatic evaluation device based on a Scratch programming environment includes a memory and a processor. The memory stores computer execution instructions. The processor executes the computer execution instructions stored in the memory, so that the processor executes the first aspect and / or various possible implementation manners of the first aspect.
[0014] In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical solution: A computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the first aspect and / or various possible implementation manners of the first aspect.
[0015] The automatic evaluation method and system based on the Scratch programming environment provided by the embodiments of the present application extract core features such as types and connection relationships of blocks, realize block reachability classification through recursive access, iteratively optimize block type dynamic weights based on historical work data, generate an evaluation report containing multi-dimensional score information through a comprehensive calculation mode of base scores and additional loss scores of unreachable blocks, and complete effective verification and value evaluation of Scratch works with manual intervention, thereby solving the problems of low efficiency and inconsistent standards of traditional manual evaluation, and iteratively adjusting dynamic weights based on data such as usage frequency proportion, reachability proportion and high-quality work adaptation degree of historical works, and avoiding extreme values through weight boundary constraints, so that the scores are not only consistent with the actual value of the blocks, but also adapt to the educational needs in different scenarios. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 FIG. 1 is a flowchart of an automatic evaluation method based on a Scratch programming environment according to the present application.
[0017] Figure 2 A flowchart of an automatic evaluation based on a Scratch programming environment provided by an embodiment of the present application.
[0018] Figure 3 A structural diagram of an automatic evaluation system based on a Scratch programming environment provided by an embodiment of the present application.
[0019] Figure 4 A structural diagram of an automatic evaluation device based on a Scratch programming environment provided by an embodiment of the present application. DETAILED DESCRIPTION
[0020] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and explained below in connection with the drawings and embodiments. However, it should be understood by those of ordinary skill in the art that the present application can be implemented without these details. In some cases, in order to avoid unnecessary description and make aspects of the present application obscure, well-known methods, processes, systems, components and / or circuits that have been described at a high level will not be described in detail. It is obvious to those of ordinary skill in the art that various changes can be made to the embodiments disclosed in the present application, and the general principles defined in the present application can be applied to other embodiments and application scenarios without deviating from the principles and scope of the present application. Therefore, the present application is not limited to the embodiments shown, but conforms to the broadest scope of the claimed range.
[0021] It should be noted that the description of these embodiments is used to help understand the present application, but does not constitute a limitation on the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0022] It should be understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the processor can be implemented within one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, micro-controllers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof.
[0023] When the embodiments are implemented in software, firmware, middleware or microcode, program code or code segments, they can be stored in a machine-readable medium, such as a storage component. A code segment can represent a procedure, a function, a subprogram, a program, a routine, a subroutine, a module, a software package, a class, or any combination of instructions, data structures, or program statements. A code segment can be coupled to another code segment or a hardware circuit by passing and / or receiving information, data, arguments, parameters, or memory contents. Information, arguments, parameters, data, etc. can be passed, forwarded, or transmitted using any suitable means including memory sharing, message passing, token passing, network transmission, etc.
[0024] For software implementations, the techniques described herein can be implemented with modules {e.g., procedures, functions, and so on) that perform the functions described herein. The software codes can be stored in memory units and executed by processors. The memory unit can be implemented within the processor or external to the processor, in which case it can be communicatively coupled to the processor via various means as is known in the art.
[0025] In the description of the present application, the meaning of a plurality of one or more, the meaning of a plurality of two or more, greater than, less than, more than, etc. are understood to not include the number itself, above, below, within, etc. are understood to include the number itself. If there is a description to first, second, only for the purpose of distinguishing the technical features as objects, and can not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or implicitly indicating the order of the indicated technical features.
[0026] In the description of the present application, the description of the reference terms "one embodiment", "some embodiments", "exemplary embodiment", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the description of the present application, the description of the above terms does not necessarily mean the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a combined manner.
[0027] The current Scratch platform only relies on simple static analysis, such as identifying basic invalid components such as unreachable blocks, empty loops, etc., and assigning a static score according to the type of each block. According to the number and type of reachable blocks and the calculation result of the static score, the final evaluation score is obtained.
[0028] This static scoring method is greatly affected by the static score of each type of block, and has strong subjectivity as the manual scoring method, resulting in inaccurate and inefficient evaluation results.
[0029] To solve the above technical problems, the application provides an automatic evaluation method and system based on a Scratch programming environment, which realizes effective dynamic scoring and makes the evaluation more efficient and accurate.
[0030] The technical solutions of the application and how the technical solutions solve the above technical problems will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes can not be described again in some examples. The embodiments of the application will be described below with reference to the drawings.
[0031] Figure 1 A flowchart of an automatic evaluation method based on a Scratch programming environment of the application; as Figure 1 shown, the embodiment of the application discloses an automatic evaluation method based on a Scratch programming environment, which comprises: S101, extracting the features and quantity of the blocks.
[0032] In the Scratch programming platform, a program is composed of different blocks, and each block represents a specific operation or control instruction. For example, some blocks are used to control the execution order of the program, some blocks are used to calculate data, and others are used to handle events (such as operations that occur when a button is clicked).
[0033] The scratch-vm module can parse the blocks in the sb3 file (the format of the Scratch project file) and realize the extraction of the block features. The features of the blocks include the type and the connection relationship. According to the function of the blocks, the blocks have the following three categories: 1. Core logic class: control flow (loop / branch), trigger condition (event), data logic (variable / operation); 2. Basic operation class: character movement, data storage, state detection, etc. (logical "execution carrier"); 3. Auxiliary presentation class: visual effects, sound feedback, scene decoration, etc. (non-core function supplement).
[0034] The connection relationship refers to the executable association mode between different function "code blocks" based on the preset shape matching rule and the program logic requirement, which describes the input / output connection of the blocks with other blocks. For example: If the "step" parameter of a "move 10 steps" block is connected to a "random number (1-10)" block, the label is
connection relationship = input, port = step, connection object = random number (1-10)
connection relationship = output, subsequent block = wait 1 second
[0035] Since the official Scratch platform does not have a native function to extract the number of blocks, the number of blocks can be counted with the help of third-party tools, code plugins or file parsing tools, such as TurboWarp editor, scratch-analysis tool, sb3extract tool + manual parsing.
[0036] Among them, each type of block corresponds to a number. For example, under the premise that the total number of blocks in the program is 100, the number of core logic blocks is 50, the number of basic operation blocks is 30, and the number of auxiliary presentation blocks is 20.
[0037] S102, according to the connection relationship of the blocks, recursively access the blocks from the starting block to classify whether the blocks are reachable.
[0038] Through the depth-first search (DFS) algorithm, each block in the program is traversed. Starting from the starting block, explore along one execution path to the end point, then backtrack to the previous node and explore other branches until all possible connection paths are traversed. Finally, accurately mark the reachable blocks that have effective connection relationship with the starting block, and the unreachable blocks that have no any path association.
[0039] Unreachable blocks include logic error unreachable blocks and redundant unreachable blocks.
[0040] The logic error unreachable block is a block that has physical connection but can never be triggered during execution due to program logic contradiction, condition always false or variable dependency conflict.
[0041] For example: 1. Condition always false scenario: "When green flag clicked" → "If 5 > 10" → "Move 10 steps" (condition "5 > 10" is always false, "Move 10 steps" is unreachable); 2. Variable logic conflict: "Set x = 3" → "Repeat until x < 0" → "Turn right 90 degrees" (x is initially 3 and has no decreasing logic, the loop condition is always not satisfied, and the internal block is unreachable); 3. Event trigger conflict: "When space key pressed" → "If key [up arrow] is pressed" → "Play sound" (the outer trigger is not associated with the inner condition, and the inner condition is not triggered by other logic, resulting in the unreachability of the subsequent block).
[0042] Therefore, the logic error unreachable block has a physical connection relationship, but due to the contradiction of the logic rules (condition judgment, variable change, event trigger), it breaks the logical link of connection → execution, which belongs to the logic level unreachable.
[0043] Redundant unreachable blocks are isolated blocks that have no physical connection with all the execution paths of scripts, or have local connection but are not connected to the core execution link.
[0044] Examples of: 1. Completely isolated scenario: a standalone "move to random position" block that is not connected to any hat block (no trigger entry); 2. Partially connected isolation: a "hide" block that exists alone next to a "when character is clicked" -> "show" block (not connected to any trigger block or serial link); 3. Abandoned branch scenario: a branch that is forgotten in multi-layer nesting, such as a "say hello" block existing only in the "else" branch of "if then else", but the outer condition is always true, so the "else" branch is never executed.
[0045] Therefore, redundant unreachable blocks lack effective physical connections (not connected to the hat block trigger link) or their connection relationships are not integrated into the core execution path, which are unreachable in terms of connection and have nothing to do with logic right or wrong, and are only redundant designs.
[0046] S103, obtain the current type dynamic weight, and calculate the basic score of the reachable block.
[0047] The type dynamic weight is adjusted according to historical work data. The historical work data includes the type, score, and usage frequency of the block, and the historical work data can be obtained from expert evaluation or from past automatic evaluation methods according to the type dynamic weight at that time.
[0048] Through multidimensional statistics and analysis of historical work data, combined with an iterative optimization mechanism, the current type dynamic weight of core logic class, basic operation class, and auxiliary presentation class blocks is dynamically adjusted, so that the current type dynamic weight can objectively reflect the actual usage value and core priority in programming education of the block, and provide accurate scoring basis for automatic evaluation of Scratch works.
[0049] The historical works can be within a specific time period, or all historical works with historical work data in the past, for example, the historical work data can be collected from the historical works in the past 7 days.
[0050] The basic score is obtained according to the number, type, and type dynamic weight of the reachable block.
[0051] By screening effective blocks, only counting the reachable blocks that can be executed during the program running, excluding unreachable blocks, ensuring that the score focuses on the contribution of real functions, and calculating according to the type and type dynamic weight grouping of the blocks, the statistics of each type of block is more accurate, the basic score intuitively reflects the quality and value density of the effective blocks in the work, and is dynamically adjusted according to the type dynamic weight, and the dynamic score of the work is realized.
[0052] S104, generating an evaluation report according to the basic score and the preset classification level.
[0053] According to the score, preset classification levels can be classified, which can be preset classification levels for each type of block, or preset classification levels for the basic score. Examples are: SSS class: 1.5 points and above; SS class: between 1.2 and 1.5 points; S class: between 1 and 1.2 points; A class: between 0.8 and 1 point; B class: between 0.6 and 0.8 points; C class: score below 0.6 points.
[0054] Through the basic score and the preset classification level, the user can intuitively obtain the programming evaluation result from the evaluation report, and the evaluation of the use of each type of block is more intuitive.
[0055] The application provides an automatic evaluation method based on the Scratch programming environment, which uses the type, connection relationship and number characteristics of the blocks, adopts a depth-first search algorithm to recursively traverse from the starting block, accurately distinguishes reachable blocks and unreachable blocks, dynamically optimizes the block type weight based on historical work data, calculates the basic score based on the number, type and dynamic weight of the reachable blocks, and generates a graded evaluation report, to support evaluation with multi-dimensional accurate data, avoid single-dimensional statistical bias, dynamically adapt the actual value of the block and the programming education demand, avoid the problem of fixed weight rigidity, and present intuitive results with a grading system, provide clear improvement direction for users, and efficiently solve the pain points of low efficiency and inconsistent standards in traditional evaluation, adapt to large-scale programming teaching or competition scenarios.
[0056] Figure 2 A flowchart of an automatic evaluation method based on the Scratch programming environment provided by an embodiment of the application is shown in Figure 2 As shown in the embodiment, the method comprises: S201, extracting the characteristics and number of blocks.
[0057] Step S201 can refer to the description of step S101.
[0058] S202, recursively access the building blocks from the starting building block according to the connection relationship of the building blocks to classify whether the building blocks are reachable.
[0059] Step S202 can refer to the description of step S102.
[0060] S203, obtain a weight initial threshold value.
[0061] The initial weight threshold value is preset, for example, the initial weight threshold value of each type is set to 1.0 points, that is, regardless of the type of building block, the initial weight threshold value when entering the system is uniformly 1.0 points.
[0062] Examples: The "if... then..." building block belongs to the core logic class building block, and the initial weight threshold value of the core logic class building block is 1.0 points; The "move 10 steps" building block belongs to the basic operation class building block, and the initial weight threshold value of the basic operation class building block is 1.0 points; The "say 'hello'" building block belongs to the auxiliary presentation class building block, and the initial weight threshold value of the auxiliary presentation class building block is 1.0 points.
[0063] Each building block starts with a preset initial weight threshold value to ensure that the starting score of each type of building block is consistent and to ensure the fairness of the initial evaluation.
[0064] S204, collect historical work data, and obtain a weight adjustment value based on the historical work data and corresponding parameters.
[0065] The historical work data includes historical work building block types, usage frequency proportion, reachability proportion, and work type proportion.
[0066] The historical work can be within a specific time period, or all historical works with historical work data in the past, for example, the historical work data can be collected from the historical works in the past 7 days.
[0067] The usage frequency proportion of the corresponding type building block refers to the proportion of the total usage frequency of a certain type of building block in all historical works to the total number of building blocks, Wherein, the usage frequency proportion = usage frequency / total number of building blocks × 100% For example, the core logic class "if... then..." is used 10,000 times, and the total number of building blocks is 20,000, then the usage frequency proportion is 50%, the higher the usage frequency, the stronger the popularity and practicality of the building block, and the higher the basic value.
[0068] The reachability proportion refers to the proportion of a certain type of building block that is a reachable building block in a usage scenario, Wherein, the reachable proportion = the reachable times / the total use times x 100% The higher the reachable rate is, the more reasonable the block is used, and the higher the actual function contribution is.
[0069] The work type proportion refers to the use proportion of a certain block in the high-quality works marked by teachers or determined by the system. Generally, works can be divided into high-quality works, general works, and works to be improved according to the quality of works, Wherein, the work type proportion = the use times of high-quality works / the total use times x 100 The higher the high-quality work adaptation rate is, the more popular the block is among high-level programmers, and the more prominent the value is in complex logic or high-quality works.
[0070] According to the emphasis of the scoring results, the use times proportion, the reachable proportion, and the work type can be set corresponding parameters, which are used to affect the contribution size of the corresponding historical work data to the type dynamic weight. For example, to highlight the use popularization degree, the parameter corresponding to the use times proportion can be adjusted to be high, to prefer to see whether a certain type of block is good or not, the parameter value corresponding to the reachable proportion can be adjusted to be high, and to see the recognition degree of high-quality works to a certain type of block, the parameter corresponding to the work type proportion can be adjusted to be high.
[0071] The sum of the parameters of the use times proportion, the reachable proportion, and the work type proportion is 1. In the example, the parameter corresponding to the use times proportion can be set to 0.4, the parameter corresponding to the reachable proportion can be set to 0.3, and the parameter corresponding to the work type can be set to 0.3.
[0072] When the use times proportion of the core logic class "if... then..." block is 40%, the reachable proportion is 95%, and the work type proportion is 85%, then: The weight adjustment value = 40% x 0.4 + 95% x 0.3 + 85% x 0.3 = 0.7 points.
[0073] S205, according to the weight initial threshold value and the weight adjustment value, to obtain the type dynamic weight corresponding to the block type at present.
[0074] The current type dynamic weight = the weight initial threshold value + the weight adjustment value x the adjustment coefficient Wherein, the adjustment coefficient is pre-set.
[0075] Further, it is judged whether the calculation result according to the weight initial threshold value and the weight adjustment value belongs to the weight boundary range, If yes, the current type dynamic weight is the calculation result of the weight initial threshold value and the weight adjustment value; If not, the current type dynamic weight is the weight boundary range value adjacent to the calculation result of the weight initial threshold value and the weight adjustment value.
[0076] For example, the highest weight in the weight boundary range value is 1.8 points, and the lowest weight is 0.5 points.
[0077] By setting the weight boundary range, the fluctuation range of the dynamic weight of the constraint type is avoided, the extreme value is avoided to cause the distortion of the score, the stability and rationality of the evaluation standard are ensured, the evaluation standard of different batches of works is relatively unified, and the inconsistency problem caused by the weight fluctuation is reduced.
[0078] Since the weight boundary range is set to 0.5-1.8 points, and the weight adjustment value calculation result range of the historical data is 0-1 point. In order to make the result of the weight initial threshold value+weight adjustment value×adjustment coefficient fall within the weight boundary range with a high probability, and not too high or too low, such as 0.7-1.6 points, to avoid frequent out-of-range: If the weight adjustment value=1.0 (the block performs perfectly): 1.0+1.0×adjustment coefficient≤1.8, it can be known that the adjustment coefficient≤0.8; If the weight adjustment value=0.0 (the block performs poorly): 1.0+0.0×adjustment coefficient≥0.7, it can be known that the adjustment coefficient≥0.5; Therefore, for example, the adjustment coefficient can be 0.8, which can make the excellent block reach a high level (1.0+1.0×0.8=1.8 points) and the poor block not too low (1.0+0.0×0.8=1.0 points), and adapt to the weight boundary range.
[0079] Suppose the adjustment coefficient is 0.8, the weight initial threshold value is 1.0 point, and the weight adjustment value of the core logic class block is 0.7 points, then the current type dynamic weight is 1.0+0.7×0.8=1.56 points, which belongs to the SSS class block.
[0080] S206, calculate the basic score of the reachable block.
[0081] The basic score=(the number of each reachable block×the corresponding type dynamic weight) sum / the total number of reachable blocks For example, The core logic class block "if... then..." has 10, and the type dynamic weight of the core logic class block is 1.6 points; The basic operation class block "move 10 steps" has 20, and the type dynamic weight of the basic operation class block is 1.3 points; The auxiliary presentation class block "say 'hello'" has 15, and the type dynamic weight of the auxiliary presentation class block is 1.0 point; The base score of the reachable building block = (10*1.6+20*1.3+15*1.0) / (10+20+15) = 57 / 45≈1.27.
[0082] S207, calculating additional lost points of the unreachable building block.
[0083] The additional lost points are obtained according to the number of the unreachable building block, the score ratio and the base score.
[0084] The unreachable building block includes a logic error unreachable building block and a redundant unreachable building block, and the score ratio corresponding to the logic error unreachable building block and the redundant unreachable building block can be adjusted adaptively when the additional lost points are calculated.
[0085] Examples: The logic error unreachable building block: 3, the score ratio is 5%, the lost points = 1.27*5%*3≈0.19; The redundant unreachable building block: 5, the score ratio is 3%, the lost points = 1.27*3%*5≈0.19; The additional lost points = 0.19+0.19≈0.38.
[0086] S208, synthesizing the base score and the additional lost points to obtain a comprehensive score.
[0087] Referring to the above example, the comprehensive score = the base score-the additional lost points = 1.27-0.38 = 0.89.
[0088] S209, generating an evaluation report according to the base score, the additional lost points, the comprehensive score and a preset grade classification.
[0089] The evaluation report generation takes the multi-dimensional score as the core, and realizes comprehensive and intuitive result presentation in combination with the preset grade classification.
[0090] The base score is calculated based on the number, type and dynamic weight of the reachable building block, and the value density of the effective programming logic can be obtained.
[0091] The additional lost points are for the two types of unreachable building blocks, i.e. the logic error and the redundancy, which highlight the requirements for the integrity and simplicity of the programming logic.
[0092] The comprehensive score is obtained by deducting the additional lost points from the base score, which objectively reflects the real quality of the work.
[0093] Meanwhile, according to the preset grade, each building block and the comprehensive score are mapped to the grade, so that the user can quickly know the evaluation result, and the optimization direction such as redundant code cleaning and core logic strengthening is clearly indicated, which takes into account the intuitiveness and the guidance.
[0094] The application provides an automatic evaluation method based on a Scratch programming environment, which guarantees the fairness of initial evaluation of various blocks through a unified weight threshold value, extracts block types, connection relationships and quantity characteristics, accurately classifies reachable blocks and two types of unreachable blocks (logical errors and redundancies) through a recursive traversal algorithm, calculates a weight adjustment value based on the proportion of the number of uses of historical works, the proportion of reachability, the proportion of high-quality works and configurable parameters, generates type dynamic weights in combination with a preset adjustment coefficient and a weight boundary, recalculates a basic score, deducts additional loss points according to the types and quantities of unreachable blocks, and finally obtains a comprehensive score by deducting the additional loss points from the basic score and generates a graded evaluation report. The application considers the fairness and adaptability of evaluation through the unified initial threshold value and the dynamic weight mechanism, avoids distortion of extreme values, improves the comprehensiveness and accuracy of evaluation through accurate classification and multi-dimensional scoring, supports flexible adjustment of parameters to adapt to different scenes, solves the pain points of low efficiency and inconsistent standards of traditional manual evaluation through an automatic process, and intuitively presents the results and indicates the optimization direction through the graded report.
[0095] Figure 3 A structural diagram of an automatic evaluation system based on a Scratch programming environment provided by an embodiment of the application is shown in FIG. 1. Figure 3 As shown in FIG. 1, the automatic evaluation system 30 based on the Scratch programming environment provided by the embodiment includes: An extraction module 301 extracts features and quantities of block pieces, wherein the features include types and connection relationships, and the types and quantities correspond to each other. A classification module 302 classifies whether a block piece is reachable by recursively accessing the block piece from a starting block piece according to a connection relationship of the block piece. A calculation module 303 obtains a current type dynamic weight and calculates a basic score of a reachable block piece, wherein the type dynamic weight is adjusted according to historical work data, and the basic score is obtained according to the number, types and type dynamic weight of the reachable block piece. An output module 304 generates an evaluation report according to the basic score and a preset grade classification.
[0096] The automatic evaluation system based on the Scratch programming environment provided by the embodiment can execute the method provided by the method embodiment, and has similar implementation principles and technical effects, which will not be described here.
[0097] Figure 4 A structural diagram of an automatic evaluation device based on a Scratch programming environment provided by an embodiment of the application is shown in FIG. 2. Figure 4 As shown in FIG. 2, the automatic evaluation device 40 based on the Scratch programming environment provided by the embodiment includes: At least one processor 401 and a memory 402. Optionally, the device 40 also includes a communication component 403. Wherein, the processor 401, the memory 402 and the communication component 403 are connected through a bus 404.
[0098] In the implementation process, the at least one processor 401 executes the computer execution instructions stored in the memory 402, so that the at least one processor 401 executes the above-mentioned method.
[0099] The specific implementation process of the processor 401 can refer to the above-mentioned method embodiments, which have similar implementation principles and technical effects, and will not be repeated here.
[0100] In the above-mentioned embodiments, it should be understood that the processor can be a central processing unit (English: Central Processing Unit, for short: CPU), and can also be other general-purpose processors, digital signal processors (English: Digital Signal Processor, for short: DSP), application specific integrated circuits (English: Application Specific Integrated Circuit, for short: ASIC) and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor and the like. The steps of the method disclosed in combination with the application can be directly embodied as hardware processor execution completion, or executed by hardware and software modules in the processor.
[0101] The memory can contain a high-speed memory (Random Access Memory, RAM), and can also include a non-volatile memory (Non-volatile Memory, NVM), for example, at least one disk memory.
[0102] The bus can be an industry standard architecture (Industry Standard Architecture, ISA) bus, a peripheral component interconnect (Peripheral Component, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For the convenience of representation, the bus in the drawings of the present application does not limit only one bus or one type of bus.
[0103] The present application also provides a computer program product, comprising a computer program, which is executed by a processor to realize the above-mentioned method.
[0104] The application further provides a computer readable storage medium, and the computer readable storage medium stores computer execution instructions.
[0105] The readable storage medium can be implemented by any type of volatile or nonvolatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0106] An exemplary readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.
[0107] The division of units is only a logical function division, and in actual implementation, there can be another division mode, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0108] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment.
[0109] In addition, the functional units in each embodiment of the application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0110] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the method of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0111] It can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The aforementioned program can be stored in a computer readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, and various media that can store program codes.
[0112] Finally, it should be noted that: those skilled in the art will easily think of other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application that follow the general principles of the present application and include common knowledge or conventional technical means in the art that are not disclosed in the present application, and is not limited to the precise structure described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is only limited by the appended claims.
Claims
1. An automatic evaluation method based on the Scratch programming environment, characterized in that, The method includes: Extract the features and quantity of the building blocks, where the features include type and connection relationship, and the type corresponds to the quantity; Based on the connection relationship of the building blocks, the building blocks are recursively accessed from the starting building block to classify whether the building blocks are reachable; Obtain the current type dynamic weight and calculate the base score of reachable blocks, wherein the type dynamic weight is adjusted based on historical work data, and the base score is obtained based on the number, type, and type dynamic weight of reachable blocks; An evaluation report is generated based on the basic score and preset level classification.
2. The method according to claim 1, characterized in that, The calculation of the base score of the reachable block includes: Base score = (the sum of (the number of each type of reachable block × the corresponding type dynamic weight) / the total number of reachable blocks.
3. The method according to claim 2, characterized in that, The calculation of the base score for reachable blocks includes: Calculate the additional penalty points for unreachable blocks, which are based on the number and percentage of unreachable blocks and the base score; The overall score is obtained by combining the basic score and any additional points deducted. An evaluation report is generated based on the base score, additional deductions, comprehensive score, and preset level classification.
4. The method according to claim 3, characterized in that, The unreachable blocks include logic error unreachable blocks and redundant unreachable blocks.
5. The method according to claim 1, characterized in that, The process of obtaining the dynamic weight of the current type includes: Obtain the initial threshold for the weights; Collect historical work data and obtain weight adjustment values based on the historical work data and corresponding parameters. The historical work data includes the type of building blocks, usage frequency percentage, reachability percentage, and work type percentage of historical works. Based on the initial weight threshold and the weight adjustment value, the dynamic weight of the current type corresponding to the block type is obtained.
6. The method according to claim 5, characterized in that, The step of obtaining the dynamic type weight corresponding to the current block type based on the initial weight threshold and the weight adjustment value includes: Current type dynamic weight = initial weight threshold + weight adjustment value × adjustment coefficient; The adjustment coefficient is preset.
7. The method according to claim 6, characterized in that, The step of obtaining the dynamic type weight corresponding to the current block type based on the initial weight threshold and the weight adjustment value includes: Determine whether the calculation results based on the initial weight threshold and the weight adjustment value fall within the weight boundary range. If so, the current type dynamic weight is the result of calculating the initial weight threshold and the weight adjustment value; If not, the current type dynamic weight is the weight boundary range value closest to the calculation result of the initial weight threshold and the weight adjustment value.
8. An automatic evaluation system based on the Scratch programming environment, characterized in that, The device includes: An extraction module is used to extract the features and quantity of building blocks, wherein the features include type and connection relationship, and the type corresponds to the quantity; The classification module is used to recursively access the blocks from the starting block based on the connection relationship of the blocks, so as to classify whether the blocks are reachable; The calculation module is used to obtain the dynamic weight of the current type and calculate the basic score of the reachable blocks. The dynamic weight of the type is adjusted according to historical work data, and the basic score is obtained based on the number, type, and dynamic weight of the reachable blocks. The output module is used to generate an evaluation report based on the basic score and preset level classification.
9. An automatic evaluation device based on the Scratch programming environment, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.