Skip to content

Commit

Permalink
Teacher tool: added two simple variable validator rules (#9859)
Browse files Browse the repository at this point in the history
* add simple variable validator

* Update catalog template to custom variable

Co-authored-by: Thomas Sparks <[email protected]>

---------

Co-authored-by: Thomas Sparks <[email protected]>
  • Loading branch information
srietkerk and thsparks authored Feb 8, 2024
1 parent 249d5fa commit 5cc8bc3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/teachertool/catalog-shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
"use": "functions_have_comments",
"template": "All function definitions have comments",
"docPath": "/teachertool"
},
{
"id": "D21D76A2-D9FD-4F9B-B0AC-973CB870EA78",
"use": "variable_set",
"template": "At least one custom variable is set",
"docPath": "/teachertool"
},
{
"id": "0173898D-8A48-4266-AAB9-CE934471A734",
"use": "variable_accessed",
"template": "At least one variable is accessed",
"docPath": "/teachertool"
}
]
}
26 changes: 26 additions & 0 deletions docs/teachertool/validator-plans-shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,32 @@
}
}
]
},
{
".desc": "A variable's value is set",
"name": "variable_set",
"threshold": 1,
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"variables_set": 1
}
}
]
},
{
".desc": "A variable's value is used",
"name": "variable_accessed",
"threshold": 1,
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"variables_get": 1
}
}
]
}
]
}

0 comments on commit 5cc8bc3

Please sign in to comment.