Skip to content

Commit

Permalink
Clean up catalog and move parameterized criteria into non-test (#9965)
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks authored Apr 15, 2024
1 parent 7ada1ee commit b1f61ad
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 126 deletions.
89 changes: 56 additions & 33 deletions common-docs/teachertool/catalog-shared.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
{
"criteria": [
{
"id": "B3FD8B3D-61B4-42F4-B0EF-64BD7D62CDAB",
"use": "two_different_loops",
"template": "Two different kinds of loops used",
"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",
"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",
"description": "At least one code block has a comment attached to it."
},
{
"id": "8F97C9A6-CF16-48B4-A84F-3105C24B20DE",
"use": "functions_have_comments",
Expand All @@ -43,25 +22,69 @@
"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",
"id": "7AE7EA2A-3AC8-42DC-89DB-65E3AE157156",
"use": "block_comment_used",
"template": "At least ${count} comments",
"description": "The project contains at least the specified number of comments.",
"docPath": "/teachertool",
"params": [
{
"name": "count",
"type": "number",
"default": 1,
"paths": ["checks[0].count"]
}
]
},
{
"id": "59AAC5BA-B0B3-4389-AA90-1E767EFA8563",
"use": "block_used_n_times",
"template": "${Block} used ${count} times",
"description": "This block was used the specified number of times in your project.",
"docPath": "/teachertool",
"description": "A user-defined variable has its value set to a random number."
"params": [
{
"name": "block",
"type": "block",
"paths": ["checks[0].blockCounts[0].blockId"]
},
{
"name": "count",
"type": "number",
"default": 1,
"paths": ["checks[0].blockCounts[0].count"]
}
]
},
{
"id": "E8DAD360-F4AB-4E6B-9981-C14BDEE1295B",
"use": "device_random_used",
"template": "The 'pick random' block is used",
"id": "B8987394-1531-4C71-8661-BE4086CE0C6E",
"use": "n_loops",
"template": "At least ${count} loops used",
"docPath": "/teachertool",
"description": "The 'pick random' block from the math category is used at least once."
"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": "DC564060-F177-46CC-A3AC-890CD8545972",
"use": "num_compare_eq",
"template": "Compare two numbers for equality",
"id": "79D5DAF7-FED3-473F-81E2-E004922E5F55",
"use": "custom_function_called",
"template": "At least ${count} custom functions exist and get called",
"docPath": "/teachertool",
"description": "The program compares two numbers for equality at least once."
"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
}
]
}
]
}
65 changes: 0 additions & 65 deletions common-docs/teachertool/test/catalog-shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,71 +19,6 @@
"paths": ["checks[0].shareId"]
}
]
},
{
"id": "7AE7EA2A-3AC8-42DC-89DB-65E3AE157156",
"use": "block_comment_used",
"template": "At least ${count} comments",
"description": "The project contains at least the specified number of comments.",
"docPath": "/teachertool",
"params": [
{
"name": "count",
"type": "number",
"default": 1,
"paths": ["checks[0].count"]
}
]
},
{
"id": "59AAC5BA-B0B3-4389-AA90-1E767EFA8563",
"use": "block_used_n_times",
"template": "${Block} used ${count} times",
"description": "This block was used the specified number of times in your project.",
"docPath": "/teachertool",
"params": [
{
"name": "block",
"type": "block",
"paths": ["checks[0].blockCounts[0].blockId"]
},
{
"name": "count",
"type": "number",
"default": 1,
"paths": ["checks[0].blockCounts[0].count"]
}
]
},
{
"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
}
]
}
]
}
28 changes: 0 additions & 28 deletions common-docs/teachertool/test/validator-plans-shared.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
{
"validatorPlans": [
{
".desc": "Block used n times (to be filled in by the user)",
"name": "block_used_n_times",
"threshold": 1,
"checks": [
{
"validator": "blocksExist",
"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
}
]
},
{
".desc": "Ask Copilot a question",
"name": "ai_question",
Expand Down
28 changes: 28 additions & 0 deletions common-docs/teachertool/validator-plans-shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,34 @@
]
}
]
},
{
".desc": "Block used n times (to be filled in by the user)",
"name": "block_used_n_times",
"threshold": 1,
"checks": [
{
"validator": "blocksExist",
"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
}
]
}
]
}

0 comments on commit b1f61ad

Please sign in to comment.