PHP Classes

PHP Quiz Questions and Answers: Present quizzes using INI configuration files

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 148 All time: 9,108 This week: 89Up
Version License PHP version Categories
quiz 1.0.0Freeware5PHP 5, Games, Content management
Description 

Author

This package can present quizzes using INI configuration files.

It can read a configuration file in the INI format to extract the questions and answers.

The package can also show the quiz questions on a Web page that takes the user's answers.

It can check the user's answers to each quiz question and display if the user picks the current solution on the current page.

It uses PHP session variables to keep track of the number of correct answers in each quiz round.

When the user reaches the last quiz round, the package can display the final quiz results presenting the average score.

Innovation Award
PHP Programming Innovation award nominee
February 2022
Number 4
Quizzes can be a great way to provide entertainment to users of a site. Quizzes can also be a way to teach users about topics of their interest, showing the correct answers to specific questions.

This package can manage quizzes presented on the Web site with questions and answers read from INI configuration files.

This possibility allows site owners to quickly create quizzes by changing configuration files, thus without having to change the site code or using databases.

Manuel Lemos
Picture of Martijn Waeyenbergh
  Performance   Level  
Name: Martijn Waeyenbergh <contact>
Classes: 7 packages by
Country: Belgium Belgium
Age: 44
All time rank: 310117 in Belgium Belgium
Week rank: 44 Up1 in Belgium Belgium Up
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

Example

<?php
   
require_once("class.quiz.php");
    require_once(
"class.quizBoard.php");

   
session_start();

   
$quizBoard = new quizBoard();
   
$quiz = new quiz();

?>
<!DOCTYPE html>
<html>
<head>
    <title>Kwis : <?php echo $quizBoard->beautify($_SESSION['quiz']) ?></title>
    <link rel="stylesheet" type="text/css" href="./css/style.css">
</head>
<body>
    <div class='wrapper'>
        <h1><?= $quizBoard->beautify($_SESSION['quiz']) ?></h1>
        <hr>
        <?php
           
echo $quiz->checkAnswer($_GET['a']);
       
?>
</div>
</body>
</html>


Screenshots (1)  
  • QUIZ1.png
  Files folder image Files (9)  
File Role Description
Files folder imagecss (1 file)
Files folder imagequizes (1 file)
Accessible without login Plain text file answer.php Example Example script
Plain text file class.quiz.php Class Class source
Plain text file class.quizBoard.php Class Class source
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file settings.php Conf. Configuration script
Accessible without login Plain text file start.php Example Example script

  Files folder image Files (9)  /  css  
File Role Description
  Accessible without login Plain text file style.css Data Auxiliary data

  Files folder image Files (9)  /  quizes  
File Role Description
  Accessible without login Plain text file General_knowledge_quiz.ini Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 88%
Total:148
This week:0
All time:9,108
This week:89Up
User Comments (2)
excellent
2 years ago (Alex Alex)
70%StarStarStarStar
excellent
2 years ago (Alex Alex)
70%StarStarStarStar