Skip to content

Commit

Permalink
Move log entries that we are submitting set grades to right before we…
Browse files Browse the repository at this point in the history
… actually try to submit them
  • Loading branch information
Alex-Jordan committed Nov 26, 2024
1 parent 3067000 commit 2c87c17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ async sub submit_set_grade ($self, $userID, $setID, $submittedSet = undef) {
my $user = $db->getUser($userID);
return 0 unless $user;

$self->warning("Submitting grade for user $userID and set $setID.")
if $ce->{debug_lti_grade_passback} || $self->{post_processing_mode};

my $userSet = $submittedSet // $db->getMergedSet($userID, $setID);
unless ($userSet->lis_source_did) {
$self->warning('lis_source_did is not available for this set.')
Expand All @@ -167,6 +164,8 @@ async sub submit_set_grade ($self, $userID, $setID, $submittedSet = undef) {
my $score = getSetPassbackScore($db, $ce, $userID, $userSet, !$self->{post_processing_mode});
return -1 unless $score;

$self->warning("Submitting grade for user $userID and set $setID.")
if $ce->{debug_lti_grade_passback} || $self->{post_processing_mode};
return await $self->submit_grade($userSet->lis_source_did, $score->{score});
}

Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/Authen/LTIAdvantage/SubmitGrade.pm
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ async sub submit_set_grade ($self, $userID, $setID, $submittedSet = undef) {
my $user = $db->getUser($userID);
return 0 unless $user;

$self->warning("Submitting grade for user $userID and set $setID.");
unless ($user->lis_source_did) {
$self->warning('LMS user id is not available for this user.');
return 0;
Expand All @@ -250,6 +249,7 @@ async sub submit_set_grade ($self, $userID, $setID, $submittedSet = undef) {
my $score = getSetPassbackScore($db, $ce, $userID, $userSet, !$self->{post_processing_mode});
return -1 unless $score;

$self->warning("Submitting grade for user $userID and set $setID.");
return await $self->submit_grade($user->lis_source_did, $userSet->lis_source_did, $score->{totalRight},
$score->{total});
}
Expand Down

0 comments on commit 2c87c17

Please sign in to comment.