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