File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -372,6 +372,24 @@ app.post(
372372 Math . round ( mastery * Math . pow ( 10 , scorePrecision ) ) /
373373 Math . pow ( 10 , scorePrecision ) ;
374374
375+ // If the 'text' extension is not supported, send a regular replaceResult
376+ if ( ! provider . outcome_service . supports_result_data ( 'text' ) ) {
377+ provider . outcome_service . send_replace_result (
378+ score ,
379+ ( err , result ) => {
380+ if ( err || ! result ) {
381+ console . debug ( "was unable to send result to your LMS" , err ) ;
382+ res . status ( 400 ) . send ( "unable_to_handle_score" ) . end ( ) ;
383+ return ;
384+ }
385+
386+ res . status ( 200 ) . end ( ) ;
387+ }
388+ ) ;
389+
390+ return ;
391+ }
392+
375393 let semester = calculateSemester ( Date . now ( ) ) ;
376394 let lmsUserId = user_id ;
377395 let lesson = lessonName ;
@@ -525,7 +543,7 @@ app.post(
525543 text ,
526544 ( err , result ) => {
527545 if ( err || ! result ) {
528- console . debug ( "was unable to send result to your LMS" , err ) ;
546+ console . debug ( "was unable to send result with text to your LMS" , err ) ;
529547 res . status ( 400 ) . send ( "unable_to_handle_score" ) . end ( ) ;
530548 return ;
531549 }
You can’t perform that action at this time.
0 commit comments