[WatuPRO] How To Display Different Message When The User Passes and Fails a Quiz?

Actually WatuPRO is a lot more flexible than having “Failed” and “Passed” outcomes of a quiz. But many users need only “Failed” and “Passed” and the question how to display different content depending on this outcome comes often.

It’s very easy:

Step 1: Create “Passed” and “Failed” grades

Click on the “Grades” link for the quiz and you’ll get to the Manage Grades page. Define what points or % correct answer the user needs to achieve in order to pass. From this number of points up to the maximum number of points (or 100% correct answers) will be your “Passed” grade. Your conditional message will go inside the grade description. For example:


Any points or % correct answers below this will make the “Failed” grade. In similar way, enter your conditional message, if any. For example:


Step 2: Add the variable to your “Quiz output / Final page box

You can use the variable %%GDESC%% to dislay the conditional message accordingly to the achieved result. For example:


That’s all! Two really easy steps.

GoDaddy and Paypal IPN

There is a serious problem with how Godaddy handles outgoing secure connections. It affects Paypal instant payment notifications on most PHP scripts running on their servers. So this affects also the users of our WatuPRO, Namaste! LMS, and Konnichiwa! plugins hosted on that company servers.

*Unconfirmed update: it looks like the proxy is no longer needed and you just need CURL to work on Godaddy. We’ll soon verify this and have a built-in solution but for now please use the code modifications outlined here.

There is no way we can implement extra code in plugins only to handle Godaddy specifics. But there is relatively easy fix to these problems. If you are using any of our plugins, read on:

For WatuPRO

Paid quizzes in WatuPRO are handled from the Intelligence module so the code that processes Paypal IPN is in i/models/payment.php

Do not do any code changes directly in the Plugin Editor! If you save the code with a parse error your whole site will crash and you will not be able to fix it. Such changes should be done only from FTP or your hosting control panel file editor.

Find the following in function paypal_ipn():

		$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
		$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
		$header .= "Content-Length: " . strlen($req) . "\r\n";
		$header .="Host: www.paypal.com\r\n"; 
		$header .="Connection: close\r\n\r\n";		
		$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);
		if($fp) {
			fputs ($fp, $header . $req);
		   while (!feof($fp)) {
		      $res = fgets ($fp, 1024);

Change it to:

$ch = curl_init('https://www.paypal.com/cgi-bin/webscr');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// GoDaddy hosted website proxy patch
// Looks like this is no longer required!
// curl_setopt($ch, CURLOPT_PROXY, "http://proxy.shr.secureserver.net:3128");
// End of GoDaddy proxy patch
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));

if( !($res = curl_exec($ch)) ) {
   self::log_and_exit("Got " . curl_error($ch) . " when processing IPN data");

And on the next line change if (strstr ($res, “200 OK”) to if (strstr ($res, “VERIFIED”)

Since we don’t have two loops here you also need to also remove the two closing curly braces at the end of the function:

else self::log_and_exit("Can't connect to Paypal");

Remove only the red text, don’t remove the “exit” word.

If you are WatuPRO customers with active support subscription you can contact us to make the change for you.

For Namaste! LMS

In Namaste! LMS this code is in models/payment.php function paypal_ipn().
The change is exactly the same as described above. You’ll need to apply it after every plugin update.

For Konnichiwa

Similar to above, in Konnichiwa this code is in models/payment.php. Exactly the same change change is required.

[WatuPRO] How to Open The Export Files (Tab Delimited CSV Files)

In WatuPRO all export files are TAB (tabulator) delimited CSV files. The reason we use this format is because comma delimited files are more error prone when the data contains rich text, HTML, commas, quotes etc. Tabulator is a lot more reliable as delimiter when importing and exporting data.

If you use Microsoft Excel here are a couple of links that will help you:

The official Microsoft guides

A pictorial by Excel Easy

Here at Kiboko Labs we prefer to use Libre Office Calc. It’s free and has versions for Mac, Windows, and Linux. When you double-click a .csv named file it automatically suggests the proper delimiter. Just select UTF-8 (Unicode) as encoding, if this is not already selected and open the file. Much easier.