--- loncom/interface/lonfeedback.pm 2012/01/06 19:18:11 1.325 +++ loncom/interface/lonfeedback.pm 2012/01/06 20:05:59 1.326 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.325 2012/01/06 19:18:11 www Exp $ +# $Id: lonfeedback.pm,v 1.326 2012/01/06 20:05:59 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1002,7 +1002,12 @@ sub build_posting_display { $stddev=sqrt($sumsq/$num); } # Now we know the average likes $ave and the standard deviation $stddev -# &Apache::lonnet::logthis(join(',',@theselikes)." Ave $ave StdDev $stddev"); +# Get the boundaries for markup + my $oneplus=$ave+$stddev; + my $twoplus=$ave+2.*$stddev; + my $oneminus=$ave-$stddev; + my $twominus=$ave-2.*$stddev; +# &Apache::lonnet::logthis(join(',',@theselikes)." Ave $ave StdDev $stddev $twominus $oneminus $oneplus $twoplus"); # # This is now the real loop. Go through all entries, pick up what we need # @@ -1333,8 +1338,23 @@ sub build_posting_display { if ($$dischash{$toggkey}) { $$discussionitems[$idx].='  '.$ctlink; } +# Figure out size based on likes + my $thislikes=$likes{$symb.':'.$idx.':likes'}; + my $likesize="100"; + if ($thislikes>$twoplus) { + $likesize="200"; + } elsif ($thislikes>$oneplus) { + $likesize="150"; + } + if ($thislikes<$twominus) { + $likesize="50"; + } elsif ($thislikes<$oneminus) { + $likesize="75"; + } $$discussionitems[$idx].= '
'. - $message.'
'; + "
". + $message. + '
'; if ($contrib{$idx.':history'}) { my @postversions = (); $$discussionitems[$idx] .= &mt('This post has been edited by the author.');