From aab338ce170007dd6ed751a68cf1a2045729294e Mon Sep 17 00:00:00 2001 From: TEC Date: Mon, 17 Oct 2022 21:40:07 +0800 Subject: [PATCH] Questions: allow age to be missing --- config/survey.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/survey.jl b/config/survey.jl index a24e697..3e58510 100644 --- a/config/survey.jl +++ b/config/survey.jl @@ -260,7 +260,8 @@ the questions you see now will not necessarily be in the final survey.", SurveyPart("Demographics (all questions are optional)", IntegerInput(:respondent_age, "How old are you?", - validators = n -> if n < 8 + validators = n -> if ismissing(n) # This is fine, the question is optional. + elseif n < 8 "My, you're advanced for you're age. Suspiciously advanced…" elseif n > 99 "Congratulations on becoming a centenarian! How about you get one of your grandchildren to do this survey instead?"