@@ -122,9 +122,10 @@ async sub submit_course_grade ($self, $userID) {
122
122
my $user = $db -> getUser($userID );
123
123
return 0 unless $user ;
124
124
125
- $self -> warning(" submitting all grades for user: $userID " ) if $ce -> {debug_lti_grade_passback };
125
+ $self -> warning(" submitting all grades for user: $userID " )
126
+ if $ce -> {debug_lti_grade_passback } || $self -> {post_processing_mode };
126
127
$self -> warning(" lis_source_did is not available for user: $userID " )
127
- if !$user -> lis_source_did && $ce -> {debug_lti_grade_passback };
128
+ if !$user -> lis_source_did && ( $ce -> {debug_lti_grade_passback } || $self -> { post_processing_mode }) ;
128
129
129
130
return await $self -> submit_grade($user -> lis_source_did, scalar (grade_all_sets($db , $userID )));
130
131
}
@@ -140,9 +141,10 @@ async sub submit_set_grade ($self, $userID, $setID) {
140
141
141
142
my $userSet = $db -> getMergedSet($userID , $setID );
142
143
143
- $self -> warning(" Submitting grade for user $userID and set $setID ." ) if $ce -> {debug_lti_grade_passback };
144
+ $self -> warning(" Submitting grade for user $userID and set $setID ." )
145
+ if $ce -> {debug_lti_grade_passback } || $self -> {post_processing_mode };
144
146
$self -> warning(' lis_source_did is not available for this set.' )
145
- if !$userSet -> lis_source_did && $ce -> {debug_lti_grade_passback };
147
+ if !$userSet -> lis_source_did && ( $ce -> {debug_lti_grade_passback } || $self -> { post_processing_mode }) ;
146
148
147
149
return await $self -> submit_grade(
148
150
$userSet -> lis_source_did,
229
231
$bodyhash .= ' =' ;
230
232
}
231
233
232
- $self -> warning(" Retrieving prior grade using sourcedid: $sourcedid " ) if $ce -> {debug_lti_parameters };
234
+ $self -> warning(" Retrieving prior grade using sourcedid: $sourcedid " )
235
+ if $ce -> {debug_lti_parameters } || $self -> {post_processing_mode };
233
236
234
237
my $requestGen = Net::OAuth-> request(' consumer' );
235
238
303
306
if $ce -> {debug_lti_grade_passback };
304
307
$self -> warning(' LMS grade will NOT be updated - grade unchanged. '
305
308
. " Old score: $oldScore ; New score: $score " )
306
- if ( $ce -> {debug_lti_grade_passback }) ;
309
+ if $ce -> {debug_lti_grade_passback } || $self -> { post_processing_mode } ;
307
310
return 1;
308
311
} else {
309
312
debug(" LMS grade will be updated. sourcedid: $sourcedid ; Old score: $oldScore ; New score: $score " )
314
317
$self -> warning(' Unable to retrieve prior grade from LMS. Note that if your server time is not correct, '
315
318
. ' this may fail for reasons which are less than obvious from the error messages. Error: '
316
319
. $response -> message)
317
- if ( $ce -> {debug_lti_grade_passback }) ;
320
+ if $ce -> {debug_lti_grade_passback } || $self -> { post_processing_mode } ;
318
321
debug(' Unable to retrieve prior grade from LMS. Note that if your server time is not correct, '
319
322
. ' this may fail for reasons which are less than obvious from the error messages. Error: '
320
323
. $response -> message);
@@ -412,17 +415,23 @@ EOS
412
415
my $message = $1 ;
413
416
$self -> warning(" result is: $message " ) if $ce -> {debug_lti_grade_passback };
414
417
if ($message ne ' success' ) {
415
- debug(" Unable to update LMS grade $sourcedid . LMS responded with message: $message " );
418
+ $self -> warning(" Unable to update LMS grade $sourcedid . LMS responded with message: $message " )
419
+ if $self -> {post_processing_mode };
420
+ debug(" Unable to update LMS grade $sourcedid . LMS responded with message: $message " );
416
421
return 0;
417
422
} else {
418
423
# If we got here, we got successes from both the post and the lms.
419
424
debug(" Successfully updated LMS grade $sourcedid . LMS responded with message: $message " );
420
425
}
421
426
} else {
427
+ $self -> warning(" Unable to update LMS grade $sourcedid . Error: " . $response -> message)
428
+ if $self -> {post_processing_mode };
422
429
debug(" Unable to update LMS grade $sourcedid . Error: " . $response -> message);
423
430
debug($response -> body);
424
431
return 0;
425
432
}
433
+ $self -> warning(" Success submitting grade using sourcedid: $sourcedid and score: $score " )
434
+ if $self -> {post_processing_mode };
426
435
debug(" Success submitting grade using sourcedid: $sourcedid and score: $score " );
427
436
428
437
return 1;
0 commit comments