Solved a few bugs on the WriteBlanks module
This commit is contained in:
@@ -59,8 +59,8 @@ export default function MultipleChoice({id, type, prompt, questions, userSolutio
|
||||
|
||||
const calculateScore = () => {
|
||||
const total = questions.length;
|
||||
const correct = userSolutions.filter((x) => questions.find((y) => y.id === x.question)?.solution === x.option || false).length;
|
||||
const missing = total - userSolutions.filter((x) => questions.find((y) => y.id === x.question)).length;
|
||||
const correct = userSolutions.filter((x) => questions.find((y) => y.id.toString() === x.question)?.solution === x.option || false).length;
|
||||
const missing = total - userSolutions.filter((x) => questions.find((y) => y.id.toString() === x.question)).length;
|
||||
|
||||
return {total, correct, missing};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user