public function showCellCompare($evidence, $sort, $display, $user_1, $user_2) { // $sort can be "least_likely", "most_likely", "alpha", and "added". global $base_URL; //THIS FUNCTION IS JUST FOR CONSENSUS RATINGS ON THE MATRIX THAT COMPARES TWO USERS $this->sortHCompare($sort, $user_1->id, $user_2->id); for ($j = 0; $j < count($this->hypotheses); $j++) { echo "<td "; if (!$display) { echo 'style="display: none;" '; } echo "onmouseover=\"return overlib('"; $ratings = array(); $rating = $this->ratings[$evidence->id][$this->hypotheses[$j]][$user_1->id]; $rating_score = getRatingScore($rating); if ($rating != "") { $ratings[] = getRatingScore($rating); } echo $user_1->name . ": " . $rating; echo '<br>'; $rating = $this->ratings[$evidence->id][$this->hypotheses[$j]][$user_2->id]; $rating_score = getRatingScore($rating); if ($rating != "") { $ratings[] = getRatingScore($rating); } echo $user_2->name . ": " . $rating; $group_rating = getGroupRating(getStDev($ratings)); if (average($ratings) == 0) { $unanimous_score = "N"; $this_rating_style = "neutral"; //HAVE TO ADD THAT STYLE } else { if (average($ratings) <= -1.5) { $unanimous_score = "I"; $this_rating_style = "inconsistent"; } else { if (average($ratings) >= 1.5) { $unanimous_score = "C"; $this_rating_style = "consistent"; } } } if ($group_rating <= 1) { echo "', CAPTION, 'Consensus');\" onmouseout=\"return nd();\" class=\"colgroup_" . $sort . "\"><div class=\"unanimity\"><a href='" . $base_URL . "project/" . $this->id . "/cell/" . $evidence->id . "/" . $this->hypotheses[$j] . "'>Consensus</a> <span class=\"" . $this_rating_style . "\">  {$unanimous_score}  </span></div>"; } if ($group_rating == 2) { echo "', CAPTION, 'Mild Dispute');\" onmouseout=\"return nd();\" class=\"colgroup_" . $sort . "\"><div class=\"mildDisagreement\"><a href='" . $base_URL . "project/" . $this->id . "/cell/" . $evidence->id . "/" . $this->hypotheses[$j] . "'>Mild Dispute</a></div>"; } if ($group_rating == 3) { echo "', CAPTION, 'Large Dispute');\" onmouseout=\"return nd();\" class=\"colgroup_" . $sort . "\"><div class=\"starkDisagreement\"><a href='" . $base_URL . "project/" . $this->id . "/cell/" . $evidence->id . "/" . $this->hypotheses[$j] . "'>Large Dispute</a></div>"; } if ($group_rating == 4) { echo "', CAPTION, 'Extreme Dispute');\" onmouseout=\"return nd();\" class=\"colgroup_" . $sort . "\"><div class=\"extremeDisagreement\"><a href='" . $base_URL . "project/" . $this->id . "/cell/" . $evidence->id . "/" . $this->hypotheses[$j] . "'>Extreme Dispute</a></div>"; } /*if( count($ratings) > 1 ) { echo("<br /><small>StDev: " . getStDev($ratings) . "</small>"); } else { echo("<br /><small>StDev: N/A</small>"); }*/ echo "</td>"; } }
</a></td> <?php for ($j = 0; $j < count($active_project->hypotheses); $j++) { echo "<td onmouseover=\"return overlib('"; $ratings = array(); $rating = $compare_user_2->getRating($active_project->evidence[$i], $active_project->hypotheses[$j]); $rating_score = getRatingScore($rating); if ($rating != "") { $ratings[] = getRatingScore($rating); } echo $compare_user_2->name . ": " . $rating; echo '<br>'; $rating = $compare_user->getRating($active_project->evidence[$i], $active_project->hypotheses[$j]); $rating_score = getRatingScore($rating); if ($rating != "") { $ratings[] = getRatingScore($rating); } echo $compare_user->name . ": " . $rating; $group_rating = getGroupRating(getStDev($ratings)); if (average($ratings) == 0) { $unanimous_score = "N"; $this_rating_style = "neutral"; //HAVE TO ADD THAT STYLE } else { if (average($ratings) <= -1.5) { $unanimous_score = "I"; $this_rating_style = "inconsistent"; } else { if (average($ratings) >= 1.5) { $unanimous_score = "C"; $this_rating_style = "consistent";