Building block processing method and device

By adding a new attribute configuration function for custom building blocks in Scratch, teachers are allowed to select target building block attributes, so that custom building blocks are displayed according to target attributes, solving the problems of high development costs and complex teaching in the existing technology, and realizing the Reduce costs and improve user experience.

CN119396380APending Publication Date: 2025-02-07BEIJING SIMING QICHUANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411413054.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the prior art, the development cost of custom building blocks is high, and new building blocks need to be gradually added during the teaching process, which affects the teaching production cycle, and it is difficult for students to intuitively understand the functions of certain building blocks.

Method used

By adding attribute configuration for building blocks in the process of configuring custom building blocks, teachers are allowed to select the target building block attributes of custom building blocks among the original multiple building block properties of Scratch, so that custom building blocks can be based on the target The properties are displayed in the corresponding list.

Benefits of technology

It reduces the cost of developing new building blocks, improves user experience, reduces the teaching production cycle, and through target attribute classification, students can understand the functions of building blocks more intuitively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396380A_ABST
    Figure CN119396380A_ABST
Patent Text Reader

Abstract

The invention provides a building block processing method and device.The method comprises the steps that in response to an attribute selection instruction for a custom building block configuration page, target building block attributes to which custom building blocks belong are selected; receiving a configuration completion instruction for the user-defined building blocks, and storing the configured user-defined building blocks; and in response to a selection instruction for a target building block attribute list in a building block selection area of the teaching application terminal, displaying the user-defined building blocks in the target building block attribute list.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of programming teaching technology, and in particular to a method and device for processing building blocks. Background Art

[0002] In the prior art, Scratch programming software (a global graphical programming tool for children) can define a building block with a specific function through a custom building block. The color of the custom building blocks is pink, and the custom building blocks are only placed in the list where the custom building blocks are located.

[0003] In the actual teaching process, for example, when a teacher teaches a sports building block, he teaches how to use the moving X-step sports building block. However, the moving X-step building block causes the character to move instantly when it is running, which is not intuitive for students to understand. In addition, a sliding X-step building block is defined through a custom building block to facilitate students' understanding. The teacher needs to drag the sliding X-step out of the list where the custom building block is located. Since the custom building block has not yet been taught and the sliding X-step has a pink appearance, students may be confused about the newly added pink building block, which affects the teaching arrangement.

[0004] However, if a new sliding X-step building block is added to the sports building blocks, the development cost will be high, and the number of building blocks that need to be developed may gradually increase in the subsequent teaching process, which will also affect the teaching production cycle. Summary of the invention

[0005] In view of this, the purpose of the present application is to at least provide a method and device for processing building blocks, by adding property configuration of custom building blocks in the process of configuring custom building blocks, so as to facilitate teachers to configure custom building blocks, and by selecting the target building block property of the custom building block from the original multiple building block properties of Scratch, so that in the application process after the configuration is completed, the custom building block will be displayed in the target building block property list according to its corresponding target building block property, so as to realize the classification of the custom building block according to its target building block property, thereby solving the technical problem in the prior art that new building blocks need to be developed according to building block properties, and achieving the technical effect of reducing costs and improving user experience.

[0006] This application mainly includes the following aspects:

[0007] In a first aspect, an embodiment of the present application provides a method for processing building blocks, which is applied to a teaching application terminal, wherein the teaching application terminal provides a custom building block configuration page, and the method includes: responding to an attribute selection instruction for the custom building block configuration page to select a target building block attribute to which the custom building block belongs; receiving a configuration completion instruction for the custom building block, and saving the configured custom building block; and responding to a selection instruction for a target building block attribute list in a building block selection area of ​​the teaching application terminal, displaying the custom building block in the target building block attribute list.

