public function getDiag($this_evidence, $active_project)
{
// Get the diagnosticity. Both variables are objects.
global $active_user;
$total_diag = 0;
for ($j = 0; $j < count($active_project->hypotheses); $j++) {
$this_hypothesis = new Hypothesis();
$this_hypothesis->populateFromId($active_project->hypotheses[$j]);
$results = mysql_fast("SELECT * FROM ratings WHERE evidence_id='{$this_evidence->id}' AND hypothesis_id='{$this_hypothesis->id}' AND user_id='{$active_user->id}'");
for ($i = 0; $i < count($results); $i++) {
$total_diag += getHypoRatingScore($results[$i]['rating']);
}
}
return $total_diag * -1;
//multiple by -1 so that most diagnostic evidence appears at top upon sort
}