• Resolved defango

    (@defango)


    I loaded up your plugin looking to make some tests for a friend that was looking into using you plugin for it. Everything went really smooth, I really loved the easy of usage. I ran into an error after I tested my first tests an saw I was getting a “divide by zero” errer just above the results. is this common or have I messed the settings?

    Error

    Warning: Division by zero in /home/defken/defango.com/wp-content/plugins/watu/show_exam.php on line 76

    link to test

    http://defango.com/low-t/

    lines from show_exam.php

    $result .= “”;
    if(!$_REQUEST[“answer-” . $ques->ID]) $result .= “<p class=’unanswered’>” . __(‘Question was not answered’, ‘watu’) . “</p>”;

    $result .= “</div>”;
    //$total++;
    }
    $total = $wpdb->get_var($wpdb->prepare(“SELECT sum(point) FROM {$wpdb->prefix}watu_question as q inner join {$wpdb->prefix}watu_answer as a on question_id=q.ID WHERE exam_id=%d and correct=’1′ “, $exam_id));

    //Find scoring details of this guy.
    $percent = number_format($score / $total * 100, 2);
    //0-9 10-19%, 20-29%, 30-39% 40-49%
    $all_rating = array(__(‘Failed’, ‘watu’), __(‘Failed’, ‘watu’), __(‘Failed’, ‘watu’), __(‘Failed’, ‘watu’), __(‘Just Passed’, ‘watu’),
    //

    any help would be great!

    http://wordpress.org/extend/plugins/watu/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Bob

    (@prasunsen)

    problem solved in 1.6.3. But in general you shouldn’t have exam with 0 points on all questions.

    Thread Starter defango

    (@defango)

    Yea, there isn’t zero points on any of the questions, so there is probably a coding error. I downloaded and uploaded with your instructions and was smart enough to give each question a value.

    Plugin Author Bob

    (@prasunsen)

    There is no coding error, this plugin is used by near 5,000 users and you are the first who has such problem. The “Division by zero” warning means only one thing – that there is a division by zero.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Watu output error’ is closed to new replies.