[0008] Optionally, the custom building block configuration page includes a parameter display type, and before receiving a configuration completion instruction for the custom building block and saving the configuration file of the custom building block, the method further includes: responding to a selection instruction for the parameter display type of the custom building block to select a target parameter display type corresponding to the custom building block; and responding to a parameter configuration instruction for a default parameter configuration box corresponding to the target parameter display type to configure the default parameters corresponding to the target parameter display type of the custom building block.

[0009] Optionally, the target parameter display type includes an input box, which includes a number or text input box and a Boolean value input box, wherein the default parameters corresponding to the target parameter display type of the custom building block are configured in the following manner: in response to a parameter input instruction of a parameter configuration box corresponding to the number or text input box, so as to use the input parameters as the default parameters corresponding to the number or text input box; or, in response to a default parameter selection instruction of a default parameter configuration box corresponding to the Boolean value input box, so as to configure the default parameters corresponding to the Boolean value input box.

[0010] Optionally, the target parameter display type includes a drop-down box, and the default parameters corresponding to the target parameter display type of the custom building block are configured in the following manner: responding to parameter configuration instructions of parameter configuration boxes corresponding to multiple drop-down options in the drop-down box to configure the parameters corresponding to the multiple drop-down options in the drop-down box; selecting a preset drop-down option from the multiple drop-down options to use the parameters corresponding to the preset drop-down option as the default parameters corresponding to the drop-down box.

[0011] Optionally, the method further includes: displaying the target parameter display type and default parameters corresponding to the custom building block in the target building block attribute list.

[0012] Optionally, the method further includes: in response to a drag instruction for the custom building block in the target building block attribute list, displaying the custom building block in a programming area; in response to a parameter modification instruction for the target parameter display type, displaying the target parameter display type and the modified parameters corresponding to the custom building block in the programming area.

[0013] Optionally, the display parameters of the custom building block in the target building block attribute list are the same as the display parameters of the target building block, and the target building block refers to a building block whose building block attributes are the target building block attributes, wherein the display parameters include color.

[0014] In a second aspect, an embodiment of the present application further provides a building block processing device, which is applied to a teaching application terminal, wherein the teaching application terminal provides a custom building block configuration page, and the device includes: a selection module, which is used to respond to an attribute selection instruction for the custom building block configuration page to select a target building block attribute to which the custom building block belongs; a receiving module, which is used to receive a configuration completion instruction for the custom building block and save the configured custom building block; and a display module, which is used to respond to a selection instruction for a target building block attribute list in a building block selection area of ​​the teaching application terminal, and display the custom building block in the target building block attribute list.

[0015] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the building block processing method described in the first aspect or any possible implementation manner of the first aspect.

[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the building block processing method described in the first aspect or any possible implementation manner of the first aspect are executed.

[0017] The embodiment of the present application provides a method and device for processing building blocks, the method comprising: responding to an attribute selection instruction for the custom building block configuration page to select a target building block attribute to which the custom building block belongs; receiving a configuration completion instruction for the custom building block, and saving the configured custom building block; responding to a selection instruction for a target building block attribute list in a building block selection area of ​​the teaching application terminal, and displaying the custom building block in the target building block attribute list. By adding a new attribute configuration for the custom building block in the process of configuring the custom building block, it is convenient for teachers to configure the custom building block and select the target building block attribute of the custom building block from the original multiple building block attributes of Scratch. In this way, in the application process after the configuration is completed, the custom building block will be displayed in the target building block attribute list according to its corresponding target building block attribute, so as to realize the classification of the custom building block according to its target building block attribute, which solves the technical problem of the prior art that new building blocks need to be developed according to building block attributes, and achieves the technical effect of reducing costs and improving user experience.

[0018] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A flow chart of a method for processing building blocks provided in an embodiment of the present application is shown.

[0021] Figure 2 A schematic diagram of the software interface of the Scratch software provided in an embodiment of the present application is shown.

[0022] Figure 3 A functional module diagram of a building block processing device provided in an embodiment of the present application is shown.

[0023] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0024] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.

