From 7b6ee0640b0ae15be42886bdc628f83b24bd14b0 Mon Sep 17 00:00:00 2001 From: Thomas Sparks <69657545+thsparks@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:22:27 -0800 Subject: [PATCH] Update Blocks Exist Json Schema for JsonPath Friendliness (#5525) The structure of the blockCounts input for blocksExist validator plans was not JsonPath friendly, as the customizable blockId was treated as a property and it was also a part of the path for count. This change adjusts the schema so both blockId and count can be referenced more easily by JsonPath, which we will need for parameterized criteria. Depends on microsoft/pxt#9905. --- docs/teachertool/validator-plans.json | 198 +++++++++++++++++--------- 1 file changed, 132 insertions(+), 66 deletions(-) diff --git a/docs/teachertool/validator-plans.json b/docs/teachertool/validator-plans.json index 0a36dc7fbef..5acdd14310f 100644 --- a/docs/teachertool/validator-plans.json +++ b/docs/teachertool/validator-plans.json @@ -7,9 +7,12 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "basic_show_icon": 1 - } + "blockCounts": [ + { + "blockId": "basic_show_icon", + "count": 1 + } + ] } ] }, @@ -20,39 +23,57 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "device_pin_event": 1 - } + "blockCounts": [ + { + "blockId": "device_pin_event", + "count": 1 + } + ] }, { "validator": "blocksExist", - "blockCounts": { - "device_pin_is_pressed": 1 - } + "blockCounts": [ + { + "blockId": "device_pin_is_pressed", + "count": 1 + } + ] }, { "validator": "blocksExist", - "blockCounts": { - "device_pin_released": 1 - } + "blockCounts": [ + { + "blockId": "device_pin_released", + "count": 1 + } + ] }, { "validator": "blocksExist", - "blockCounts": { - "device_get_digital_pin": 1 - } + "blockCounts": [ + { + "blockId": "device_get_digital_pin", + "count": 1 + } + ] }, { "validator": "blocksExist", - "blockCounts": { - "device_get_analog_pin": 1 - } + "blockCounts": [ + { + "blockId": "device_get_analog_pin", + "count": 1 + } + ] }, { "validator": "blocksExist", - "blockCounts": { - "pins_on_pulsed": 1 - } + "blockCounts": [ + { + "blockId": "pins_on_pulsed", + "count": 1 + } + ] } ] }, @@ -63,9 +84,12 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "radio_set_group": 1 - } + "blockCounts": [ + { + "blockId": "radio_set_group", + "count": 1 + } + ] } ] }, @@ -76,9 +100,12 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "radio_datagram_send_string": 1 - } + "blockCounts": [ + { + "blockId": "radio_datagram_send_string", + "count": 1 + } + ] } ] }, @@ -89,16 +116,22 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "device_print_message": 1 - }, + "blockCounts": [ + { + "blockId": "device_print_message", + "count": 1 + } + ], "childValidatorPlans": ["parameter_variable_accessed"] }, { "validator": "blocksExist", - "blockCounts": { - "device_show_number": 1 - }, + "blockCounts": [ + { + "blockId": "device_show_number", + "count": 1 + } + ], "childValidatorPlans": ["numeric_parameter_variable_accessed"] } ] @@ -110,9 +143,12 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "pxt-on-start": 1 - }, + "blockCounts": [ + { + "blockId": "pxt-on-start", + "count": 1 + } + ], "childValidatorPlans": ["set_radio_group"] } ] @@ -124,9 +160,12 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "device_button_event": 1 - }, + "blockCounts": [ + { + "blockId": "device_button_event", + "count": 1 + } + ], "childValidatorPlans": ["send_radio_string"] } ] @@ -138,21 +177,30 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "radio_on_number_drag": 1 - } + "blockCounts": [ + { + "blockId": "radio_on_number_drag", + "count": 1 + } + ] }, { "validator": "blocksExist", - "blockCounts": { - "radio_on_value_drag": 1 - } + "blockCounts": [ + { + "blockId": "radio_on_value_drag", + "count": 1 + } + ] }, { "validator": "blocksExist", - "blockCounts": { - "radio_on_string_drag": 1 - } + "blockCounts": [ + { + "blockId": "radio_on_string_drag", + "count": 1 + } + ] } ] }, @@ -163,23 +211,32 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "radio_on_number_drag": 1 - }, + "blockCounts": [ + { + "blockId": "radio_on_number_drag", + "count": 1 + } + ], "childValidatorPlans": ["show_parameter_value_on_screen"] }, { "validator": "blocksExist", - "blockCounts": { - "radio_on_value_drag": 1 - }, + "blockCounts": [ + { + "blockId": "radio_on_value_drag", + "count": 1 + } + ], "childValidatorPlans": ["show_parameter_value_on_screen"] }, { "validator": "blocksExist", - "blockCounts": { - "radio_on_string_drag": 1 - }, + "blockCounts": [ + { + "blockId": "radio_on_string_drag", + "count": 1 + } + ], "childValidatorPlans": ["show_parameter_value_on_screen"] } ] @@ -217,9 +274,12 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "device_random": 1 - } + "blockCounts": [ + { + "blockId": "device_random", + "count": 1 + } + ] } ] }, @@ -230,9 +290,12 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "controls_if": 1 - } + "blockCounts": [ + { + "blockId": "controls_if", + "count": 1 + } + ] } ] }, @@ -270,9 +333,12 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "controls_if": 1 - }, + "blockCounts": [ + { + "blockId": "controls_if", + "count": 1 + } + ], "childValidatorPlans": ["show_icon_on_screen"] } ]