Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

skybird120's avatar

quiz website in php

I'm working on quiz website the admin can add the questions and then it shows in the user dash, I need help with the result page I need the equation to show if the user passed or not in this exam or a GitHub link that solves something like that in PHP.

0 likes
1 reply
sididev's avatar

Hii, u can implement this equation in PHP and display the result on the result page.

<?php

$total_questions = 10;
$correct_answers = 8;
$passing_percentage = 60;

if ($correct_answers/$total_questions * 100 >= $passing_percentage) {
    echo "Congratulations! You have passed the exam.";
} else {
    echo "Sorry, you have not passed the exam.";
}

?>
1 like

Please or to participate in this conversation.