Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 24e1cb7

Browse files
authored
Merge pull request #1282 from bjones1/fitb_fix
Fix: Correct sending an undefined answer.
2 parents 5dbca3d + 45ae69c commit 24e1cb7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

runestone/mchoice/js/mchoice.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,9 @@ export default class MultipleChoice extends RunestoneBase {
394394
if (buttonObjs[i].checked) {
395395
given = buttonObjs[i].value;
396396
this.givenArray.push(given);
397-
this.feedbackString += `<li value="${i + 1}">${this.feedbackList[i]
398-
}</li>`;
397+
this.feedbackString += `<li value="${i + 1}">${
398+
this.feedbackList[i]
399+
}</li>`;
399400
this.givenlog += given + ",";
400401
this.singlefeedback = this.feedbackList[i];
401402
}
@@ -533,7 +534,8 @@ export default class MultipleChoice extends RunestoneBase {
533534
}
534535

535536
async logMCMFsubmission(sid) {
536-
var answer = this.givenArray[0];
537+
// If there's no answer provided (the array is empty), use a blank for the answer.
538+
var answer = this.givenArray[0] || "";
537539
var correct =
538540
this.givenArray[0] == this.correctIndexList[0] ? "T" : "F";
539541
var logAnswer =

0 commit comments

Comments
 (0)