Custom Hook: WP Pro Quiz Plugin

Home / Code Snippets / Custom Hook: WP Pro Quiz Plugin

Custom myCRED Hook allowing you to award / deduct points from users when they complete a quiz via the WP Pro Quiz Plugin. Requires myCRED 1.5.3 or higher.

The above code snippet goes into your theme's functions.php file.

Last edited October 20, 2014

  1. I have created a quiz in my website ,
    1) if any one clicked on next question or back in quiz the page has to reload ( it means i need an impression if someone clicked on those options ).
    2) How to put my ads in quiz section
    3) I would like to provide negative marking for my quiz such a

    (100 questions, 200 marks, 2 marks per question ) : Attempted – 100 , Correct – 80, Incorrect – 20
    Correct answers 80 x 2 = 160 marks

    Deduction: (1 wrong answer x 0.33% marks) so for 1 wrong answer = 0.66 marks (R) marks. So for 20 wrong answers : 20 x 0.66 = 13.2 marks to be deducted from 160.

    Final Score for Paper 1 : 160 – 13.2 = 146.8

    I dont know even basic coding please provide step by step instructions.

  2. Hi Gabriel,

    shall i know where this negative marks option will be viewed in Admin side ?

    Where i need to give negative marks for questions ?

    I need to give negative marks only for few questions in quiz program. How i do that ?

    Thanks In Advance

    Thanks,
    Kalpana

  3. when i try and set the hook to do a negative number it wont work, just goes back to 1 when i try to save… i only want to give one point out for 100% completed quiz.

    also where would put a check to check the time? i want them only doing a quiz say every 2 hours

    1. i see the issue is your code here is @version 1.3

      and the download i found is Version: 1.0.1… where can we get the update plugin?

    2. Hey. I have updated the code to fix the issue. The issue is in the hook class so just replace the “WP-Pro-Quiz Hook Class” which is now version 1.0.1
      The version numbers you see is for each individual function.

    3. The hook has no “time setting”. It gives points when you complete a quiz and when you complete a quiz with 100% rate. It will give points until you hit your limit. The hook rewards an event so how often that event can occur or how often you can do a task that leads up to the event (completing a quiz) is controlled by the WP Pro Quiz Plugin. If a user can take the same course over and over, then the user will receive points over and over until the hook limit is reached (if you set one).

Leave a Reply