Commit 8c9c81a8 authored by snehar-nd's avatar snehar-nd
Browse files

CSV- correct answer in mcq "SB-29415"

Showing with 8 additions and 1 deletion
+8 -1
......@@ -249,6 +249,12 @@ async function getStack(htmlString, questionCounter) {
return stack;
}
const ansIndex = (arr) => {
for (let index = 0; index < arr.length; index++) {
const element = arr[index];
if (element.answer === true) return index+1
}
}
async function renderMCQ(
question,
questionCounter,
......@@ -368,6 +374,7 @@ async function renderMCQ(
}
}
}
let answer = await ansIndex(question.editorState.options)
let data = {
Class: grade,
Subject: subject,
......@@ -377,7 +384,7 @@ async function renderMCQ(
Option2: questionOptions.length !== 0 ? questionOptions[1][0] : "",
Option3: questionOptions.length !== 0 ? questionOptions[2][0] : "",
Option4: questionOptions.length !== 0 ? questionOptions[3][0] : "",
"CorrectAnswer(1/2/3/4)": question.answer,
"CorrectAnswer(1/2/3/4)": answer,
Competencies: learningOutcome,
Skills: blooms,
QuestionImageUrl: queurl,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment