Yii 1.1: yii-quiz

Module for creating timed quizzes with pagination

Module that allows you to create timed quizzes with pagination. If you get a passing score you can download a diploma.


Click here for the demo


  • Questions and answers appear randomly.
  • Up to 6 answers (may be extended if needed).
  • Questions and answers are stored in a SQLite database.
  • Diploma is generated using FPDF.
  • Questions belong to categories. You can create as many categories as you want.




Copy and paste the module in protected/modules

Add the module in the modules array of protected/config/main.php:


You can add these rules in the Url Manager:

     'quiz'=> 'quiz/site/index',
     'quiz/<category:\d+>'=> 'quiz/site/start',

Then you can access the quiz through this URL: http://yoursite.com/quiz

If you want you can adjust parameters in modules/quiz/controllers/SiteController.php:

const SECONDS_PER_QUESTION = 10; // false to disable the countdown.
const PAGE_SIZE = 5; // false for all questions in one page.
const MINIMUM_SCORE = 90; // false to disable diploma.
const QUESTIONS_NUMBER = false; // false for all questions.


Donations are welcome. Thanks for your support!!!


Total 2 comments

#20136 report it
oligalma at 2017/10/24 11:41am
Re: Paging

Thanks for the tip, meowth! The problem has been fixed.

#20135 report it
meowth at 2017/10/24 06:02am

In Yii1, the default coding on protected/views/layouts/main.php has:

<div class="container" id="page">

While in this extension it use:

function submitForm(obj) {
  var href = $(obj).find('a').attr('href');
  var pos = href.indexOf('page');
  var page = 1;
  if(pos > 0)
    page = href.substring(pos + 5);
  $('#page').val(page); // This part

I think the duplicate page ID cause problem in paging. The submit form cannot fill

<?= CHtml::hiddenField('page', '1'); ?>

I suggest to change the ID to something else.

Leave a comment

Please to leave your comment.

Create extension