Diff for /loncom/interface/lonfeedback.pm between versions 1.357 and 1.358

version 1.357, 2012/06/17 15:30:37 version 1.358, 2012/06/22 20:33:15
Line 1056  sub build_posting_display { Line 1056  sub build_posting_display {
                      &filter_regexp($rolefilter,$sectionpick,$statusfilter);                       &filter_regexp($rolefilter,$sectionpick,$statusfilter);
             $rolematch = $roleregexp.':'.$secregexp.':'.$statusregexp;              $rolematch = $roleregexp.':'.$secregexp.':'.$statusregexp;
         }          }
           my %votestyle;
         if ($seeid || $canvote) {          if ($seeid || $canvote) {
 # We need to go through this twice, first to get the likes/dislikes, then to actually build the display  # We need to go through this twice, first to get the likes/dislikes, then to actually build the display
             for (my $id=1;$id<=$contrib{'version'};$id++) {              for (my $id=1;$id<=$contrib{'version'};$id++) {
Line 1101  sub build_posting_display { Line 1102  sub build_posting_display {
             $twoplus=$ave+2.*$stddev;              $twoplus=$ave+2.*$stddev;
             $oneminus=$ave-$stddev;              $oneminus=$ave-$stddev;
             $twominus=$ave-2.*$stddev;              $twominus=$ave-2.*$stddev;
               if ($#theselikes>1) {
                   foreach my $class ('twoplus','oneplus','zero','oneminus','twominus') {
                       my $fontstyle = $env{'course.'.$env{'request.course.id'}.'.discussion_post_fonts_'.$class};
                       if ($fontstyle ne '') {
                           my ($size,$weight,$style,$other) = split(/,/,$fontstyle);
                           if ($size ne '') {
                               $votestyle{$class} .= 'font-size: '.$size.';';
                           }
                           if ($weight ne '') {
                               $votestyle{$class} .= 'font-weight: '.$weight.';';
                           }
                           if ($style ne '') {
                               $votestyle{$class} .= 'font-style: '.$style.';';
                           }
                           if ($other ne '') {
                               $votestyle{$class} .= $other;
                           }
                           if ($votestyle{$class} ne '') {
                               $votestyle{$class} = 'style="'.$votestyle{$class}.'"';
                           }
                       }
                   }
               }
         }          }
 #  #
 # This is now the real loop. Go through all entries, pick up what we need  # This is now the real loop. Go through all entries, pick up what we need
Line 1436  sub build_posting_display { Line 1460  sub build_posting_display {
                                 $$discussionitems[$idx].='&nbsp;&nbsp;'.$ctlink;                                  $$discussionitems[$idx].='&nbsp;&nbsp;'.$ctlink;
                             }                              }
                             my $thislikes=$likes{$symb.':'.$idx.':likes'};                              my $thislikes=$likes{$symb.':'.$idx.':likes'};
                             my $likesize="100";                              my $likestyle;
                             if ($seeid || $canvote) {                              if ($seeid || $canvote) {
 # Figure out size based on likes  # Figure out size based on likes
                                   my $class = 'zero';
                                 my $thislikes=$likes{$symb.':'.$idx.':likes'};                                  my $thislikes=$likes{$symb.':'.$idx.':likes'};
                                 if ($thislikes>$twoplus) {                                  if ($thislikes>$twoplus) {
                                     $likesize="200";                                      $class = 'twoplus';
                                 } elsif ($thislikes>$oneplus) {                                  } elsif ($thislikes>$oneplus) {
                                     $likesize="150";                                      $class = 'oneplus';
                                 }                                  }
                                 if ($thislikes<$twominus) {                                  if ($thislikes<$twominus) {
                                     $likesize="50";                                      $class = 'twominus';
                                 } elsif ($thislikes<$oneminus) {                                  } elsif ($thislikes<$oneminus) {
                                     $likesize="75";                                      $class = 'oneminus';
                                 }                                  }
                                   $likestyle = $votestyle{$class};
                             }                              }
 # Actually glue in the message itself  # Actually glue in the message itself
                             $$discussionitems[$idx].= '<br /><blockquote>'.                              $$discussionitems[$idx].= '<br /><blockquote>'.
                                     "<div style='font-size:$likesize%'>".                                      "<div $likestyle>".
                                     $message.                                      $message.
                                     '</div></blockquote>';                                      '</div></blockquote>';
                             if ($canvote) {                              if ($canvote) {

Removed from v.1.357  
changed lines
  Added in v.1.358


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>