Author Archives: admin

WatuPRO 6.1

The WordPress quiz plugin WatuPRO has been updated to version 6.1. Here is the list of improvements and fixes:

  • Now the rich text editor is available on all answers of questions without the need to save the question first, all on the same page, in a lot more convenient way than before.
  • Difficulty level can be passed in the quiz shortcode like this: watupro X difficulty_level=”Easy” (where X is the quiz ID). In such case it will override any selection made in the Edit quiz form.
  • You can overwrite the default style.css file by placing a copy of it in your theme folder, under folder called “watupro” (similar to how you can override view files and the main JS file). Note that this should be used only for quite specific adjustments. Most design adjustments are better done by design themes.
  • Now you can have more than one certificate earned by a single test attempt: one regular certificate attached to a grade plus any number of “multiple quiz” certificates as long as taking that specific quiz triggers them because of satisfied requirements.
  • Each certificate allows using custom text for the %%CERTIFICATE%% variable on the final screen. When used will replace the default “You can now print your certificate” text.
  • Multiple quiz certificates can require min. percentage and points for every quiz in the selected group instead of just averages from all attempts. For compatibility with existing setups the old option remains default.
  • The quiz timer support decimals, for example 2.5 minutes.
  • Placing the tag {{{loggedin}}} inside the final screen allows you to show different content to logged in and non-logged in users. The contents before the tag will be shown to the logged in users  and the contents after the tag to the strangers. This lets you for example invite visitors to register to take new quizzes and so on.
  • When user ran out of time in a timed quiz and their results were automatically submitted, this will be shown under “time spent” column on “View results” page.
  • The feature “Hold displaying the results until a date in the future” (available in the Final Screen tab of the Edit quiz page) now allows you to limit this holding period only to chosen user groups or user roles. This way for example you can have immediate results for premium users and delayed results for other users.
  • Added optional log for tests with timer. You can enable it from the Advanced Settings tab of Edit quiz page. Do it only in case you suspect timer problems.
  • You can now allow users to print the final screen as PDF. The option is on Edit Quiz -> Quiz Output tab and requires PDF bridge version 1.4.3 or newer.
  • Added filter for developers which allows you to plug in completely custom grade calculation. More information at https://blog.calendarscripts.info/watupro-developers-api-custom-grade-calculation/
  • Resolved CSS conflict with MathJax on some themes. If you have problems with formulas you need to check the MathJax checkbox on WatuPRO Settings page.
  • Improvements to the category based paginator: highlights the first category at initial loading and properly highlights the category tab when going back to previous question with the Previous button.
  • When a numbered question paginator is used and a question is marked for review the number for that question will get a dashed border.
  • Added attribute “per_page” to the watupro-takings shortcode to specify other than the default 10 results per page. Set it to -1 if you want to display all attempts on a single page.
  • Made improvements to timer handling and logging.
  • Added option to enter your custom “You need to be logged in or registered” text for user-only quizzes along with custom login URL. This allows to integrate better with custom built login and registration pages, use your own image or button etc.
  • Added filter ‘watupro-user-file-uploaded’ before storing user uploaded files as question answers.
  • New parameter added to watupro-takings shortcode: show_contact_data. When set to 1 it will display the additional contact data from the “ask user for contact details” section, when such data is collected. Note that this data will be shown under the name and not in separate columns.
  • Added option to show category title and description on every page when the questions are grouped per category but the pagination is not “one page per question category”. For example this can be very useful for quizzes paginated one page per question.
  • Now you can use your custom social sharing buttons. Set their URLs on the WatuPRO Social Sharing options page.
  • The WatuPRO Options page now has tabs for easier navigation.
  • Added quiz ID filter to the other filters on Manage Quizzes page.
  • Added shortcode watupro-paginator to place the questions or category paginator outside of the quiz shortcode (for custom layouts). More details in the Help page inside your WatuPRO menu.
  • The external paginator shortcode now allows vertical display.
  • Added 25px default space before the “Question X of Y” line and made this configurable in the Settings page -> Theme and Design tab.
  • Made improvements to the responsiveness of the buttons under the quiz. They will flexibly flow on various devices and screen sizes. The legacy buttons table can still be preferred by adjusting a setting in the Theme and Design tab of the WatuPRO Settings page.
  • Added subcategories to quiz categories for better organization.
  • [Intelligence module] Added option to replace user entered multiple spaces in “Fill the gaps” questions with single space to ignore basic typing errors. The option is in the Advanced Settings tab of the Edit quiz page.
  • [Intelligence module] Added optional attributes for the bundle buttons that allow you to display text with dynamic price above each button. You can find information about the attributes on the Manage Quiz Bundles page under the table with bundles.
  • [Intelligence module] New option in personality quizzes allows you to have only one personality assigned as a result even if multiple personalities collect equal maximal number of points. If you select the option, one of the matching personality will be randomly selected.
  • Added more space between question choices on small screens to avoid clickable elements being too close together on the screen. This can be changed in the Design Adjustments section of the WatuPRO Settings page.
  • Fixed issues with %%ANSWERS-PAGINATED%% variable: an un-closed div and not showing uploaded files for questions that accept them.
  • Fixed bug: {{{ID}}} variable was not replaced in “table view” of the View Details popup.
  • Fixed issues with FB sharing, used the new SDK because the old dialog is no longer supported properly by FB.
  • Fixed CSS issue with prev/next buttons showing one under the other on mobile devices.
  • Fixed bug: “details_no_popup” attribute did not work in watupro-myxeams shortcode.
  • Fixed bug: when “0” was entered as possible correct answer on an open-end question it was not recognized as correct.
  • Fixed bug: after introducing decimals in timer the option to let user choose questions did not work.
  • [Intelligence module] Fixed bug with saving custom currency on the Payment Settings page.
  • Fixed bugs with saving Facebook sharing options.

