-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Teacher Tool: Add Block Exist Criteria from Intro CS Curriculum #5644
Changes from 14 commits
36db5da
427a3e3
2ab839a
dacc634
96ae623
425a496
419b571
05105ce
22d1243
d9d73cd
1641184
277e159
d35c4c7
852a1d3
7d5d37b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
srietkerk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"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)", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just wanted to ask a clarifying question for the difference between this validator and the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More or less. uses_input is any kind of input (buttons, sound, etc...) and includes things like the "compass heading" and "sound level" blocks which aren't events. This one is looking at any "event" (i.e. most of the open-mouthed) blocks, even ones which are not necessarily "inputs" (specifically, "music on [melody note played]"). |
||
"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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm forgetting, did we set up the infrastructure to put validator plans in with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, something like that might be helpful, but we don't support it yet, and it'd be nontrivial to implement. There'd be some potentially-complicated design implications to deal with and I didn't want to get into that mess in this change. |
||
"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 | ||
} | ||
] | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a description for this criteria? It seems that the description for this is very similar to the template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to default to including descriptions, even if they feel a bit redundant. In this case, I think it's helpful to specify that we're looking specifically for blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, makes sense. I find that "reference" is a bit of a confusing word to use here, would changing it with "access" or "check" still make sense for this description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm "access" and "check" don't quite convey the correct meaning, in my mind. Perhaps "Uses blocks that accept LED coordinate inputs at least the specified number of times"?