Category Archives: CalendarScripts

WatuPRO Hooks Reference & Developers API

As WatuPRO is growing we see the need of many customers to enhance and customize it. We do provide some customization services but can’t handle all of the requests. Besides, we wanted to allow third party developers and companies to extend WatuPRO and add more functionality to it. So here is the first version of the developers API. Please consider this page work in progress, as is the API itself. We are starting with just a few basic function calls. More will be added and documented with the time. For simplicity the API itself will use the same version number as the plugin.

WatuPRO API Version 3.6

Main Concept

WatuPRO API uses WordPress do_action calls to create custom actions. This means that in order to add custom functionality you need to use add_action() to call your custom functions. Any custom parameters passed to do_action will be shown below.

Barebone Custom Plugin

We have created a “barebone” custom plugin that will help you with the initial setup for your custom work. Download the plugin here: watupro-custom

Available actions

do_action(‘watupro_completed_exam’, $taking_id) – called when test is completed. Passes the current completed exam record ID.

do_action(‘watupro_completed_exam_edited’, $taking_id) – called when admin/teacher edits user’s details. This option is enabled by the “Manual grading” feature in the Intelligence module. Passes the ID of the taken exam record.

do_action(‘watupro_my_certificates’) – this call is at the bottom of the “My certificates” page. The action passes no parameters but you can get the current user ID as a global. This action is already used by the Play Plugin.

do_action(‘watupro_select_show_exam’, $exam) – called when displaying the exam on the screen, and prior to any permission checks. Passes the exam object and allows you to do something with it.

do_action(‘watupro_admin_menu’) – lets you hook a custom page under watupro admin menu. Use ‘watupro_exams’ as parent.

do_action(‘watupro_user_menu’) – lets you hook a custom page under watupro user dashboard menu. Use ‘my_watupro_exams’ as parent.

do_action(‘watupro_show_exam_js’, $exam) – lets you plug your custom javascript in the quiz itself. Passes the $exam object.

Available Filters

We have started adding some filters too:

apply_filters( ‘watupro_filter_view_show_exam’, $show_exam_view, $exam); – called right before showing the quiz. You can use it to load your custom show_exam view. We recommend to still include our view (views/show_exam.php) and use it only to do something before or after it.

apply_filters( ‘watu_filter_current_question_text’, $current_text, $qct, $question_content, $correct ) – called after a question has been processed so you can modify the way it’s displayed on the final screen and live result.

The following filters allow you to modify the content of the emails sent to admin or quiz taker when a quiz is completed:

$output = apply_filters(‘watupro-email-results-taker’, $output, $taking_id);

$output = apply_filters(‘watupro-email-results-admin’, $output, $taking_id);

The following filter allows you to modify the content of user uploaded files:

$contents = apply_filters(‘watupro-user-file-uploaded’, $contents, $question_id, $detail_id, $taking_id);

$achieved = apply_filters(‘watupro-achieved-points’, $achieved, $taking_id); – allows third party plugins to modify number of points

The following filter is applied on calculating quiz grade:

watupro_calculate_grade -it’s more complicated so it’s documented separately here.

Expect a lot more actions to be added in the next versions of Watu PRO.

WatuPRO 3.5

This update solved some really hard problems and added several features that some customers eagerly waited for.
Here you are:

  1. Improved import/export that will let you copy exams to different blogs
  2. Show answers immediately – this button can be activated for tests that are paginated one question per page.
  3. Shortcode for a basic leaderboard of best performing users
  4. Grade on a category level. Now you can grade the users and display their performance for each question category.
  5. Resolved conflict with Paid Membership PRO so finally you can use this plugin with WatuPRO.

As usual, existing members who purchased it less than one year ago will get the upgrade for free with the newsletter. If you have bought more than 1 year ago, you can restart the 1 year loop with paying just 40% of the current version prices.

WatuPRO 3.4 With Updates in Intelligence and Reporting Modules

This is an important update to WatuPRO addressing some customer requests. Here are the news:

  • Email shows in taking details for everyone who provided it (logged in or not)
  • Cumulative per-question stats (in Reporting module) which make WautPRO even more suitable for surveys
  • Improvements to how the timer works
  • Description for a question category (optional). If you enter it, the description will be displayed when the test questions are grouped and paginated by category.
  • More flexible control over the calculation logic of correct/incorrect questions (for multiple-choices and “fill the gaps” questions). You can now decide whether all answers should be correct or only one, to consider the whole question correctly answered.
  • Practice mode now respects the selections you make about ordering and grouping questions (it used to just randomize them)
  • Manually edit/grade already taken exam (available in Intelligence module). You will be able to change the results and the grade, percentage and possible certificate assignment will be recalculated. Email can be sent to the user with the new details.

That’s it in 3.4.

Thanks for being with us!