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 ¶
https://yiidemos.oligalma.com/quiz
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: www.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!!!
please provide the tables for mysql
what are the tables to add in Mysql,
please provide the tables for mysql
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
How to use this in my website?
Hello @arunwebber,
This extension is a module. It doesn't use Composer. You just need to copy the "quiz" folder inside the "modules" folder of your Yii 2 installation. Then, you add the following code to the "modules" array, inside the config/web.php file (basic installation).
'modules' => [ 'quiz' => [ 'class' => 'app\modules\quiz\Quiz', ] ],
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.