True or false. Ashoka…
True or false. Ashoka allowed religious freedom to all people in his empire.
(1, 'Parent constructors are not called implicitly if the child class defines a constructor.', 1), (2, 'Interface constant can be override in class implementing the interface.', 0), (3, 'Static methods can be call with class name and colon operator, $this is not available inside the method declared as static.', 1), (4, 'Static properties can be accessed through the object using the arrow operator ->.', 0), (5, 'If parent class has Final method abc(). Method abc() can be overridden in child class.', 0), (6, 'In PHP, a class can be inherited from one base class and with multiple base classes.', 0), (7, 'To create instance of class \"new\" keyword is not required.', 0), (8, '$this is a reference to the calling object', 1), (9, 'The variable name is case-sensitive in PHP.', 1), (10, 'PHP is an open source software', 1);
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Simple True or False Quiz Generator</title> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <div class="container"> <h1 class="page-header text-center">Simple True or False Quiz Generator</h1> <div class="row"> <div class="col-md-6 col-md-offset-3"> <form method="POST" action="check_answer.php"> <?php $iterate = 1; $conn = new mysqli('localhost', 'root', '', 'quiz'); //this will arrange the questions randomly and 10 only $sql = "SELECT * FROM truefalse ORDER BY rand() LIMIT 10"; $query = $conn->query($sql); while($row = $query->fetch_array()){ ?> <div> <input type="hidden" value="<?php echo $row['questionid']; ?>||<?php echo $iterate; ?>" name="questionid[]"> <p><?php echo $iterate; ?>. <?php echo $row['question']; ?></p> <input type="radio" name="answer_<?php echo $iterate; ?>" value="1"> True <input type="radio" name="answer_<?php echo $iterate; ?>" value="0"> False </div><br> <?php $iterate++; } ?> <button type="submit" class="btn btn-primary">Save</button> <br><br> </form> </div> </div> </div> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Simple True or False Quiz Generator</title> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <div class="container"> <h1 class="page-header text-center">Simple True or False Quiz Generator</h1> <div class="row"> <div class="col-md-6 col-md-offset-3"> <?php $conn = new mysqli('localhost', 'root', '', 'quiz'); $score = 0; foreach($_POST['questionid'] as $question): $questionid = $info[0]; $iterate = $info[1]; $sql = "SELECT * FROM truefalse WHERE questionid = '$questionid'"; $query = $conn->query($sql); $row = $query->fetch_array(); ?> <div> <p><?php echo $iterate; ?>. <?php echo $row['question']; ?></p> <p>Correct Answer: <?php if($row['answer']==1){ echo 'True';} else{ echo 'False';} ?></p> <?php ?> You Answered: <?php if($_POST['answer_'.$iterate] == 1){echo 'True';} else{echo 'False';} ?><br> <?php if ($_POST['answer_'.$iterate] == $row['answer']){ echo '<span class="glyphicon glyphicon-check"></span> Correct<br><br>'; $score = $score + 1; } else{ echo '<span class="glyphicon glyphicon-remove"></span> Wrong<br><br>'; } } ?> </div> <?php endforeach; ?> <h2>Score: <?php echo $score; ?></h2> </div> </div> </div> </body> </html>