Skip to content

Commit

Permalink
Update Blocks Exist Json Schema for JsonPath Friendliness (#5525)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thsparks authored Mar 6, 2024
1 parent 98dc60a commit 7b6ee06
Showing 1 changed file with 132 additions and 66 deletions.
198 changes: 132 additions & 66 deletions docs/teachertool/validator-plans.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"basic_show_icon": 1
}
"blockCounts": [
{
"blockId": "basic_show_icon",
"count": 1
}
]
}
]
},
Expand All @@ -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
}
]
}
]
},
Expand All @@ -63,9 +84,12 @@
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"radio_set_group": 1
}
"blockCounts": [
{
"blockId": "radio_set_group",
"count": 1
}
]
}
]
},
Expand All @@ -76,9 +100,12 @@
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"radio_datagram_send_string": 1
}
"blockCounts": [
{
"blockId": "radio_datagram_send_string",
"count": 1
}
]
}
]
},
Expand All @@ -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"]
}
]
Expand All @@ -110,9 +143,12 @@
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"pxt-on-start": 1
},
"blockCounts": [
{
"blockId": "pxt-on-start",
"count": 1
}
],
"childValidatorPlans": ["set_radio_group"]
}
]
Expand All @@ -124,9 +160,12 @@
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"device_button_event": 1
},
"blockCounts": [
{
"blockId": "device_button_event",
"count": 1
}
],
"childValidatorPlans": ["send_radio_string"]
}
]
Expand All @@ -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
}
]
}
]
},
Expand All @@ -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"]
}
]
Expand Down Expand Up @@ -217,9 +274,12 @@
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"device_random": 1
}
"blockCounts": [
{
"blockId": "device_random",
"count": 1
}
]
}
]
},
Expand All @@ -230,9 +290,12 @@
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"controls_if": 1
}
"blockCounts": [
{
"blockId": "controls_if",
"count": 1
}
]
}
]
},
Expand Down Expand Up @@ -270,9 +333,12 @@
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"controls_if": 1
},
"blockCounts": [
{
"blockId": "controls_if",
"count": 1
}
],
"childValidatorPlans": ["show_icon_on_screen"]
}
]
Expand Down

0 comments on commit 7b6ee06

Please sign in to comment.