Diff for /loncom/interface/lonwhatsnew.pm between versions 1.60 and 1.61

version 1.60, 2006/07/19 22:01:37 version 1.61, 2006/09/06 19:20:04
Line 687  sub display_launcher { Line 687  sub display_launcher {
                           $critmsgcount,$critmsgs,$interval,$countunread) = @_;                            $critmsgcount,$critmsgs,$interval,$countunread) = @_;
   
     if ($$checkallowed{$action}) {      if ($$checkallowed{$action}) {
         &start_box($r,$tabbg,$show,$headings,$action,$refpage);          &start_box($r,$tabbg,$show,$headings,$action,$refpage,$action);
         if ($$show{$action}) {          if ($$show{$action}) {
             if ($action eq 'handgrading') {    # UNGRADED ITEMS              if ($action eq 'handgrading') {    # UNGRADED ITEMS
                 &display_handgrade($r,$tograde,$rowColor1,$rowColor2,                  &display_handgrade($r,$tograde,$rowColor1,$rowColor2,
Line 701  sub display_launcher { Line 701  sub display_launcher {
   
             } elsif ($action eq 'abovethreshold') { # DEGDIFF/AV. TRIES TRIGGERS              } elsif ($action eq 'abovethreshold') { # DEGDIFF/AV. TRIES TRIGGERS
                 &display_abovethreshold($r,$refpage,$warnings,$triggered,                  &display_abovethreshold($r,$refpage,$warnings,$triggered,
                                              $res_title);   $res_title);
             } elsif ($action eq 'coursediscussion') { # UNREAD COURSE DISCUSSION              } elsif ($action eq 'coursediscussion') { # UNREAD COURSE DISCUSSION
                 &display_coursediscussion($r,$newdiscussions,$unread,                  &display_coursediscussion($r,$newdiscussions,$unread,
                                 $countunread,$res_title,$rowColor1,$rowColor2);                                  $countunread,$res_title,$rowColor1,$rowColor2);
Line 739  sub getitems { Line 739  sub getitems {
                                                                    $cdom,$crs);                                                                     $cdom,$crs);
     }      }
   
     my $warningnum = 0;  
     foreach my $resource (@allres) {      foreach my $resource (@allres) {
         my $result = '';          my $result = '';
         my $applies = 0;          my $applies = 0;
Line 773  sub getitems { Line 772  sub getitems {
   
 # Maxtries and degree of difficulty for problem parts, unless handgradeable  # Maxtries and degree of difficulty for problem parts, unless handgradeable
         if ($$show{'abovethreshold'}) {            if ($$show{'abovethreshold'}) {  
             $warningnum = &check_thresholds($resource,$symb,\%resourcetracker,              &check_thresholds($resource,$symb,\%resourcetracker,
                                             $triggered,$threshold,$warnings,        $triggered,$threshold,$warnings);
                                             $warningnum,$rowColor1,$rowColor2);  
         }          }
   
     }      }
Line 839  sub check_bombed { Line 837  sub check_bombed {
 }  }
   
 sub check_thresholds {  sub check_thresholds {
     my ($resource,$symb,$resourcetracker,$triggered,$threshold,$warnings,      my ($resource,$symb,$resourcetracker,$triggered,$threshold,$warnings) = @_;
                                        $warningnum,$rowColor1,$rowColor2) = @_;  
 # Compile maxtries and degree of difficulty for problem parts, unless handgradeable  # Compile maxtries and degree of difficulty for problem parts, unless handgradeable
     my @parts = @{$resource->parts()};      my @parts = @{$resource->parts()};
     my %stats;      my %stats;
Line 885  sub check_thresholds { Line 882  sub check_thresholds {
         }          }
     }      }
     if ($warning) {      if ($warning) {
         if ($warningnum%2 == 1) {  
             $rowColor = $rowColor1;  
         } else {  
             $rowColor = $rowColor2;  
         }  
         $$triggered{$symb}{rowColor} = $rowColor;  
         $$triggered{$symb}{title} = $resource->title;          $$triggered{$symb}{title} = $resource->title;
         foreach my $part (@parts) {          foreach my $part (@parts) {
             if (exists($stats{$part}{users})) {              if (exists($stats{$part}{users})) {
                 my $resetname = 'reset_'.&escape($symb."\0".$part);                  my $resetname = 'reset_'.&escape($symb."\0".$part);
                 my $resettitle = 'title_'.&escape($symb."\0".$part);                  my $resettitle = 'title_'.&escape($symb."\0".$part);
                 if ($$triggered{$symb}{numparts}) {                  if ($$triggered{$symb}{numparts}) {
                     $$triggered{$symb}{text} .= '<tr bgcolor="'.$rowColor.'">'."\n";                      $$triggered{$symb}{text} .= '<tr>'."\n";
                 }                  }
                 if (@parts > 1) {                  if (@parts > 1) {
                     $$triggered{$symb}{text} .= '                      $$triggered{$symb}{text} .= '
                      <td align="right"><small>part - '.$part.'<small></td>';                       <td>part - '.$part.'</td>';
                 } else {                  } else {
                     $$triggered{$symb}{text} .= '                      $$triggered{$symb}{text} .= '
                      <td align="right"><small>single part</small></td>';                       <td>single part</td>';
                 }                  }
                 $$triggered{$symb}{text} .= '                  $$triggered{$symb}{text} .= '
                      <td align="right"><small>'.$stats{$part}{users}.'</small></td>                       <td>'.$stats{$part}{users}.'</td>
                      <td align="right"><small>'.$stats{$part}{attempts}.'</small></td>                       <td>'.$stats{$part}{attempts}.'</td>
                      <td align="right"><small>'.$stats{$part}{degdiff}.'</small></td>                       <td>'.$stats{$part}{degdiff}.'</td>
                      <td align="right"><small>'.$lastreset{$part}.'</small></td>                       <td>'.$lastreset{$part}.'</td>
                      <td align="right"><small><input type="checkbox" name="'.$resetname.'" /><input type="hidden" name="'.$resettitle.'" value="'.&escape($$triggered{$symb}{title}).'" /></td>                       <td><input type="checkbox" name="'.$resetname.'" /><input type="hidden" name="'.$resettitle.'" value="'.&escape($$triggered{$symb}{title}).'" /></td>
                     </tr>';                      </tr>';
                 $$triggered{$symb}{numparts} ++;                  $$triggered{$symb}{numparts} ++;
             }              }
         }          }
         push(@{$warnings},$symb);          push(@{$warnings},$symb);
         $warningnum ++;  
     }      }
     return $warningnum;  
 }  }
   
   
Line 1214  sub display_abovethreshold { Line 1203  sub display_abovethreshold {
                 ' <input type="hidden" name="command" value="reset" />'."\n".                  ' <input type="hidden" name="command" value="reset" />'."\n".
                 ' <input type="hidden" name="refpage" value="'.$refpage.'" />'.                  ' <input type="hidden" name="refpage" value="'.$refpage.'" />'.
                 "\n");                  "\n");
         $r->print('<tr bgcolor="#cccccc"><td><b><small>'.$lt{'reso'}.'</small></b></td><td align="right"><b><small>'.$lt{'part'}.'</small></b></td><td align="right"><b><small>'.$lt{'nust'}.'</small></b></td><td align="right"><b><small>'.$lt{'avat'}.'</small></b></td><td align="right"><b><small>'.$lt{'dedi'}.'</small></b></td><td align="right"><b><small>'.$lt{'lare'}.'</small></b></td><td align="right"><b><small>'.$lt{'reco'}.'</small></b></td></tr>');          $r->print('<tr class="LC_info_row">'.
     '<td class="LC_first_item">'.$lt{'reso'}.'</td>'.
     '<td>'.$lt{'part'}.'</td><td>'.$lt{'nust'}.'</td>'.
     '<td>'.$lt{'avat'}.'</td><td>'.$lt{'dedi'}.'</td>'.
     '<td>'.$lt{'lare'}.'</td><td>'.$lt{'reco'}.'</td></tr>');
    my $row;
         foreach my $res (@{$warnings}) {          foreach my $res (@{$warnings}) {
       $row++;
             my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);              my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);
             my $linkurl=&Apache::lonnet::clutter($url);              my $linkurl=&Apache::lonnet::clutter($url);
             my $rowspan;              my $rowspan;
Line 1223  sub display_abovethreshold { Line 1218  sub display_abovethreshold {
                 $rowspan = 'rowspan="'.$$triggered{$res}{numparts}.'"';                  $rowspan = 'rowspan="'.$$triggered{$res}{numparts}.'"';
             }              }
             $linkurl .= '?symb='.&escape($res);              $linkurl .= '?symb='.&escape($res);
             $r->print('<tr bgcolor="'.$$triggered{$res}{rowColor}.'"><td '.$rowspan.'><a href="'.$linkurl.'"><small>'.$$triggered{$res}{title}.'</small></a></td>'.$$triggered{$res}{text});              $r->print('<tr class="'.($row%2?'LC_odd_row':'').'">'.
         '<td class="LC_first_item" '.$rowspan.'><a href="'.$linkurl.'">'.
         $$triggered{$res}{title}.'</a></td>'.
         $$triggered{$res}{text});
         }          }
         $r->print('<tr bgcolor="#cccccc"><td colspan="7" align="right"><br /><b><small><input type="submit" name="counters" value="'.$lt{'rese'}.'" /></form>');          $r->print('<tr class="LC_info_row"><td colspan="7"><br /><input type="submit" name="counters" value="'.$lt{'rese'}.'" /></td></tr></form>');
     } else {      } else {
         $r->print('<tr><td bgcolor="#ffffff"><br /><center><b><i><small>'.$lt{'nopr'}.'</small></i></b></center><br /></td></tr>');          $r->print('<tr class="LC_empty_row"><br />'.$lt{'nopr'}.'<br /></td></tr>');
     }      }
 }  }
   
Line 1516  sub start_box { Line 1514  sub start_box {
                        chin => 'Change interval?',                         chin => 'Change interval?',
                        chop => 'Change options?',                         chop => 'Change options?',
     );      );
     my $showhide;      my ($showhide,$class);
     if ($$show{$caller}) {      if ($$show{$caller}) {
         $showhide = '<b><a href="javascript:change_display(document.visible.'.          $showhide = '<b><a href="javascript:change_display(document.visible.'.
                                'display_'.$caller.",'hide'".');">Hide</a></b>';                                 'display_'.$caller.",'hide'".');">Hide</a></b>';
Line 1548  sub start_box { Line 1546  sub start_box {
                 <td bgcolor="'.$tabbg.'" align="right"><a href="/adm/whatsnew?command=chgthreshold&refpage='.$refpage.'"><b><small>'.$lt{'chth'}.'</small></b></a></td>                  <td bgcolor="'.$tabbg.'" align="right"><a href="/adm/whatsnew?command=chgthreshold&refpage='.$refpage.'"><b><small>'.$lt{'chth'}.'</small></b></a></td>
               </tr>');                </tr>');
          }           }
    $class='class="LC_whatsnew"';
      } elsif (($caller eq 'versionchanges') && ($$show{$caller})) {       } elsif (($caller eq 'versionchanges') && ($$show{$caller})) {
          if ($$show{$caller}) {           if ($$show{$caller}) {
              $r->print('               $r->print('
Line 1563  sub start_box { Line 1562  sub start_box {
               </tr>');                </tr>');
          }           }
      }       }
      $r->print('      $r->print('
               <tr>                <tr>
                <td bgcolor="#ffffff">                 <td bgcolor="#ffffff">
                 <table cellpadding="2" cellspacing="0" border="0" width="100%">                  <table cellpadding="2" cellspacing="0" border="0" width="100%" '.$class.'>
 ');  ');
     return;      return;
 }  }

Removed from v.1.60  
changed lines
  Added in v.1.61


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