Design Themes From WatuPRO 4.6.5

Design themes are available in our WordPress quiz plugin WatuPRO, starting from version 4.6.5. The design themes let you control how the quizzes look for your users.
WatuPRO currently have 5 ready design themes. You can choose design theme in WatuPRO Settings page:

select-themeChoose the theme and save. Now your quizzes will use the theme.

Designing your own theme

Designing your own theme is as simple as uploading a CSS file in watupro/css/themes folder. Please explore the existing themes to get ideas what you can change and how. We can provide design consultations as addon service.

The existing themes

We are starting with 5 built-in themes. Below are small examples of each of them:

The default theme

This theme is used by default in WatuPRO.

default

The green theme

Has green buttons and backgrounds on text boxes.

green

The green buttons theme

Similar to the above but the choices are shown as clickable buttons instead of radios / checkboxes.

green-buttons

The blue theme

blue

The blue buttons theme

blue-buttons

[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:

passed-grade

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

failed-grade

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:

final-screen

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="";
		$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_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
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");
   curl_close($ch);
   exit;
}
curl_close($ch);

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:

   }  
   fclose($fp);  
} 
else self::log_and_exit("Can't connect to Paypal");
		
exit;

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.