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.

User Registration / Login and WatuPRO

This post has the goal to answer one of the often asked questions – can you have WatuPRO tie quiz attempts to user accounts? The short answer is yes, of course.

Here are more details:

How Does It Work

It’s very easy. In Edit Quiz -> User and Email Related Settings tab you need to select “Require user login”:

A lot of new options appear when you select this but they are not related to user registration itself.

So, once you select this the quiz will not be accessible to users without accounts. If you want to allow users to register themselves make sure the following option on your General WordPress Settings page (not a WatuPRO page!) is selected:

If you don’t want users to register themselves, you need this to be unchecked.

What’s important to understand is that WatuPRO uses the underlying WordPress user login and registration system rather than inventing its own. This has a lot of advantages, with the main one being that any plugins you use to customize user registration and profile pages will affect WatuPRO as well.

About Emails Sent on Registration

Emails that are sent at the time of user registration are controlled by WordPress, not by WatuPRO. If you want to change the email contents you can do it with various other plugins. For example, see this tutorial.

About Customized User Profiles

If you have customized the user profiles with other plugin or theme, or with your custom code, this should also work fine with WatuPRO. However before rushing to install a custom profile plugin just because you want to collect some contact information along with the quiz, check the option “Ask user for contact details” which we provide at Edit Quiz -> User and Email Related Settings tab:

 

About Integration With Membership and Other Plugins

Because WatuPRO uses the built-in WordPress user management system, integration with any other plugins which do so is seamless. Fortunately almost all membership plugins and other plugins dealing with user profile use it as well instead of investing their own. This is the beauty of WordPress.

Please have in mind integration does not mean WatuPro will automatically show custom profile fields somewhere in the quizzes or that other plugins will automatically show WatuPro stats on user profile pages. It means just that any changes that other plugins do to user profile affect the same users that take quizzes.