From d7797e2c7ed1cfe7ba806c933248298cb7145eb3 Mon Sep 17 00:00:00 2001 From: Sarah Rietkerk Date: Tue, 6 Feb 2024 23:59:50 -0800 Subject: [PATCH 1/2] add simple variable validator --- 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..021a5d2864dd 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 variable's value 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 + } + } + ] } ] } From 9312064698379d22aa4de0a19e380777c608b891 Mon Sep 17 00:00:00 2001 From: Sarah Rietkerk <49178322+srietkerk@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:05:32 -0800 Subject: [PATCH 2/2] Update catalog template to custom variable Co-authored-by: Thomas Sparks <69657545+thsparks@users.noreply.github.com> --- docs/teachertool/catalog-shared.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/teachertool/catalog-shared.json b/docs/teachertool/catalog-shared.json index 021a5d2864dd..508e4dd22c1d 100644 --- a/docs/teachertool/catalog-shared.json +++ b/docs/teachertool/catalog-shared.json @@ -27,7 +27,7 @@ { "id": "D21D76A2-D9FD-4F9B-B0AC-973CB870EA78", "use": "variable_set", - "template": "At least one variable's value is set", + "template": "At least one custom variable is set", "docPath": "/teachertool" }, {