Myers-Briggs Tests in WatuPRO

This tutorial will show you how to create Myers-Briggs personality quizzes in WatuPRO. It covers the technical side of things and not the psychological side – we won’t be showing what specific questions you have to ask to create such tests. This example will be about creating a “Keirsey temperaments” tests but it can be used for any other kind of Myers-Briggs type of quiz.

If you prefer a video, here you go:

Still we recommend reading the post below for more details.

Step 1: It Does Not Need To Be Marked as a Personality Quiz

I know it may sound confusing, but because Myers-Briggs is a very specific type of test, it’s actually easier to be created as a “knowledge” test where answers get points assigned to them and do not directly assign a personality type. So you don’t need to select the following setting:

No need to select that this is a personality quiz

Leave it unchecked.

Step 2: Create Question Categories

Because Myers-Briggs tests rank the respondent into multiple categories, you need to create them as question categories in the system. Using the classic example, there are four categories: Extraversion/Introversion, Sensing/Intuition, Thinking/Feeling, and Judging/Perceiving:

Create question categories

There is no need to create question sub-categories.

Step 3: Create Your Questions

It’s up to you how many questions you are going to ask and how many points you’ll assign to each of the answers. Typically these tests have mostly single-answer questions but it’s also very common to use “from-to” sliders and likert scales.

What is important here is:

  • Each of your questions should belong to one of the four categories. If it’s a question showing how introvert is the quiz taker then it goes to Extraversion/Introversion category. If it’s about sensitivity it goes in the Sensing/Intuition category and so on.
  • Decide how you will assign the points. For example if you have 10 questions in each category and each question gives from 0 to 10 points depending on the answer, this means the user cat collect between 0 and 100 points in each category. This is important for the next step where you’ll define the grading.
  • You need to follow some logic: for example if the answer means the user is more inrovert you may want to give more points to that answer. Follow this logic on all questions so at the end more than half of the possible points collected will mean the user is more extrovert than introvert. Similarly do in the other categories.

Step 4: Create Your Grades (Personality Types)

This classical type of Myers-Briggs test has 16 possible combinations of user’s performance in each category, so it has 16 personality types (see here): ISTJ, ISFJ, INFJ, INTJ, ISTP, ISFP, INFP, INTP, ESTP, ESFP, ENFP, ENTP, ESTJ, ESFJ, ENFJ, ENTJ.

So, you need to create 16 grades or personality types for this test. Here’s the most important part: you need the option “The final grade in this quiz will depend on the performance on different question categories” selected:

Select that final grade will depend on category performance

This will allow you, for every single result, to define the ranges of points that the user needs to collect in order to fall into it. So if we go back to our example with 0 to 100 points possible in each question category, we’ll then know that between 0 and 50 puts the respondent in the first group for that category (which in Extraversion/Introversion would mean he’s an extravert) and 51 to 100 points puts the user into the other group (inroverts). Knowing this for every of the 4 categories, we are able to define the exact criteria for each “grade”:

