Category Archives: Uncategorized

Watu, WatuPRO and MemberPress – Solution To an Issue

We’ve been very happy to have our plugin recommended by MemberPress. They have a great membership plugin there.

Unfortunately there is currently a problem that when the Watu or WatuPRO shortcode is placed inside their pages, our scripts and CSS are missing and the quizzes don’t work. While we are trying to get in touch with the folks at MemberPress to have this issue resolved together, there is a solution which will do the work:

Go to your plugin editor (or use FTP if you prefer), find MemberPress Courses and open the file:

app/views/classroom/courses_footer.php

Add the following code before the closing </body> tag:

<?php wp_footer(); ?>

That’s all! Save and you’ll have the quizzes working again.

Cross Tabulation Analysis in WatuPRO Reporting Module

The quiz and survey plugin WatuPRO is starting to get into data science. Here’s one of the most useful features you will not see in many others, if any, survey and quiz plugins: cross tabulation analysis.

If you would like to learn more, I recommend you to visit this page.

This feature is available from WatuPRO (with the Reporting Module installed) version 6.5.1.5. Go to “View results” page on any test and you will see “Cross Tabulation” link on top along the other links. Clicking on it will take you to a page where all single-answer and multiple-answer questions are available to cross-reference. Let’s see how this looks with our very simple 3 questions survey:

We have asked the respondents 3 questions: gender, location and what they are interested in. For the last question they could choose more than one answer.

Cross tabulation lets us intersect any two questions in the survey and can give us super useful insights. In the above simple example we can see how many users from each location are interesting in each of our offerings.

Note: the row total for Africa seems wrong? Nope, it’s correct. Our two respondents from Africa have selected both premium content and one on one coaching. So indeed there are only two respondents from this region.

You can see the same analysis by gender:

Cross tabulation analysis with gender as stub / leading question

And again it may look like the row total for females in incorrect, but no, it isn’t. There are two female respondents but they have selected more than one answer.

The cross tabulation analysis can be turned any way, for example to have the offerings at left:Reversed cross tabulation example

Its the same data but makes the table a bit more compact. This is entirely a matter of preference.

Every table that you generate can be published on the front-end using the shortcode shown under it:The table shortcode

You may want to exclude our CSS if it doesn’t look good on the front-end, and apply your own or just let it follow the standard table CSS defined by your theme.

Note that depending on the size of this data calculating cross table analysis could be resource intensive. While this won’t be a problem on the back-end where only you and maybe a handful of mates are looking, it could be a problem if you use the shortcode on a popular blog post. For this reason we recommend caching the pages that contain the cross-table shortcode.

And that’s just the beginning of turning WatuPRO into a super valuiable tool for surveys and data analysis. So stay tuned for what’s to come.

UI Customization Snippets for WatuPRO

This post will contain some free JavaScript code snippets that you can use to customize the default behavior of the quiz plugin WatuPRO.  The snippets can be placed in your theme functions, in the footer of your theme, or (easiest) using a plugin like Insert Headers and Footers.

Each snippet is coded to work on its own. Two or more snippets used at the same time may or may not work together.

Available snippets:

Right-click on an answer to strike-through

Selecting a radio button disables the others

Show only user first name in WatuPRO Play leaderboards

Right-click on an answer to strike-through

This helps the user to visually strike-through an answer to mark it wrong for their own note. The state is non-persistent and will be lost of the page is refreshed. Left click on an answer removes the strike-though and makes it selected just like the normal behavior is.

<script>
jQuery( "label.answer span" ).contextmenu(function(ev) {
  console.log(jQuery(this));
  jQuery(this).css({"text-decoration": "line-through", "font-style": "italic"});
  return false;
});

jQuery( "label.answer span" ).on('click', function() {
   jQuery(this).css({"text-decoration": "none", "font-style": "normal"});
});
</script>

Selecting a radio button disables the others

This snippets make clicking on a radio button in a “Single choice” question exclusive to all other answers – the user can no longer change their answer once they have clicked. The state is non-persistent and will be cleared after page refresh.

<script>
jQuery("input[type=radio].answer").click(function() {
   var classList = jQuery(this).attr('class').split(/\s+/);
   var thisID = jQuery(this).attr('id');
   jQuery.each(classList, function(index, item) {     
    if (item.indexOf('answerof-') != -1) {
        jQuery('.'+item).not('#'+thisID).attr("disabled", true);
    }
  });
});
</script>

Show only user first name in WatuPRO Play leaderboards

This can be used in case you don’t want user’s full “display name” shown in the leaderboard.

<script>
jQuery('.watupro-leaderboard tr:not(.current_user) td.display_name').each(function(i, elt){
 var parts = elt.innerHTML.split(' ');
  elt.innerHTML = parts[0] + ' ' + parts[1];
});
</script>