From 1b40506f030ba7884764352dc1ea9032b45fef92 Mon Sep 17 00:00:00 2001 From: NguyenND Date: Mon, 23 Feb 2026 13:07:14 -0500 Subject: [PATCH] Phase 3: fix scoring --- app/routes/inspections.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/routes/inspections.py b/app/routes/inspections.py index 09d5c51..e5c303e 100644 --- a/app/routes/inspections.py +++ b/app/routes/inspections.py @@ -105,10 +105,12 @@ def _compute_score_from_form(form_fields, responses): if field['type'] == 'rating': try: v = int(val) + if v == 0: + continue # 0 = not answered, skip entirely earned += v - total += 5 # max rating is 5 stars + total += 5 except (ValueError, TypeError): - total += 5 + pass # unparseable = not answered, skip elif field['type'] == 'checkbox': total += 1