From 5cc8bc372423bc3afb5fd5abf32c8d7ac9c742a2 Mon Sep 17 00:00:00 2001 From: Sarah Rietkerk <49178322+srietkerk@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:52:00 -0800 Subject: [PATCH] Teacher tool: added two simple variable validator rules (#9859) * add simple variable validator * Update catalog template to custom variable Co-authored-by: Thomas Sparks <69657545+thsparks@users.noreply.github.com> --------- Co-authored-by: Thomas Sparks <69657545+thsparks@users.noreply.github.com> --- docs/teachertool/catalog-shared.json | 12 +++++++++ docs/teachertool/validator-plans-shared.json | 26 ++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/docs/teachertool/catalog-shared.json b/docs/teachertool/catalog-shared.json index 809b3e72bc82..508e4dd22c1d 100644 --- a/docs/teachertool/catalog-shared.json +++ b/docs/teachertool/catalog-shared.json @@ -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" } ] } \ No newline at end of file diff --git a/docs/teachertool/validator-plans-shared.json b/docs/teachertool/validator-plans-shared.json index ac3eff1ae6e5..c01bd1b6271f 100644 --- a/docs/teachertool/validator-plans-shared.json +++ b/docs/teachertool/validator-plans-shared.json @@ -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 + } + } + ] } ] }