MCPcopy Create free account
hub / github.com/code100x/daily-code / giveFeedback

Function giveFeedback

apps/web/components/mcq/MCQCard.tsx:79–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77 };
78
79 function giveFeedback() {
80 let scoreP = parseInt(((score / questions.length) * 100).toPrecision(3));
81 if (scoreP === 100) {
82 return "Excellent! You aced the test!";
83 } else if (scoreP >= 80) {
84 return "Great job! You did very well.";
85 } else if (scoreP >= 60) {
86 return "Good effort! You passed with a solid score.";
87 } else if (scoreP >= 50) {
88 return "Keep practicing! You're on the right track.";
89 } else {
90 return "Keep at it! Let's review and improve.";
91 }
92 }
93 useEffect(() => {
94 setFeedback(giveFeedback());
95 }, [score]);

Callers 1

MCQCardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected