From 34e116031458406d79bf582b0733f3b2a51dc141 Mon Sep 17 00:00:00 2001 From: Jochen Klar Date: Sun, 10 Dec 2023 11:36:05 +0100 Subject: [PATCH] Fix count_questions for progress bar --- rdmo/projects/progress.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdmo/projects/progress.py b/rdmo/projects/progress.py index ef082fa507..e33c8002d5 100644 --- a/rdmo/projects/progress.py +++ b/rdmo/projects/progress.py @@ -139,7 +139,7 @@ def count_questions(element, sets, conditions): if isinstance(child, Question): # for questions add the set_count to the counts dict # use the max function, since the same attribute could apear twice in the tree - if child.attribute is not None: + if child.attribute is not None and not child.is_optional: counts[child.attribute.id] = max(counts[child.attribute.id], set_count) else: # for everthing else, call this function recursively