Skip to content

Commit

Permalink
bug: fix score logic in 'multiple' question type
Browse files Browse the repository at this point in the history
  • Loading branch information
Salgado2004 committed Jun 25, 2024
1 parent eff5527 commit eae9088
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ export class MultipleQuestionComponent implements QuestionStructure {
this.answers.forEach((ans, index) => {
if(ans){
total += this.correct.includes(this.options[index]) ? 1 : 0;
} else{
total += !this.correct.includes(this.options[index]) ? 1 : 0;
}
});
return total/this.correct.length;
return total/this.options.length;
}

getSummary(){
Expand Down

0 comments on commit eae9088

Please sign in to comment.