Tag Archives: watupro

WatuPRO 5.0.2.4 Critical Bug Fix for WordPress 4.4

Yesterday’s WordPress upgrade to 4.4 is causing a database error when submitting a quiz in most WatuPRO versions and some MySQL versions. This is NOT a security issue but it can cause critical malfunction. So we highly recommend to update to the latest version ASAP.

We are sending version 5.0.2.4 via a newsletter today. If you have not received it, feel free to send us email.

If you have customized the plugin in some way and don’t want to update you can replace only lib/watupro.php where the changes are done. In any other case please update the whole plugin.

If Your Free Support Subscription Has Expired

We sent a newsletter when this bug fix was released. If you missed to update your installation back then and your free support subscription has expired, you have two options:

  • To renew using the 60% promo code. It can be provided to you by email, please contact us.
  • To fix the bug yourself. Open lib/watupro.php and fine the following queries:
if(empty($detail->ID)) {
               $wpdb->insert(WATUPRO_STUDENT_ANSWERS,
                array("user_id"=>$user_ID, "exam_id"=>$exam_id, "taking_id"=>$taking_id,
                    "question_id"=>$question_id, "answer"=>$answer,
                    "points"=>$points, "question_text"=>$question_text, 
                    "is_correct" => $is_correct, 'snapshot'=>$snapshot, 'hints_used'=>$hints, 
                    "num_hints_used" => $no_hints, "onpage_question_num" => @$_POST['current_question'],
                    "feedback" => @$_POST['feedback-'.$question_id],
                    "rating" => intval(@$_POST['question_rating_'.$question_id])),
                array("%d","%d","%d","%d","%s","%f","%s", "%d", "%s", "%s", "%d", "%d", "%s", "%d"));    
                $detail_id = $wpdb->insert_id;            
        }
        else {
                // don't remove the snapshot
                if(empty($snapshot) and !empty($detail->snapshot)) $snapshot = stripslashes($detail->snapshot);            
            
            $wpdb->query($wpdb->prepare("UPDATE ".WATUPRO_STUDENT_ANSWERS." SET
               answer=%s, points=%s, question_text=%s, is_correct=%d, snapshot=%s, hints_used = %s, 
               num_hints_used=%d, onpage_question_num=%d, feedback=%s, rating=%d
               WHERE id=%d", $answer, $points, $question_text, $is_correct, $snapshot, $hints, $no_hints,
               @$_POST['current_question'], @$_POST['feedback-'.$question_id], intval(@$_POST['question_rating_'.$question_id]), $detail->ID ));
            $detail_id = $detail->ID;                 
        }

Change them to:

if(empty($detail->ID)) {
    		   $wpdb->insert(WATUPRO_STUDENT_ANSWERS,
    			array("user_id"=>$user_ID, "exam_id"=>$exam_id, "taking_id"=>$taking_id,
    				"question_id"=>$question_id, "answer"=>$answer,
    				"points"=>$points, "question_text"=>$question_text, 
    				"is_correct" => $is_correct, 'snapshot'=>$snapshot, 'hints_used'=>$hints, 
    				"num_hints_used" => $no_hints, "onpage_question_num" => intval(@$_POST['current_question']),
    				"feedback" => @$_POST['feedback-'.$question_id],
    				"rating" => intval(@$_POST['question_rating_'.$question_id])),
    			array("%d","%d","%d","%d","%s","%f","%s", "%d", "%s", "%s", "%d", "%d", "%s", "%d"));    
    			$detail_id = $wpdb->insert_id;			
        }
        else {
				// don't remove the snapshot
				if(empty($snapshot) and !empty($detail->snapshot)) $snapshot = stripslashes($detail->snapshot);        	
        	
            $wpdb->query($wpdb->prepare("UPDATE ".WATUPRO_STUDENT_ANSWERS." SET
               answer=%s, points=%s, question_text=%s, is_correct=%d, snapshot=%s, hints_used = %s, 
               num_hints_used=%d, onpage_question_num=%d, feedback=%s, rating=%d
               WHERE id=%d", $answer, $points, $question_text, $is_correct, $snapshot, $hints, $no_hints,
               intval(@$_POST['current_question']), @$_POST['feedback-'.$question_id], intval(@$_POST['question_rating_'.$question_id]), $detail->ID ));
            $detail_id = $detail->ID;                 
        } 

That’s it.

Turn Multiple-Answer Gaps Into Drop-downs And Other Advanced Adjustments

You know that the Intelligence module of WatuPRO allows you to create “fill the gaps” questions. Each of the “gaps” (blanks) can have multiple correct answers when you use the following format:

