Tag Archives: watupro

WatuPRO Front-End Troubleshooting Guide

This guide is going to help you to resolve any of the following issues that you may encounter using WatuPRO (and not only these):

  • Submit button, next button, start button, or any other button does not work
  • Quiz does not load at all
  • Some question type (usually match/matrix, sortable or slider) does not work

These problems are usually caused by offending code (learn more) on your web page and can be resolved by disabling it. Of course, if you don’t feel comfortable deactivating plugins you can contact us for support (in which case you must provide us URL to see the problem!)* but tech-savvy users can quickly resolve these problems themselves.

If you are using “optimization” plugins that “minify” JavaScript and HTML code on your pages, disable this feature, clean up your browser cache, and check again. Cloudflare may also have minified our JS. These plugins very often cause fatal JavaScript errors because of improper minification. Do this first before trying anything else. You should not use code minification. It doesn’t provide any significant benefit but causes lots of trouble. Do not.

Caching pages with quizzes can cause a lot of problems with the timer, randomization, and paid quizzes. Do not cache pages that have such quizzes. The first thing to check when having problems with such quizzes are your caching and optimization plugins.

It’s fine to use caching on quizzes that do not use randomization, or timer, and are not paid. Make sure to purge the cache when you change the quiz settings as most cache plugins detect changes in posts but not in quizzes.

Step By Step Guide To Resolving

0. If you are familiar with JavaScript you can go to step 3 first.

1. Change your site theme to some of the default WP themes. Yes, I know you like your theme 🙂 This won’t be permanent, just change it for a minute for this step. Reload the page with the quiz. Problems solved? Then they are most likely caused by bad JavaScript in the theme. You need to contact the theme designer or developer to fix their offending code. If they are not responsive we will try to help you instead but please don’t forget it’s not our job, we are also busy and not very keen on doing someone else’s job. Problem not solved? Then switch back to your theme and go to step 2.

2. Deactivate all plugins except WatuPRO. Yes, I know you need most of them. This is temporary. Refresh the page with the quiz. Problem solved? I bet it is. Now let’s see which is the offender. Start re-activating the plugins. Activate one, refresh the page and see. Problem re-appeared? You just found the offender. It was the plugin that you just activated. That’s it, now you should either remove it or let its author know they are causing fatal javascript errors.

That’s all you need to do. If you need help feel free to contact us. The next step is for tech-savvy users only. At the end of this post you will learn why such problems happen and can’t be prevented from our end.

3. If you know what a JavaScript error is you may want to have a quick look at the Firefox error console yourself. Open the page with the quiz in Firefox and press ctrl + shift + K to open the console. See if there is an obvious fatal JS error and whether it helps you understand which plugin (or the theme) is causing it.

What is an Offending Code?

WordPress is a wild space with thousands of competent and not-so-competent developers creating plugins and themes for it. Unfortunately, the WordPress staff cannot test all aspects of all plugins so a lot of buggy code is available for download.

The problem is that a web page is a whole. JavaScript and CSS are shared between all the components of the page. So once a bad code (especially JavaScript code) causes a fatal error on the page it very often breaks all other scripts on it even if they are properly coded. This is usually not intentional but a result of poor testing, but nevertheless the effect is the same.

Scripts that are causing such errors are called offenders and should be fixed or removed. The properly coded scripts cannot do much to prevent offenders from messing up the page. They cannot fix the problem in the offender.

So is Your Plugin Incompatible with my Theme / Plugins?

No, things don’t work this way. It’s not the properly coded plugin which is incompatible. It’s the offender that is causing the other plugins to not work properly.

If you have a problem with the offending code we can try to help you but we give no guarantee and will take no liability for other developer’s errors.

But My Site Was Working Fine!

The offending code won’t necessarily break everything on your site. It’s usually JavaScript code and breaks complicated interactive JavaScript-based apps such as WatuPRO.

What if WatuPRO is the Offender?

This is unlikely although not entirely impossible. If other functions on your site stopped working correctly after activating WatuPRO please contact us and send us a live URL to have a look.

