From 978c9bde7e6d8d982527abdba7ba60bec1c92d59 Mon Sep 17 00:00:00 2001 From: Thomas Sparks <69657545+thsparks@users.noreply.github.com> Date: Mon, 6 May 2024 10:04:12 -0700 Subject: [PATCH] Add a check for the number 0 (which is for checking score set to 0) (#10004) This adds a validator plan to check for the number 0 block, which is useful if we want to ensure 0 was passed in as a parameter (used by microsoft/pxt-microbit#5644 to check for setting lives to 0 specifically, which produces output when non-zero values do not) --- common-docs/teachertool/validator-plans-shared.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/common-docs/teachertool/validator-plans-shared.json b/common-docs/teachertool/validator-plans-shared.json index 09fa4551c12..681c7812ae0 100644 --- a/common-docs/teachertool/validator-plans-shared.json +++ b/common-docs/teachertool/validator-plans-shared.json @@ -281,6 +281,19 @@ "name": "" } ] + }, + { + ".desc": "The zero number block is present.", + "name": "number_zero", + "threshold": 1, + "checks": [ + { + "validator": "blockFieldValueExists", + "fieldType": "NUM", + "fieldValue": 0, + "blockType": "math_number" + } + ] } ] }