From d7797e2c7ed1cfe7ba806c933248298cb7145eb3 Mon Sep 17 00:00:00 2001 From: Sarah Rietkerk Date: Tue, 6 Feb 2024 23:59:50 -0800 Subject: [PATCH] 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 + } + } + ] } ] }