[0025] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0026] In the prior art, teachers configure custom building blocks to implement functions that cannot be implemented in existing building blocks. For example, by configuring custom building blocks as building blocks for sliding X steps, it is easier for students to understand the moving X steps in the sports type. Furthermore, building blocks for sliding X steps are made through custom building blocks to disguise as building blocks of sports types. However, the building block for sliding X steps will not be placed in the building block selection area under the sports category, but will still be placed in the building block selection area under the custom building block category. The meaning of the custom building block needs to be explained to students, which has disadvantages for teaching scenarios and affects the course arrangement. If the building block for sliding X steps is developed into the sports category, the development cost will be high, and each new building block under a specific category needs to be developed, which affects the progress of course development and requires higher costs.

[0027] In addition, the current custom building blocks cannot construct the parameter style of the drop-down box. Teachers cannot build custom building blocks with drop-down functions according to actual conditions. Furthermore, students cannot select drop-down options, which affects the richness of teaching. In addition, only pre-created custom building blocks will be displayed in the building block selection area, and the pre-creation process does not configure the parameters of the custom building blocks. Generally, the parameter values ​​will be entered after the custom building blocks are moved to the programming area. Therefore, each time you drag a custom building block, you need to edit the parameter values, which affects the operation efficiency.

[0028] Based on this, the embodiment of the present application provides a method and device for processing building blocks, by adding a new attribute configuration of a custom building block in the process of configuring the custom building block, so that the teacher can select the target building block attribute of the custom building block from the original multiple building block attributes of Scratch, so that in the application process after the configuration is completed, the custom building block will be displayed in the target building block attribute list according to its corresponding target building block attribute, rather than in the attribute list of the custom building block, so as to realize the classification of the custom building block according to its target building block attribute, solve the technical problem of the prior art that new building blocks need to be developed according to the building block attributes, and achieve the technical effect of reducing costs and improving user experience, which is as follows:

[0029] A method for processing building blocks provided in an embodiment of the present application is applied to a teaching application terminal, which refers to a terminal device pre-installed with Scratch software. For example, the terminal device can be a terminal device with display function such as a smart phone, a desktop computer, a tablet computer, a smart watch, smart glasses, a smart TV, a laptop computer, AR (augmented reality), VR (virtual reality) equipment, etc. In addition, the teaching application terminal of the present application is not limited to the user object. Both teachers and students can create custom building blocks and apply them through the teaching application terminal.

[0030] See also Figure 1 , Figure 1 A flowchart of a method for processing a building block provided in an embodiment of the present application. Figure 1 As shown, the method for processing building blocks provided in the embodiment of the present application specifically includes the following steps:

[0031] S101: Responding to an attribute selection instruction on the custom building block configuration page to select a target building block attribute to which the custom building block belongs.

[0032] The teaching application terminal provides a custom building block configuration page, and the custom building block configuration page refers to a page in the Scratch software for configuring custom building blocks.

[0033] Among them, the building block properties of the Scratch software include motion, appearance, sound, event, control and customization, etc. Furthermore, when creating a new custom building block, it is necessary to select the property corresponding to the newly created custom building block from other properties except the custom property to determine the target building block property to which the custom building block belongs.

[0034] For example, see Figure 2 , Figure 2 This is a schematic diagram of the software interface of the Scratch software provided in the embodiment of the present application. Figure 2 As shown, after the user logs in to the Scratch software, the software interface of the Scratch software is displayed on the teaching application terminal. The code page of the software interface includes a building block selection area A1, a programming area A2 and a stage A3. Among them, the building block selection area is used to display pre-configured building blocks and arrange them according to the building block attributes. The programming area is used to modify the selected building blocks after selecting the building blocks in the building block selection area. The stage is used to control the character to run according to the building blocks in the programming area.

[0035] Among them, the building block selection area includes a building block attribute menu A11, and the building block attribute menu includes the identification of each building block attribute. When the identification corresponding to a building block attribute is clicked, the building block selection area displays the attribute list A12 corresponding to the building block attribute. The attribute list includes pre-configured building blocks of the building block attribute and a new building block control.