*Before Contacting Support

If you can’t resolve the issues yourself you can contact us for help. Please note that you MUST provide us URL where we can see the problem. We can not resolve your problem if you don’t send us URL. No screenshots, no vague explanations – we need a live URL where the problem can be seen.

Basic Math Based On User Answers in WatuPRO

A new shortcode in WatuPRO (from version 5.6.2.1) lets you perform basic math on two of the user’s answers. This shortcode should be used only in the “Final screen” of a test.

Here is the shortcode with all its possible parameters:

[watupro-calculator math=”152+256″ output=”1″ var=”my_var”]

Attributes:

  • math (required) shows the math you want to perform. Note that the numbers in the formula are question IDs and not actual numbers. I.e. you are not telling the shortcode to add 152 and 256, that would be pointless. You are telling the shortcode to add the answer to question with ID 152 to the answer of 256. It assumes answers are numeric and will work properly on numeric answers – i.e. it’s good for single-choice or open-end questions.
    The math can contain expression of 2 questions only with any of the four standard math operations: +, -, /, *.
  • output (optional) defines whether the result will be shown on the screen. The patameter defaults to 1 which means result will be shown. It makes sense to set it to 0 (don’t show) only if you are going to get the result in a variable for next shortcode usage on the same final screen.
  • var (optional) is a variable name where to assign the result for next shortcode usage. Use only letters and underscore.

To make the whole thing above clearer and simpler, let’s make an example.

Example:

Let’s pretend to make a simple investment calculator without compounding. We will ask the user for their current savings, the yearly interest (expressed as decimal and NOT percentage) and how many years they want to save.

Here are our questions:

Here is how the shortcode is used in the Final screen:

Here is the example input:

And here is the result:

We took the multiplication of answers to Question 1 (with ID 901) and Question 2 (with ID 902) and put it into variable called “yearly”.

Then we took the yearly interest from the variable and multiplied it by the number of years (question 3 with ID 903) to get the total accumulated simple interest. We also placed this result in the variable total_interest.

Finally we added the answer to Question 1 with ID 901 to the variable total_interest to get the final result.

Test Grade Based on Question Category Performance [WatuPRO]

From version 5.5.8 the quiz/survey plugin WatuPRO supports yet another interesting option for grading the user’s performance: a grade based on the performance in each question category /  theme.

What Does It Mean?

This is different than showing grade/performance per category. It’s a method to grade the whole test (and typically determine whether it’s passed or failed) based on how the user did in the different topics in the test.

For example for a traffic law test you may have a “Passed” grade with the following requirements:

For category “General rules” require at least 90% correct answers.
For category “Street Signs” require between 80% and 100% correct answers.
For category “Priority” require between 70% and 100% correct answers.

On top of this you can also set a general requirement for the test, for example min. 85% correct answers on average for all categories.

The requirements can be based on points, percent correct answer, or percentage points achieved from the maximum points possible in the test.

How Does It Work?

  1. Go to the Grades or Manage Grades page for a selected quiz. Make sure “Manage grades / results for the [Whole test]” is selected and check the option “The final grade in this test will depend on the performance on different question categories” as shown below:
  2. The page will refresh and will show you the grade forms for adding or editing grades with new options – from/to fields for each question category (topic) that contains questions in the selected quiz:
  3. You can skip any of the categories by leaving both fields blank – this means there will be no specific requirement for that category. You can optionally set a requirement for the whole test (in the above example it’s min. 80% correct answers) or use only category based requirements.
  4. A setting in the Edit Quiz -> General settings tab defines what will be the type of criteria to check:
    a) By default all tests are graded based on number of points collected.
    b) If you check the above checkbox and save your quiz will be graded based on % correctly answered questions from total questions given to the test taker.
    c) If you check the above option but select “% from maximum points” from the drop-down menu, it will be graded based on the % achieved points from the maximum possible points in the quiz.This setting defines grading the quiz as a whole, grading based on category performance, and category grades if any.

This feature is also the best way of creating Myers-Briggs personality quizzes.