diff --git a/docs/teachertool/catalog.json b/docs/teachertool/catalog.json index 85dceaa690d..a7f1f9632c9 100644 --- a/docs/teachertool/catalog.json +++ b/docs/teachertool/catalog.json @@ -1,18 +1,66 @@ { "criteria": [ + { + "id": "35610CA0-38F8-4CCE-BAB9-99593DB3358A", + "use": "responds_to_events", + "template": "Responds to at least ${count} different events", + "description": "At least the specified number of event blocks are present.", + "docPath": "/teachertool", + "maxCount": 1, + "params": [ + { + "name": "count", + "type": "number", + "default": 1, + "paths": ["checks[0].count"] + } + ] + }, + { + "id": "3F7A9DB3-0B5E-456B-86E7-79573F9F6E53", + "use": "uses_input", + "template": "Uses input", + "description": "At least one block that reads or reacts to user input is present.", + "docPath": "/teachertool", + "maxCount": 1 + }, { "id": "D285D79B-85E5-4C8D-82D2-5A9E35AB1163", - "use": "output_to_led_display", - "template": "Outputs to the LED display", - "description": "Uses at least one block that lights up LEDs", + "use": "has_output", + "template": "Produces output", + "description": "At least one block that lights up LEDs, makes sound, or writes to pins is present.", + "docPath": "/teachertool", + "maxCount": 1 + }, + { + "id": "2CA4A5DA-4690-4514-97F5-2FE145AB3A59", + "use": "uses_led_coordinates", + "template": "Uses LED coordinates at least ${count} times", + "description": "Uses blocks with LED coordinate inputs at least the specified number of times.", + "docPath": "/teachertool", + "maxCount": 1, + "params": [ + { + "name": "count", + "type": "number", + "default": 1, + "paths": ["checks[0].count"] + } + ] + }, + { + "id": "BBB47818-B35F-404C-89A1-D6A594CE9E30", + "use": "sends_radio_message", + "template": "Sends radio messages", + "description": "Radio group is set and at least one block that sends a radio message is present.", "docPath": "/teachertool", "maxCount": 1 }, { - "id": "C57344FC-B915-4ACB-A070-67F8FFC18B4B", - "use": "read_gpio_pin", - "template": "Read a GPIO pin", - "description": "Read input from one or more of the microbit GPIO pins.", + "id": "8C8792C4-31C4-439D-ACAB-C99C9B8250AD", + "use": "receives_radio_message", + "template": "Receives radio messages", + "description": "Radio group is set and at least one block that listens for radio messages is present.", "docPath": "/teachertool", "maxCount": 1 }, diff --git a/docs/teachertool/validator-plans.json b/docs/teachertool/validator-plans.json index dee5df991d2..48b264bcbeb 100644 --- a/docs/teachertool/validator-plans.json +++ b/docs/teachertool/validator-plans.json @@ -18,7 +18,7 @@ }, { ".desc": "Shows something on the LED screen.", - "name": "output_to_led_display", + "name": "has_output", "threshold": 1, "checks": [ { @@ -33,70 +33,177 @@ "device_plot_bar_graph", "device_plot_brightness", "device_show_image_offset", - "device_scroll_image" + "device_scroll_image", + + "game_create_sprite", + "game_game_over", + "game_add_score", + "game_remove_life", + "game_start_countdown", + + "music_playable_play", + "device_ring", + "music_playable_play_default_bkg", + + "device_set_digital_pin", + "device_set_servo_pin" ], "count": 1 + }, + { + "validator": "blocksExist", + "blockCounts": [ + { + "blockId": "game_set_life", + "count": 1 + } + ], + "childValidatorPlans": ["number_zero"] } ] }, { - ".desc": "Read input from a GPIO pin.", - "name": "read_gpio_pin", + ".desc": "Processes input in any form (TODO : Non-Empty Check for event blocks)", + "name": "uses_input", "threshold": 1, "checks": [ { - "validator": "blocksExist", - "blockCounts": [ - { - "blockId": "device_pin_event", - "count": 1 - } - ] - }, + "validator": "blocksInSetExist", + "blocks": [ + "control_on_event", + "device_button_event", + "device_gesture_event", + "device_pin_event", + "device_pin_released", + "input_logo_event", + "input_on_sound", + "pins_on_pulsed", + "radio_on_number_drag", + "radio_on_string_drag", + "radio_on_value_drag", + "serial_on_data_received", + + "device_acceleration", + "device_get_analog_pin", + "device_get_button2", + "device_get_digital_pin", + "device_get_light_level", + "device_get_magnetic_force", + "device_get_rotation", + "device_get_running_time", + "device_get_running_time_micros", + "device_get_sound_level", + "device_heading", + "device_pin_is_pressed", + "device_temperature", + "deviceisgesture", + "input_logo_is_pressed", + "music_sound_is_playing", + "pins_i2c_readnumber", + "pins_pulse_duration", + "pins_pulse_in", + "serial_read_buffer", + "serial_read_line", + "serial_read_until", + "serial_readbuffer" + ], + "count": 1 + } + ] + }, + { + ".desc": "Runs code in response to any event (TODO : Non-Empty Check)", + "name": "responds_to_events", + "threshold": 1, + "checks": [ { - "validator": "blocksExist", - "blockCounts": [ - { - "blockId": "device_pin_is_pressed", - "count": 1 - } - ] - }, + "validator": "blocksInSetExist", + "blocks": [ + "control_on_event", + "device_button_event", + "device_gesture_event", + "device_pin_event", + "device_pin_released", + "input_logo_event", + "input_on_sound", + "melody_on_event", + "pins_on_pulsed", + "radio_on_number_drag", + "radio_on_string_drag", + "radio_on_value_drag", + "serial_on_data_received" + ], + "count": 0 + } + ] + }, + { + ".desc": "Checks for blocks that reference LEDs by their coordinates", + "name": "uses_led_coordinates", + "threshold": 1, + "checks": [ { - "validator": "blocksExist", - "blockCounts": [ - { - "blockId": "device_pin_released", - "count": 1 - } - ] - }, + "validator": "blocksInSetExist", + "blocks": [ + "device_plot", + "device_led_toggle", + "device_unplot", + "device_point", + "device_plot_brightness", + "device_point_brightness", + "game_create_sprite" + ], + "count": 0 + } + ] + }, + { + ".desc": "Checks that radio group is set and at least one radio send message block is present", + "name": "sends_radio_message", + "threshold": 2, + "checks": [ { "validator": "blocksExist", "blockCounts": [ { - "blockId": "device_get_digital_pin", + "blockId": "radio_set_group", "count": 1 } ] }, + { + "validator": "blocksInSetExist", + "blocks": [ + "radio_datagram_send", + "radio_datagram_send_value", + "radio_datagram_send_string" + ], + "count": 1 + } + ] + }, + { + ".desc": "Checks that radio group is set and at least block that listens for radio messages is present. (TODO : Non-Empty Check)", + "name": "receives_radio_message", + "threshold": 2, + "checks": [ { "validator": "blocksExist", "blockCounts": [ { - "blockId": "device_get_analog_pin", + "blockId": "radio_set_group", "count": 1 } ] }, { - "validator": "blocksExist", - "blockCounts": [ - { - "blockId": "pins_on_pulsed", - "count": 1 - } - ] + "validator": "blocksInSetExist", + "blocks": [ + "radio_on_number_drag", + "radio_on_value_drag", + "radio_on_string_drag" + ], + "count": 1 } ] },