Responsive Quiz Application Using PHP, MySQL, jQuery, Ajax and Twitter Bootstrap Part-3

In this tutorial I made few changes in the Responsive Quiz Application Using PHP, MySQL, jQuery, Ajax and Twitter Bootstrap based on the request from users.

Before continuing this tutorial please refer my previous tutorials on this Responsive Quiz Application Using PHP, MySQL, jQuery, Ajax and Twitter Bootstrap.

1.  Responsive Quiz Application Using PHP, MySQL, jQuery, Ajax and Twitter Bootstrap

2. Responsive Quiz Application Using PHP, MySQL, jQuery, Ajax and Twitter Bootstrap Part-2

Now user can able select number of questions to be showed on each pages.

Responsive Quiz Application Using PHP, MySQL, jQuery, Ajax and Twitter Bootstrap - 3

Demo

Responsive Quiz Application Using PHP, MySQL, jQuery, Ajax and Twitter Bootstrap - 3

Responsive Quiz Application Using PHP, MySQL, jQuery, Ajax and Twitter Bootstrap – 3

Step 1:

where

$number_question — set number of questions to be showed on each pages.

I am selecting quiz questions from particular category that the user choosed, then finding number questions in the result of mysqli_query() finally stored questions count in  $rowcount variable. Finally finding the remainder by dividing $rowcount  with $number_question (number of question to be showed on each page.)

Responsive Quiz Application Using PHP, MySQL, jQuery, Ajax and Twitter Bootstrap 3

Download

Step 2:

For example if I am going to show two questions on each page, if user choose category that contains only one question then I need to show that one question with finish button to complete quiz.

If $remainder<1 that means number  questions less than number questions to be showed on each page, so I need to complete quiz with finish button.

if number questions goes greater than number questions to be showed on each page then following logic will come into play.

Posted by:

muni

9 Comments

  1. Joe Koder -  January 22, 2014 - 12:56 am

    Glad to see you updated the code to Mysqli. One problem you might want to address: Every time a user reloads the page the quiz/timer resets.

    Reply
    • muni -  January 22, 2014 - 1:55 am

      Thank you foy your valuable comment Joe..

      Many Thanks,

      muni

      Reply
    • Vitor Sousa -  February 8, 2014 - 9:36 pm

      Hi i got the files that i want, but when user wants to repeat the quiz it takes him to index and if he wants to repeat several times he needs to enter his name.. and i dont know how to fix it…

      Anyone can help?

      thanks

      Reply
      • muni -  February 9, 2014 - 3:06 am

        Hi Victor,

        If user enters his/her name first time those value saved in session, once he finished quiz then he want take quiz all need to do is just press start a quiz button it brings him to index page, where he only he need to choose category quiz he had choosen… No need to re-enter his name again.

        Many Thanks,

        muni

        Reply
  2. swang -  January 28, 2014 - 9:31 am

    You did an amazing tutorial Muni ! you save my day many thanks guy

    Reply
  3. Vitor Sousa -  February 8, 2014 - 9:33 am

    i i subscribded, but i still cant download de files…

    Is any problem with that?

    So you catched my e-mail adress and…

    Thank you

    Reply
  4. Jihed -  March 18, 2014 - 4:50 pm

    How can I set the counter to each question?

    Reply
  5. Keerthi -  March 31, 2014 - 6:05 am

    i want random questions each time when i refresh :( i want that source code :(

    Reply
  6. Quocuy -  July 5, 2014 - 10:01 pm

    Please create some sub categories for each category. For example, first, user can choose class 6,7,8,9. Next user can choose courses: math, history, english. In math, user can choose chapter 1,2,3… Thank you!

    Reply

Leave A Comment

Your email address will not be published. Required fields are marked (required):

Related articles

Back to Top