diff --git a/common-docs/teachertool/catalog-shared.json b/common-docs/teachertool/catalog-shared.json index cab05f47fcf8..7ba40291e9a5 100644 --- a/common-docs/teachertool/catalog-shared.json +++ b/common-docs/teachertool/catalog-shared.json @@ -4,55 +4,64 @@ "id": "B3FD8B3D-61B4-42F4-B0EF-64BD7D62CDAB", "use": "two_different_loops", "template": "Two different kinds of loops used", - "docPath": "/teachertool" + "docPath": "/teachertool", + "description": "The program uses two different types of loops (for, repeat, while, or for-of)." }, { "id": "49262A2B-C02A-43A2-BAD5-FCAC6AE9D464", "use": "custom_function_called", "template": "A custom function exists and gets called", - "docPath": "/teachertool" + "docPath": "/teachertool", + "description": "A user-defined function is created and called in the program." }, { "id": "76D86387-E3CF-4BEB-B62C-B811F5997631", "use": "block_comment_used", "template": "At least one block has comments", - "docPath": "/teachertool" + "docPath": "/teachertool", + "description": "At least one code block has a comment attached to it." }, { "id": "8F97C9A6-CF16-48B4-A84F-3105C24B20DE", "use": "functions_have_comments", "template": "All function definitions have comments", - "docPath": "/teachertool" + "docPath": "/teachertool", + "description": "All user-defined functions in the program have comments attached to them." }, { "id": "D21D76A2-D9FD-4F9B-B0AC-973CB870EA78", "use": "variable_set", "template": "At least one custom variable is set", - "docPath": "/teachertool" + "docPath": "/teachertool", + "description": "At least one user-defined variable is set to a value." }, { "id": "0173898D-8A48-4266-AAB9-CE934471A734", "use": "variable_accessed", "template": "At least one variable is accessed", - "docPath": "/teachertool" + "docPath": "/teachertool", + "description": "At least one variable's value is read." }, { "id": "8E6F9A92-2D22-4BB0-A77A-BD7490D3CEF7", "use": "variable_set_random", "template": "A custom variable's value is set to a random number", - "docPath": "/teachertool" + "docPath": "/teachertool", + "description": "A user-defined variable has its value set to a random number." }, { "id": "E8DAD360-F4AB-4E6B-9981-C14BDEE1295B", "use": "device_random_used", - "template": "The math random number generator block is used", - "docPath": "/teachertool" + "template": "The 'pick random' block is used", + "docPath": "/teachertool", + "description": "The 'pick random' block from the math category is used at least once." }, { "id": "DC564060-F177-46CC-A3AC-890CD8545972", "use": "num_compare_eq", "template": "Compare two numbers for equality", - "docPath": "/teachertool" + "docPath": "/teachertool", + "description": "The program compares two numbers for equality at least once." } ] -} \ No newline at end of file +} diff --git a/common-docs/teachertool/test/catalog-shared.json b/common-docs/teachertool/test/catalog-shared.json index 956d680e026f..95196242ba81 100644 --- a/common-docs/teachertool/test/catalog-shared.json +++ b/common-docs/teachertool/test/catalog-shared.json @@ -2,7 +2,7 @@ "criteria": [ { "id": "7AE7EA2A-3AC8-42DC-89DB-65E3AE157156", - "use": "check_for_comments", + "use": "block_comment_used", "template": "At least ${count} comments", "description": "The project contains at least the specified number of comments.", "docPath": "/teachertool", @@ -11,30 +11,73 @@ "name": "count", "type": "number", "default": 1, - "path": "checks[0].count" + "paths": ["checks[0].count"] } ] }, { "id": "59AAC5BA-B0B3-4389-AA90-1E767EFA8563", "use": "block_used_n_times", - "template": "${block_id} used ${count} times", + "template": "${Block} used ${count} times", "description": "This block was used the specified number of times in your project.", "docPath": "/teachertool", "params": [ { - "name": "block_id", - "type": "string", - "picker": "blockSelector", - "path": "checks[0].blocks[:clear&:append]" + "name": "block", + "type": "block", + "paths": ["checks[0].blockCounts[0].blockId"] }, { "name": "count", "type": "number", "default": 1, - "path": "checks[0].count" + "paths": ["checks[0].blockCounts[0].count"] + } + ] + }, + { + "id": "499F3572-E655-4DEE-953B-5F26BF0191D7", + "use": "block_used_n_times", + "template": "Long String: ${question}", + "description": "This is just a test for long string inputs.", + "docPath": "/teachertool", + "params": [ + { + "name": "question", + "type": "longString", + "paths": ["checks[0].blockCounts[0].blockId"] + } + ] + }, + { + "id": "B8987394-1531-4C71-8661-BE4086CE0C6E", + "use": "n_loops", + "template": "At least ${count} loops used", + "docPath": "/teachertool", + "description": "The program uses at least this many loops of any kind (for, repeat, while, or for-of).", + "params": [ + { + "name": "count", + "type": "number", + "paths": ["checks[0].count"], + "default": 1 + } + ] + }, + { + "id": "79D5DAF7-FED3-473F-81E2-E004922E5F55", + "use": "custom_function_called", + "template": "At least ${count} custom functions exist and get called", + "docPath": "/teachertool", + "description": "At least this many user-defined functions are created and called.", + "params": [ + { + "name": "count", + "type": "number", + "paths": ["checks[0].count", "checks[1].count"], + "default": 1 } ] } ] -} \ No newline at end of file +} diff --git a/common-docs/teachertool/test/validator-plans-shared.json b/common-docs/teachertool/test/validator-plans-shared.json index a13f74c3de17..1cd2ffb53cc0 100644 --- a/common-docs/teachertool/test/validator-plans-shared.json +++ b/common-docs/teachertool/test/validator-plans-shared.json @@ -7,9 +7,24 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "": 0 - } + "blockCounts": [ + { + "blockId": "", + "count": 0 + } + ] + } + ] + }, + { + ".desc": "Loops used n times (to be filled in by the user)", + "name": "n_loops", + "threshold": 1, + "checks": [ + { + "validator": "blocksInSetExist", + "blocks": ["controls_repeat_ext", "device_while", "pxt_controls_for", "pxt_controls_for_of"], + "count": 0 } ] } diff --git a/common-docs/teachertool/validator-plans-shared.json b/common-docs/teachertool/validator-plans-shared.json index 0d0d06a40d84..0ffe198ee652 100644 --- a/common-docs/teachertool/validator-plans-shared.json +++ b/common-docs/teachertool/validator-plans-shared.json @@ -7,27 +7,39 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "controls_repeat_ext": 1 - } + "blockCounts": [ + { + "blockId": "controls_repeat_ext", + "count": 1 + } + ] }, { "validator": "blocksExist", - "blockCounts": { - "device_while": 1 - } + "blockCounts": [ + { + "blockId": "device_while", + "count": 1 + } + ] }, { "validator": "blocksExist", - "blockCounts": { - "pxt_controls_for": 1 - } + "blockCounts": [ + { + "blockId": "pxt_controls_for", + "count": 1 + } + ] }, { "validator": "blocksExist", - "blockCounts": { - "pxt_controls_for_of": 1 - } + "blockCounts": [ + { + "blockId": "pxt_controls_for_of", + "count": 1 + } + ] } ] }, @@ -65,9 +77,12 @@ }, { "validator": "blocksExist", - "blockCounts": { - "function_definition": 1 - } + "blockCounts": [ + { + "blockId": "function_definition", + "count": 1 + } + ] } ] }, @@ -78,9 +93,12 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "variables_set": 1 - } + "blockCounts": [ + { + "blockId": "variables_set", + "count": 1 + } + ] } ] }, @@ -91,9 +109,89 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "variables_get": 1 - } + "blockCounts": [ + { + "blockId": "variables_get", + "count": 1 + } + ] + } + ] + }, + { + ".desc": "A parameter's value is used", + "name": "parameter_variable_accessed", + "threshold": 1, + "checks": [ + { + "validator": "blocksExist", + "blockCounts": [ + { + "blockId": "argument_reporter_string", + "count": 1 + } + ] + }, + { + "validator": "blocksExist", + "blockCounts": [ + { + "blockId": "argument_reporter_number", + "count": 1 + } + ] + }, + { + "validator": "blocksExist", + "blockCounts": [ + { + "blockId": "argument_reporter_boolean", + "count": 1 + } + ] + }, + { + "validator": "blocksExist", + "blockCounts": [ + { + "blockId": "argument_reporter_array", + "count": 1 + } + ] + }, + { + "validator": "blocksExist", + "blockCounts": [ + { + "blockId": "argument_reporter_custom", + "count": 1 + } + ] + }, + { + "validator": "blocksExist", + "blockCounts": [ + { + "blockId": "variables_get_reporter", + "count": 1 + } + ] + } + ] + }, + { + ".desc": "A numeric parameter's value is used", + "name": "numeric_parameter_variable_accessed", + "threshold": 1, + "checks": [ + { + "validator": "blocksExist", + "blockCounts": [ + { + "blockId": "argument_reporter_number", + "count": 1 + } + ] } ] }, @@ -104,9 +202,12 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "variables_set": 1 - }, + "blockCounts": [ + { + "blockId": "variables_set", + "count": 1 + } + ], "childValidatorPlans": ["device_random_used"] } ] @@ -118,9 +219,12 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "device_random": 1 - } + "blockCounts": [ + { + "blockId": "device_random", + "count": 1 + } + ] } ] }, @@ -145,9 +249,28 @@ "checks": [ { "validator": "blocksExist", - "blockCounts": { - "math_number": 2 - } + "blockCounts": [ + { + "blockId": "math_number", + "count": 2 + } + ] + } + ] + }, + { + ".desc": "a number exists", + "name": "math_num_exists", + "threshold": 1, + "checks": [ + { + "validator": "blocksExist", + "blockCounts": [ + { + "blockId": "math_number", + "count": 1 + } + ] } ] }