[0036] Furthermore, in response to a selection instruction for a new building block control corresponding to the custom building block attribute, a custom building block configuration page is displayed on the teaching application terminal, and other building block attributes except the custom attributes are displayed on the custom building block configuration page. In response to a selection instruction for a target building block attribute among other building block attributes, the building block attributes of the newly created custom building block are selected.

[0037] That is to say, if the newly created custom building block is used to implement sliding X steps, since sliding X steps should belong to the motion attribute, then, select the motion attribute from the properties such as motion, appearance, sound, event, control, etc. displayed on the custom building block configuration page, and use the motion attribute as the target building block attribute corresponding to the custom building block of sliding X steps.

[0038] Exemplarily, on the custom building block configuration page, the properties such as motion, appearance, sound, event, control, etc. are displayed in the form of a drop-down box, and the property selection instruction can be to select an attribute in the drop-down box as the target building block attribute; or, on the custom building block configuration page, a check box is corresponding to each property such as motion, appearance, sound, event, control, etc., and the property selection instruction can be to check the check box corresponding to an attribute to select the target building block attribute of the custom building block. The present application does not limit the specific implementation method, and it only needs to be implemented on the custom building block configuration page to select the properties such as motion, appearance, sound, event, control, etc., so as to select the target building block attribute of the custom building block.

[0039] S102: receiving a configuration completion instruction for the custom building block, and saving the configured custom building block.

[0040] Specifically, after configuring the properties of the target building block to which the custom building block belongs, other parameters required for the custom building block are configured according to the existing construction method of the custom building block to complete the configuration of the custom building block.

[0041] That is to say, after the configuration of the custom building block is completed, the configuration completion instruction is sent by clicking the Save button, so that the teaching application terminal saves the configuration file of the custom building block. The configuration file can be the .sb3 file corresponding to Scratch, and then the configured custom building block is saved.

[0042] S103: In response to a selection instruction for a target building block attribute list in a building block selection area of ​​the teaching application terminal, display the custom building block in the target building block attribute list.

[0043] That is, in response to a click instruction for the identification of the target building block attribute in the building block attribute menu in the building block selection area, the target building block attribute list is selected, and then the configured custom building block is displayed under the target building block attribute list in the building block selection area.

[0044] Exemplarily, if the custom building block is a custom building block for sliding X steps, the icon corresponding to the motion attribute in the building block attribute menu in the building block selection area is clicked to display the custom building block under the motion attribute list in the building block selection area, so as to classify the custom building block for sliding X steps into the running attribute.

[0045] Specifically, the display parameters of the custom building block in the target building block attribute list are the same as the display parameters of the target building block, and the target building block refers to a building block whose building block attributes are the target building block attributes, wherein the display parameters include color.

[0046] That is, while modifying the custom building block from the custom attribute list to which it originally belongs to to the target building block attribute list, the color of the custom building block can also be modified from the color corresponding to the original custom attribute to the color corresponding to the target building block attribute. Thus, the appearance of the custom building block and the attribute list to which it belongs are the same as those of the building block corresponding to the target building block attribute, and the shape and function of the original building block with the custom attribute are not changed.

[0047] Exemplarily, if the custom building block is a custom building block for sliding X steps, after configuring the custom building block, the custom building block for sliding X steps is displayed in the motion attribute list, and the color of the custom building block for sliding X steps is blue corresponding to the motion attribute. The custom building block for sliding X steps will not be displayed in the custom attribute list, and the color of the custom building block for sliding X steps will not be displayed as pink corresponding to the custom attribute. Furthermore, before students learn the building blocks of custom attributes, they will not see the pink building blocks in class, nor will they find the custom building blocks previously configured by the teacher in the custom attribute list, avoiding confusion for students. Furthermore, students will not see that the custom building block belongs to a new attribute through appearance, so as to prevent students from having questions about the building blocks of custom attributes before the teacher teaches the building blocks of custom attributes, which will cause the teacher to explain the pink building blocks of custom attributes to avoid affecting the course schedule.

