Skip to content

Commit 316dae2

Browse files
authored
Merge pull request #89 from ahaim5357/base/to-parent
Cherry Pick SUNY Changes to Parent repo
2 parents a9171b9 + 6885553 commit 316dae2

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

aws/lti-middleware/index.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)