Yii 2.0: yii2-quiz

Module for creating timed quizzes with pagination
2 followers

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

Features

  • 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.

Demo

Click here for the demo

Requirements

Yii 2.x

Usage

Copy and paste the module in modules folder

Add the module in the modules array:

'modules' => [
      'quiz' => [
    'class' => 'app\modules\quiz\Quiz',
      ]
    ],

Then you can access the quiz through this URL: http://yoursite.com/index.php?r=quiz/site/index

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

Donations are welcome. Thanks for your support!!!

Paypal

Total 2 comments

#20140 report it
oligalma at 2017/10/31 04:18am
Re: please provide the tables for mysql

Hi,

I don't have the MySQL tables but you can export the SQLite ones. I think the MySQL syntax is the same or very close:

CREATE TABLE "tbl_quiz_category" ("id" INTEGER PRIMARY KEY  NOT NULL , "name" VARCHAR NOT NULL );
 
CREATE TABLE "tbl_quiz_question" ("id" INTEGER NOT NULL , "category_id" INTEGER NOT NULL , "title" VARCHAR NOT NULL , "answer" VARCHAR NOT NULL, "answer2" VARCHAR NOT NULL, "answer3" VARCHAR NULL, "answer4" VARCHAR NULL, "answer5" VARCHAR NULL, "answer6" VARCHAR NULL,
primary key("id", "category_id"),
foreign key ("category_id") references 'tbl_quiz_category' ("id") on delete restrict on update cascade
 );

Regards

#20139 report it
asifrafeeq at 2017/10/31 04:08am
please provide the tables for mysql

what are the tables to add in Mysql, please provide the tables for mysql

Leave a comment

Please to leave your comment.

Create extension
Downloads