Watu output error
-
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
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 WHEREexam_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!
- The topic ‘Watu output error’ is closed to new replies.