[0048] Exemplarily, the following code is used to configure the attribute category of the custom building block procedures_prototype, and to classify the custom building block into the attribute list corresponding to the target building block attribute and display the color of the target building block attribute accordingly:

[0049] const defaultOption={

[0050] -"extensions":["colours_more","shape_statement",procedure_call_context menu"]

[0051] +}

[0052] / / Dynamically modify the corresponding category after if (category) {

[0053] defaultOption.extensions=[category,"shape_statement","procedure_call_contextmenu"]

[0054] defaultOption.category=Blockly.Categories[category];

[0055] }

[0056] / / init procedures_call block style

[0057] this.jsonInit(defaultOption);

[0058] Specifically, the custom building block configuration page includes a parameter display type. Before receiving a configuration completion instruction for the custom building block and saving the configuration file of the custom building block, the method also includes: responding to a selection instruction for the parameter display type of the custom building block to select a target parameter display type corresponding to the custom building block; responding to a parameter configuration instruction for a default parameter configuration box corresponding to the target parameter display type to configure the default parameters corresponding to the target parameter display type of the custom building block.

[0059] The method further includes: displaying the target parameter display type and default parameters corresponding to the custom building block in the target building block attribute list.

[0060] That is to say, when configuring a custom building block, you also need to configure the parameter display type of the custom building block. The parameter display type is used to indicate that the custom building block corresponds to the display parameters through different processing logic. Specifically, the parameter display type includes an input box and a drop-down box, wherein the input box includes a number or text input box and a Boolean value input box. That is, select one of the number or text input box, the Boolean value input box, and the drop-down box as the target parameter display type of the custom building block.

[0061] Furthermore, after selecting the target parameter display type of the custom building block, the default parameters corresponding to the target parameter display type of the custom building block are configured, so that after the configuration is completed, the configuration file corresponding to the configured custom building block is stored, and the configuration file is an sb3 file. After the IDE editor is loaded, the default parameters corresponding to the target parameter display type of the custom building block are displayed in the target building block attribute list, so as to improve the technical problem in the prior art that the custom building block cannot display the default parameters in the custom attribute list and can only enter the parameters of the custom building block in the programming area, so as to improve the application efficiency of the custom building block.

[0062] When the target parameter display type is a number or text input box, the default parameters corresponding to the target parameter display type of the custom building block are configured in the following manner: responding to the parameter input instruction of the parameter configuration box corresponding to the number or text input box, so as to use the input parameters as the default parameters corresponding to the number or text input box.

[0063] That is to say, when the target parameter display type configured by the custom building block is a number or text input box, the parameter configuration box of the number or text input box is displayed on the custom building block configuration page, and then, parameters are entered into the parameter configuration box of the number or text input box, and the input parameters are used as the default parameters corresponding to the number or text input box.

[0064] For example, if the custom building block is a custom building block for sliding X steps, the target parameter display type of the custom building block is a number or text input box, and a corresponding number or text input box is configured to display the number X, and the default parameter of X is configured to be 10, then after the custom building block is configured, a number or text input box is displayed on the custom building block in the target building block attribute list, and 10 is displayed in the number or text input box.

[0065] When the target parameter display type is a Boolean value input box, the default parameters corresponding to the target parameter display type of the custom building block are configured in the following manner: responding to a default parameter selection instruction of a default parameter configuration box corresponding to the Boolean value input box to configure the default parameters corresponding to the Boolean value input box.

[0066] Among them, Boolean value refers to true value or false value, and Boolean value input box is a diamond-shaped judgment box that needs to be judged as true or false. That is to say, when the target parameter display type configured by the custom building block is a Boolean value input box, the default parameter configuration box of the Boolean value input box is displayed on the custom building block configuration page, and then, it is necessary to select a true value or a false value in the default parameter configuration box of the Boolean value input box to use the selected true value or false value as the default parameter corresponding to the Boolean value input box.

[0067] Furthermore, when the target parameter display type of the custom building block is a Boolean value input box and the corresponding default parameter is configured as a true value, the custom building block in the target building block attribute list displays a Boolean value input box, and a true value is displayed in the Boolean value input box.

[0068] When the target parameter display type is a drop-down box, the default parameters corresponding to the target parameter display type of the custom building block are configured in the following manner: responding to the parameter configuration instructions of the parameter configuration boxes corresponding to the multiple drop-down options of the drop-down box to configure the parameters corresponding to the multiple drop-down options in the drop-down box; selecting a preset drop-down option from the multiple drop-down options to use the parameters corresponding to the preset drop-down option as the default parameters corresponding to the drop-down box.

[0069] That is to say, when the target parameter display type configured for the custom building block is a drop-down box, the parameter configuration boxes corresponding to the multiple drop-down options of the drop-down box are displayed on the custom building block configuration page, and then, the parameters are configured for the parameter configuration box corresponding to each drop-down option, and a preset drop-down option is selected from the multiple drop-down options to use the parameters corresponding to the preset drop-down option as the default parameters corresponding to the drop-down box.

[0070] Exemplarily, if the custom building block is a custom building block for sliding X steps, the target parameter display type of the custom building block is a drop-down box, and a corresponding drop-down box is configured to display the number X, and the number of multiple drop-down options configured in the drop-down box is three, and further, the multiple drop-down options for configuring X are 10, 20 and 30, respectively, where 10 is configured as the default parameter. After configuring the custom building block, a drop-down box is displayed on the custom building block in the target building block attribute list, and 10 is displayed in the drop-down box.

[0071] For example, when the parameter configuration boxes corresponding to multiple drop-down options of a drop-down box are displayed on a custom building block configuration page, the parameter configuration box corresponding to the preset drop-down box can be directly marked on the custom building block configuration page. There can be many specific implementation methods, and this application does not limit the method for selecting the preset drop-down options.

[0072] For example, the following code is used to set the parameter display type of a custom building block to be a number or text input box, a Boolean input box, and a drop-down box:

[0073] {

[0074] "mutation":{

[0075] "procode":"Block name %s label text %b facing %s",

[0076] "argumentnames":["number or text","boolean","dropdown"],

[0077] "argumentstyles":["","","dropdown"], / /

[0078] }

[0079] };

[0080] For example, the following code is used to configure the default values ​​of the number or text input box number ortext and the Boolean input box boolean of the custom building block:

[0081] {

[0082] "mutation":{

[0083] "procode":"Block name %s label text %b",

[0084] "argumentnames":["number or text","boolean"],

[0085] "argumentdefaults":["","true"]

[0086] }

[0087] }

[0088] Exemplarily, the following code is used to store the corresponding target building block properties of the custom building block in the sb3 file and configure the target parameter display type and default parameters of the custom building block:

[0089] container.setAttribute('category',this.category_)

[0090] / / Parameter display style, drop-down box, input box:

[0091] container.setAttribute('argumentstyles',JSON,stringify(this.argumentStyles_));

[0092] / / Parameter options, only valid for drop-down box input items

[0093] container.setAttribute('argumentoptions',JSANstringify(this.argumentptions_));

[0094] / / Default value of the parameter

[0095] container.setAttribute('argumentdefaults',JSON.stringify(this.argumentDefaults_));

[0096] Therefore, when parsing the stored sb3 file, the values ​​in the mutation persistently stored in the sb3 file are read, so that the IDE editor can display the pre-configured building blocks in the sb3 file according to different logic processing. For example, by parsing the sb3 file, it is determined that the display type of the pre-configured custom building block procedure block attchShadow is an input box or a selection box and displayed accordingly.

[0097] The method also includes: in response to a drag instruction for the custom building block in the target building block attribute list, displaying the custom building block in a programming area; and in response to a parameter modification instruction for the target parameter display type, displaying the target parameter display type and the modified parameters corresponding to the custom building block in the programming area.

[0098] That is to say, when applying a saved custom building block, you need to drag the custom building block from the target building block property list to the programming area. If the user does not modify the default parameters corresponding to the target parameter display type of the custom building block, the programming area still displays the target parameter display type of the custom building block and its corresponding default parameters; if the user modifies the default parameters corresponding to the target parameter display type of the custom building block, the programming area displays the target parameter display type of the custom building block and its modified parameters.

[0099] Exemplarily, if the target parameter display type of the custom building block is a drop-down box, and the default parameter of the configuration drop-down box is A, if the user selects multiple drop-down options in the drop-down box of the custom building block in the programming area, the parameters corresponding to the selected target drop-down option will be displayed in the drop-down box of the custom building block in the programming area, so as to modify the parameters in the drop-down box of the custom building block.

[0100] Furthermore, this application defines the target building block properties of the custom building block by adding the attribute category configuration for the procedures_prototype of the custom building block in the Scratch engine, so that the attribute type of the custom building block is one of the strings motion, looks, sound, event, and control, and persists the target building block properties to the sb3 file corresponding to the custom building block, that is, persists and stores it in the category attribute of the mutation of the procedures_prototype of the sb3 file, so that when parsing the sb3 file, the custom building block will be set in the corresponding target building block property list according to the target building block property and display the color corresponding to the target building block property. Thus, teachers can independently create the building blocks they want, and their appearance and functions are the same as those of the building blocks with native properties, and there is no need to develop new building blocks, reducing costs. In addition, students can use custom building blocks with the same native properties, which can quickly adapt to their usage methods, reduce learning costs, and improve teaching and learning efficiency.

[0101] In addition, the custom building blocks of the present application support the setting of parameter display type and default parameters to improve application efficiency, as well as the newly added drop-down box configuration of the custom building blocks, which reduces the need for manual input by students during application and causes errors, thereby improving teaching efficiency.

[0102] Based on the same application concept, the embodiments of the present application also provide a building block processing device corresponding to the building block processing method provided in the above embodiments. Since the principle of solving the problem by the device in the embodiments of the present application is similar to the building block processing method in the above embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0103] like Figure 3 As shown, Figure 3 A functional module diagram of a processing device for building blocks provided in an embodiment of the present application. The processing device 10 for building blocks is applied to a teaching application terminal, and the teaching application terminal provides a custom building block configuration page, including: a selection module 101, which is used to respond to an attribute selection instruction for the custom building block configuration page to select a target building block attribute to which the custom building block belongs; a receiving module 102, which is used to receive a configuration completion instruction for the custom building block and save the configured custom building block; a display module 103, which is used to respond to a selection instruction for a target building block attribute list in a building block selection area of ​​the teaching application terminal, and display the custom building block in the target building block attribute list.

