From 5ae2a2d4e25ed4142ec28f5dda77e004ebc46e76 Mon Sep 17 00:00:00 2001 From: Paul Z Date: Mon, 6 Nov 2023 15:08:36 +0100 Subject: [PATCH] total submission calculation corrected --- src/question/single_choice.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/question/single_choice.rs b/src/question/single_choice.rs index 4a06f9a..3437a84 100644 --- a/src/question/single_choice.rs +++ b/src/question/single_choice.rs @@ -88,7 +88,7 @@ impl Question for SingleChoiceQuestion { Ok(ViewerTemplate { show_result, name: &self.inner.name, - total_submissions: self.submissions.iter().fold(0, |acc, (_, v)| acc + v), + total_submissions: self.submissions.len() as u32, submissions: &self.submissions.iter().fold( vec![0; self.inner.answers.len()], |mut acc, (_, v)| {