diff --git a/index.php b/index.php index 895f4e8..c90bc37 100755 --- a/index.php +++ b/index.php @@ -2,7 +2,11 @@ require_once('includes/include.php'); $questions = []; if(!isset($_POST['mark'])) { - define('QUESTION_COUNT', 60); //How many questions to ask. + if(isset($_GET['questions'])) { + define('QUESTION_COUNT', intval($_GET['questions'])); + } else { + define('QUESTION_COUNT', 60); + } $questions = Question::getQuestions(QUESTION_COUNT); $total = false; } else { @@ -18,7 +22,7 @@ if(!isset($_POST['mark'])) { } else { $output .= "".$question->getQuestion()."
"; $corAnswer = $question->getCorrectAnswer(); - $output .= "Wrong.
Your Answer: ".$answer->getAnswer()."
Correct Answer: ".$corAnswer->getAnswer().'

'; + $output .= "Your Answer: ".$answer->getAnswer()."
Correct Answer: ".$corAnswer->getAnswer().'

'; $wrong++; } } @@ -41,12 +45,19 @@ if(!isset($_POST['mark'])) {
+ New Exam: 10 Questions + 20 Questions + 30 Questions + 40 Questions + 50 Questions + 60 Questions +

Return to a new set of questions

Score ".(($correct/$total)*100)."% (".$correct."/".$total.")"; echo $output; } else { ?> - 60 Questions + Questions