ISTJ example

ISTJ example

The above example is ISTJ: more points going to Introvert, all other categories got less point which put the user into the first group of each. Please note it’s up to you how many points can be in category and how the points put the user into one of the two groups, but it’s important to follow the same logic in all questions.

Here’s an ESFP example:

ESFP example

ESFP example

Here the user ranks as extrovert, perceiving, sensing and feeling. Note that the system will show you the categories in alphabetical order, not in the order of Myers-Briggs tests so be careful how you enter the point ranges.

Step 5: Display Quiz Results

Because these tests are specific you will most likely not want to show points, % correct answers, etc standard texts at the end of the quiz. You’ll most likely want to show only the achieved result. So go to Edit Quiz -> Final Page / Quiz Result and edit the default content to something like this:

editing the quiz output

This is probably all you want to display. If for some reason you want to include also the %%ANSWERS%% variable to show how the user answered each question, you will not want to show correct / incorrect checkmarks because such quiz has no correct or wrong answers. So go to Edit Quiz page -> Advanced Settings tab and select to hide them:

hide correct / incorrect checkmarks

That’s it, now your Myers-Briggs test needs only to be published.

WatuPRO Developer’s API: Custom Grade Calculation

From version 6.0.4 WatuPro has a filter that allows plugging in your own custom grade calculation that replaces the built-in calculation. This can be useful in very specific quizzes where the grade is calculated in a non-standard way and cannot be handled by the existing functions.

This filter is a bit more complicated to explain hence we have created a separate post for it. If you are looking for the general developer’s API guide it’s here.

Using the filter:

You need to add the filter in the following way:

add_filter('watupro_calculate_grade', 'your_callback_function', 10, 8);

As you can see the filter needs 8 arguments. Here is how your callback function should be structured, with explanation of all arguments:

function your_callback_function($return_arr, $taking_id, $exam_id, $points, $percent, $cat_id, $user_grade_ids, $points_percent) {
   // expand $return_arr in the 4 constructing variables if you need:
   list($grade_text, $certificate_id, $redirect_url, $grade_object) = $return_arr;

   // your custom calculation here which may modify each of the 4 $return_arr elements
   // ...

   // return array of 4 elements
   return array($grade_text, $certificate_id, $redirect_url, $grade_object);
}

 

Attributes / Arguments

Here are the attributes in detail:

$return_arr is an array of 4 variables: $grade_text is the human-readable grade or personality type returned from the test (title and description); $certificate_id is ID of the assigned certificate, if any, otherwise 0; $redirect_url is optional URL where the user should be redirected to at the end of quiz, or false if no redirect; $grade_object is the grade as DB object returned from the wp_watupro_grades table. You can construct it yourself with the minimum required properties: “title” and “description”.

$taking_id is the ID from the watupro_taken_exams table which corresponds to this quiz attempt. VERY IMPORTANT: at the time of grade calculation the $taking_id already exists however the full details are not yet populated in watupro_taken_exams table. That’s why we pass points, percent correct, etc. as additional variables. The purpose of passing $taking_id is that it allows you to access all the individual answers from wp_watupro_student_answers table in your custom grade calculator, should you need so. Example query:

$answers = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".WATUPRO_STUDENT_ANSWERS." WHERE taking_id=%d ORDER BY ID", $taking_id));

$exam_id is the ID of the test / quiz.

$points is the number of points collected. If $cat_id is 0, then $points are the total points collected on the attempt. If $cat_id is not 0, then $points is the number of points collected for that specific category ID.

$percent is the % correct answers collected. If $cat_id is 0, then $percent is the % correct answers on the whole attempt. If $cat_id is no 0, then $percent is the % correct answers for that specific category ID.

$cat_id is the ID of the category for which the grade is calculated. When 0 this means we are calculating the grade / result for the test attempt. When not 0 we are calculating grade for that specific category and you should return grade for that specific category, or none.

$user_grade_ids is used only on personality tests. It contains array with IDs of the personality types in a specific format.

$points_percent contains the percent of maximum points on this quiz attempt. If $cat_id is not 0, then it’s the percent of maximum points for that category ID.

Your custom function should always return an array of 4 elements as explained in $return_arr above – changed or unchanged. Be very careful not to mess the order of variables as you won’t be getting the expected result.