Skip to content

Commit

Permalink
Port Common Docs Changes to v10
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks committed Mar 25, 2024
1 parent 3230634 commit 2b2789f
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 53 deletions.
31 changes: 20 additions & 11 deletions common-docs/teachertool/catalog-shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
]
}
}
61 changes: 52 additions & 9 deletions common-docs/teachertool/test/catalog-shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
}
]
}
]
}
}
21 changes: 18 additions & 3 deletions common-docs/teachertool/test/validator-plans-shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
}
Expand Down
Loading

0 comments on commit 2b2789f

Please sign in to comment.