From 9c7aece34b55a360f810d8eeb818a53928d424df Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Tue, 12 Nov 2024 14:39:17 -0800 Subject: [PATCH] fix logic for homework_always with LTIGradeOnSubmit --- lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm | 4 +++- lib/WeBWorK/Authen/LTIAdvantage/SubmitGrade.pm | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm b/lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm index 35ee84beef..944985449d 100644 --- a/lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm +++ b/lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm @@ -138,7 +138,9 @@ async sub submit_set_grade ($self, $userID, $setID) { my $ce = $c->{ce}; my $db = $c->{db}; - return unless can_submit_LMS_score($db, $ce, $userID, $setID); + return + unless (can_submit_LMS_score($db, $ce, $userID, $setID) + || !$self->{post_processing_mode} && $ce->{LTIGradeOnSubmit} eq 'homework_always'); my $user = $db->getUser($userID); return 0 unless $user; diff --git a/lib/WeBWorK/Authen/LTIAdvantage/SubmitGrade.pm b/lib/WeBWorK/Authen/LTIAdvantage/SubmitGrade.pm index 0d1191a4d0..367280e6e7 100644 --- a/lib/WeBWorK/Authen/LTIAdvantage/SubmitGrade.pm +++ b/lib/WeBWorK/Authen/LTIAdvantage/SubmitGrade.pm @@ -217,7 +217,9 @@ async sub submit_set_grade ($self, $userID, $setID) { my $ce = $c->{ce}; my $db = $c->{db}; - return unless can_submit_LMS_score($db, $ce, $userID, $setID); + return + unless (can_submit_LMS_score($db, $ce, $userID, $setID) + || !$self->{post_processing_mode} && $ce->{LTIGradeOnSubmit} eq 'homework_always'); my $user = $db->getUser($userID); return 0 unless $user;