From a7172438e0ef5abc925c7576be5f9675c70f7862 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Mon, 25 Nov 2024 23:37:37 -0800 Subject: [PATCH] bring back scalar context output for grade_all_sets --- lib/WeBWorK/Utils/Sets.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/WeBWorK/Utils/Sets.pm b/lib/WeBWorK/Utils/Sets.pm index b77ffc0f18..9d620844bd 100644 --- a/lib/WeBWorK/Utils/Sets.pm +++ b/lib/WeBWorK/Utils/Sets.pm @@ -163,7 +163,11 @@ sub grade_all_sets ( push @$includedSets, $userSet; } - return ($courseTotalRight, $courseTotal, $includedSets); + return + wantarray + ? ($courseTotalRight, $courseTotal, $includedSets) + : ($courseTotal ? $courseTotalRight / $courseTotal : 0); + } sub is_restricted ($db, $set, $studentName) {