[0104] Based on the same application concept, see Figure 4As shown, it is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device 20 includes: a processor 201, a memory 202 and a bus 203, the memory 202 stores machine-readable instructions executable by the processor 201, when the electronic device 20 is running, the processor 201 communicates with the memory 202 through the bus 203, and the machine-readable instructions are executed by the processor 201 when running to perform the steps of the building block processing method described in any of the above embodiments.

[0105] Specifically, when the machine-readable instructions are executed by the processor 201, the following processing can be performed: responding to an attribute selection instruction for the custom building block configuration page to select a target building block attribute to which the custom building block belongs; receiving a configuration completion instruction for the custom building block, and saving the configured custom building block; responding to a selection instruction for a target building block attribute list in the building block selection area of ​​the teaching application terminal, and displaying the custom building block in the target building block attribute list.

[0106] Based on the same application concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the building block processing method provided in the above embodiment are executed.

[0107] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, the above-mentioned building block processing method can be executed, by adding the attribute configuration of the custom building block in the process of configuring the custom building block, so that the teacher can configure the custom building block and select the target building block attribute of the custom building block from the original multiple building block attributes of Scratch. In this way, in the application process after the configuration is completed, the custom building block will be displayed in the target building block attribute list according to its corresponding target building block attribute, so as to realize the classification of the custom building block according to its target building block attribute, which solves the technical problem of the prior art that new building blocks need to be developed according to building block attributes, and achieves the technical effect of reducing costs and improving user experience.