The apple can be {{{green|red|yellow}}}

In the above example if the user fills green, or red, or yellow in the generated text field, their answer will be correct.

From version 5.0.2 the same format can be used for different purpose by selecting the following checkbox on the Edit Question page:

gaps-dropdownsWhen this is selected, all the gaps that have more than one answer within the question will be turned into drop-down selector. The drop-down selector will have one option for each answer given. The first answer that you have given is the only correct answer. But of course, it will not be shown first – the selections will be randomized so the user will not know which is the correct answer.

So if we use the above example, the correct answer will be “green” and red / yellow will not be correct.

This setting is per-question so it will affect all the blanks within the selected question.

Other Fill The Gaps Adjustments

You can create a “placeholder” for each regular gap (not for drop-downs) to give a hint or remind for the supported format in the gap like this:

One dollar has {{{100|placeholder="numbers only"}}} cents in it.

For gaps that allow multiple correct answers you can do the same – just make sure the placeholder is the last value:

A good apple color can be {{{green|red|yellow|placeholder="type color name"}}}.

On the WatuPRO Settings page you can define the width and height of the gaps. Sometimes you may need to apply specific CSS style to an individual gap. You can do this by passing an inline style as last answer for the gap (in case there is a placeholder, style should be after it). Examples:

One dollar has {{{100|placeholder="numbers only"|style="font-weight:bold;"}}} cents in it.

A good apple color can be {{{green|red|yellow|style="width:150px;"}}}.

WatuPRO 4.9

The latest version of the WordPress quiz plugin WatuPRO is now 4.9.

Below are the new features and improvements done between versions 4.8 and 4.9:

      • Question difficulty levels can now be selected in user’s profile (by admin). When this is done the user will be restricted to access only questions from the selected difficulty levels.
      • Difficulty levels can have unlock criteria to be automatically unlocked (if you select “Apply difficulty level restrictions per user account.”)
      • Added log that will show you who and when unlocked a difficulty level (provided that you select “Apply difficulty level restrictions per user account.”)
      • The search form on “view results” page will now include the Phone and Company fields, when they are requested in the quiz.
      • Limit the number of logged in users quiz re-takings within interval of 24 hours, a week, or a month.
      • Certificates now can be issued for completing multiple quizzes with min. average points and / or min. average % correct answer.
      • New option lets you enable a rating widget so users can rate questions.
      • New “final screen” variable %%ANSWERS-PAGINATED%% lets you display the user’s answers one at a time, with a numbered pagination.
      • Added option to automatically cleanup or blank out user submitted data older than X days (to save database space).
      • PDF Certificates can now be attached to emails (Requires PDF Bridge version 0.8 or newer)
      • New option “When no more attempts are available display the latest result.” lets you display a snapshot of the final screen when logged in user that can’t retake the quiz visits the quiz page.
      • The variable %%USER-NAME%% can also be used in the email subject.
      • Added variable %%ADMIN-URL%%. It can be useful for the email sent to admin to quickly find the submission details in the administration.
      • [Reporting module] A bar chart shows the average % correct answers per skill.
      • [Intelligence module] Fill the gaps questions can now accept a numeric range also as correct answer.
      • [Intelligence module] Paid quizzes are now available for non-logged in users as well. To use this your server must support sessions (true in 99% of the cases). Also note that coupon codes functionality is currently available for logged in users only.
      • [Intelligence module] Date stamp when teacher manually edits user results will be stored and shown in the list of results on a quiz.
      • [Intelligence module] You can specify individual CSS for every gap (in Fill the gaps questions) by passing it like last correct answer for the gaps. Example: {{{answer1|answer2|style=”width:250px;font-weight:bold;height:50px;”}}}
      • [Reporting module] Fixed bug: the “Different tests attempted” on the Overview page was showing 0.
      • Fixed subcategory related issues in the Reporting module -> Skills.
      • Fixed false “category name already exists” message when adding subcategories.
      • Fixed bug when user  with the same session saves multiple in-progress quizzes (only one was saving).
      • Fixed bug with saving and reusing the “common category grade design” in the default grades page.
      • Fixed bug with timed quizzes that store user progress and randomize questions (questions order was lost during different unfinished quiz attempts).
      • Fixed bug when timed “non-ajax” quiz required contact details at the beginning (the details were getting lost)
      • Added auto-scroll to top after filling contact details on quizzes that ask for them at the beginning.
      • Improved styling of the buttons in the admin pages.

The new version is sent by newsletter to eligible customers.