Hello
I’m trying to get my contractor’s license
I created some example random tests.
Test number one
CR-34 50-Question Practice Quiz
CR-34 Practice Exam: Advanced 50-Question Quiz
function gradeQuiz() {
const form = document.getElementById(“quizForm”);
const formData = new FormData(form);
let score = 0;
for (let [name, value] of formData.entries()) {
score += parseInt(value);
}
const total = 50;
const percent = Math.round((score / total) * 100);
const resultText = `You got ${score} out of ${total} correct (${percent}%). ` +
(percent >= 70 ? “✅ You passed!” : “❌ You did not pass. Try again!”);
document.getElementById(“quizResult”).innerText = resultText;
}