[0108] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0110] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0111] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0112] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for processing a building block, characterized in that: Applied to a teaching application terminal, the teaching application terminal provides a custom building block configuration page, and the method includes: In response to the attribute selection instruction for the custom building block configuration page, select a target building block attribute to which the custom building block belongs; receiving a configuration completion instruction for the custom building block, and saving the configured custom building block; In response to a selection instruction for a target building block attribute list in a building block selection area of ​​the teaching application terminal, the custom building block is displayed in the target building block attribute list.

2. The method according to claim 1, characterized in that The custom building block configuration page includes a parameter display type. Before receiving a configuration completion instruction for the custom building block and saving a configuration file of the custom building block, the method further includes: In response to a selection instruction for the parameter display type of the custom building block, a target parameter display type corresponding to the custom building block is selected; In response to the parameter configuration instruction of the default parameter configuration box corresponding to the target parameter display type, the default parameters corresponding to the target parameter display type of the custom building block are configured.

3. The method according to claim 2, characterized in that The target parameter display type includes an input box, and the input box includes a number or text input box and a Boolean value input box. The default parameters corresponding to the target parameter display type of the custom building block are configured in the following ways: In response to a parameter input instruction of a parameter configuration box corresponding to the number or text input box, the input parameter is used as a default parameter corresponding to the number or text input box; or, In response to a default parameter selection instruction of a default parameter configuration box corresponding to the Boolean value input box, the default parameter corresponding to the Boolean value input box is configured.

