- Forums
- react
- How To Calculate Quiz Questions Final Score Percentage
This Page Contains information about How To Calculate Quiz Questions Final Score Percentage By edw in category react with 0 Replies. [5304], Last Updated: Mon Jun 24, 2024
edw
Thu Apr 04, 2024
0 Comments
161 Visits
This is a function i used in javascript and in react application where i have a questionair, quiz, test or examp app to get the final score of the correct answer and the wrong answer.
very simple calculation:
function percentage(correct, wrong) {
console.log(`LINE 380 correct=`, correct);
console.log(`LINE 380 wrong=`, wrong);
let totalValue = wrong + correct;
return Math.round((correct / totalValue) *100);
}