0

Hi guys,

Hope you're all well. I have managed to get the quiz that I have been working on to work now thank god!

I just want to show just 20 random questions from the 80 questions that I have in the question bank.

Looking at the quiz files I think this is where I need to make the changes
PHP Code:

<?php    

$msg = "";   
if(isset($_GET['msg'])){   
    $msg = $_GET['msg'];   
    $msg = strip_tags($msg);   
    $msg = addslashes($msg);   
}   
?>   
<!doctype html>   
<html lang="en">   
<head>   
<meta charset="utf-8">   
<title>Quiz Tut</title>   
<script>   
function startQuiz(url){   
    window.location = url;   
}   
</script>   
</head>   
<body>   
<?php echo $msg; ?>   
<h3>Click below when you are ready to start the quiz. This is a ramdom quiz so each time you take the quiz the questions will show in a different order each time!</h3>   
<button onClick="startQuiz('quiz.php?question=1')">Click Here To Begin</button>   
</body>   
</html>

I want to show 20 questions at random. I think this is the line of code that I need to do something with.

<button onClick="startQuiz('quiz.php?question=1')">Click Here To Begin</button>  

Any help would be much appreciated

2
Contributors
4
Replies
17
Views
2 Years
Discussion Span
Last Post by stokie-rich
0

This looks a bit screwy. So the quiz depends on sending a question number to a php page. Why are you using javascript at all? If this is a workaround to use a button as a link, you're far better styling a link to look like a button.

0

yes servral times and the person who created the code cannot be contacted. There are a number of people who are wanting to ask the person questions and they cannot get any responses

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.