4. The method according to claim 2, characterized in that: The target parameter display type includes a drop-down box, and the default parameters corresponding to the target parameter display type of the custom building block are configured in the following ways: Responding to parameter configuration instructions of parameter configuration boxes respectively corresponding to the plurality of drop-down options of the drop-down box, to configure parameters respectively corresponding to the plurality of drop-down options in the drop-down box; A preset drop-down option is selected from a plurality of drop-down options, so that the parameter corresponding to the preset drop-down option is used as the default parameter corresponding to the drop-down box.

5. The method according to claim 2, characterized in that: The method further comprises: The target parameter display type and default parameters corresponding to the custom building block are displayed in the target building block attribute list.

6. The method according to claim 2, characterized in that The method further comprises: In response to a drag instruction for the custom building block in the target building block attribute list, displaying the custom building block in a programming area; In response to the parameter modification instruction for the target parameter display type, the target parameter display type and the modified parameters corresponding to the custom building block are displayed in the programming area.

7. The method according to any one of claims 1 to 6, characterized in that: The display parameters of the custom building block in the target building block attribute list are the same as the display parameters of the target building block, and the target building block refers to a building block whose building block attributes are the attributes of the target building block. Among them, the display parameters include color.

8. A device for processing building blocks, characterized in that: Applied to a teaching application terminal, the teaching application terminal provides a custom building block configuration page, and the device includes: A selection module, configured to respond to an attribute selection instruction on the custom building block configuration page to select a target building block attribute to which the custom building block belongs; A receiving module, used for receiving a configuration completion instruction for the custom building block, and saving the configured custom building block; The display module is used for displaying the custom building block in the target building block attribute list in response to a selection instruction for the target building block attribute list in the building block selection area of ​​the teaching application terminal.

9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the method for processing building blocks as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for processing building blocks according to any one of claims 1 to 7 are executed.