Diff for /loncom/interface/lonwhatsnew.pm between versions 1.105.2.18 and 1.126

version 1.105.2.18, 2020/09/01 22:30:58 version 1.126, 2020/03/30 11:04:13
Line 1 Line 1
 # The LearningOnline Network  
 # What's New in a course  
 #  #
 # $Id$  # $Id$
 #  #
Line 82  sub handler { Line 80  sub handler {
     }      }
     unless ($isadhoc) {      unless ($isadhoc) {
         %checkallowed = ( coursenormalmail => 1,          %checkallowed = ( coursenormalmail => 1,
                           coursecritmail => 1,);    coursecritmail => 1,);
     }      }
     foreach my $perm_check (['whn','whatsnew',1],      foreach my $perm_check (['whn','whatsnew',1],
     ['pch','coursediscussion',1],      ['pch','coursediscussion',1],
Line 655  sub display_actions_box { Line 653  sub display_actions_box {
   
     foreach my $item (@actionorder) {      foreach my $item (@actionorder) {
         unless ($item eq 'coursenormalmail' || $item eq 'coursecritmail' ||          unless ($item eq 'coursenormalmail' || $item eq 'coursecritmail' ||
                 $item eq 'newroles' || $item eq 'oldroles' ||                   $item eq 'newroles' || $item eq 'oldroles') {
                 $item eq 'crslogin' || $item eq 'sessions') {  
             if ($show{$item}) {              if ($show{$item}) {
                 $needitems = 1;                  $needitems = 1;
                 last;                  last;
Line 1123  sub check_discussions { Line 1120  sub check_discussions {
 sub check_handgraded {  sub check_handgraded {
     my ($resource,$symb,$title,$cdom,$cnum,$ungraded,$tograde) = @_;      my ($resource,$symb,$title,$cdom,$cnum,$ungraded,$tograde) = @_;
     if ($resource->is_problem()) {      if ($resource->is_problem()) {
         my ($handgradeable,$is_task);          my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
         my $partlist=$resource->parts();          my $partlist=$resource->parts();
         if ($resource->is_task()) {          my $handgradeable;
             $is_task = 1;          foreach my $part (@$partlist) {
             foreach my $part (@$partlist) {              if ($resource->handgrade($part) eq 'yes') {
                 if ($resource->handgrade($part) eq 'yes') {                  $handgradeable=1; last;
                     $handgradeable=1;  
                     last;  
                 }  
             }  
         } else {  
             foreach my $part (@$partlist) {  
                 my @types = $resource->responseType($part);  
                 if (grep(/^essay$/,@types)) {  
                     $handgradeable=1;  
                     last;  
                 }  
             }              }
         }          }
         if ($handgradeable) {          if ($handgradeable) {
Line 1148  sub check_handgraded { Line 1134  sub check_handgraded {
             if (@ungraded > 0) {              if (@ungraded > 0) {
                 $$ungraded{$symb}{count} = scalar(@ungraded);                  $$ungraded{$symb}{count} = scalar(@ungraded);
                 $$ungraded{$symb}{title} = $title;                  $$ungraded{$symb}{title} = $title;
                 $$ungraded{$symb}{is_task} = $is_task;  
                 if ($resource->encrypted()) {                  if ($resource->encrypted()) {
                     $$ungraded{$symb}{'enclink'} = $resource->link();                      $$ungraded{$symb}{'enclink'} = $resource->link();
                     $$ungraded{$symb}{'encsymb'} = $resource->shown_symb();                      $$ungraded{$symb}{'encsymb'} = $resource->shown_symb();
Line 1404  sub getnormalmail { Line 1389  sub getnormalmail {
                 if (defined($sendtime) && $sendtime!~/error/) {                  if (defined($sendtime) && $sendtime!~/error/) {
                     if (($emailstatus{$msgid} eq 'new') || ($status eq 'new')) {                      if (($emailstatus{$msgid} eq 'new') || ($status eq 'new')) {
                         $sendtime = &Apache::lonlocal::locallocaltime($sendtime);                          $sendtime = &Apache::lonlocal::locallocaltime($sendtime);
                         $msgcount ++;          $msgcount ++;
                         if ($shortsubj eq '') {                          if ($shortsubj eq '') {
                             $shortsubj = &mt('No subject');                              $shortsubj = &mt('No subject');
                         }                          }
Line 1814  sub display_handgrade { Line 1799  sub display_handgrade {
         foreach my $res (@{$tograde}) {          foreach my $res (@{$tograde}) {
             $rowNum ++;              $rowNum ++;
             my $css_class = $rowNum%2?' class="LC_odd_row"':'';              my $css_class = $rowNum%2?' class="LC_odd_row"':'';
             my $linkurl;              my $linkurl='/adm/grades';
             if ($$ungraded{$res}{'is_task'}) {              if ($$ungraded{$res}{'enclink'}) {
                 my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);                  $linkurl.='?symb='.$$ungraded{$res}{'encsymb'};
                 $linkurl=&Apache::lonnet::clutter($url);  
                 $linkurl .= '?symb='.&escape($res);  
                 if ($$ungraded{$res}{'enclink'}) {  
                     $linkurl =  
                         $$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'};  
                 }  
             } else {              } else {
                 $linkurl='/adm/grades';                  $linkurl.='?symb='.&escape($res);
                 if ($$ungraded{$res}{'enclink'}) {  
                     $linkurl.='?symb='.$$ungraded{$res}{'encsymb'};  
                 } else {  
                     $linkurl.='?symb='.&escape($res);  
                 }  
                 $linkurl.='&command=ungraded';  
             }              }
               $linkurl.='&command=ungraded';
             $r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a></td><td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>');              $r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a></td><td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>');
         }          }
     } elsif ($itemserror) {      } elsif ($itemserror) {
Line 2140  sub display_activity { Line 2114  sub display_activity {
     }      }
     return;      return;
 }  }
    
 sub display_coursediscussion {  sub display_coursediscussion {
     my ($r,$newdiscussions,$unread,$countunread,$res_title,$itemserror) = @_;      my ($r,$newdiscussions,$unread,$countunread,$res_title,$itemserror) = @_;
     my $lctype = lc(&Apache::loncommon::course_type());      my $lctype = lc(&Apache::loncommon::course_type());
Line 2170  sub display_coursediscussion { Line 2144  sub display_coursediscussion {
             my $forum_title = $$unread{$ressymb}{'title'};              my $forum_title = $$unread{$ressymb}{'title'};
             my $type = 'Resource';              my $type = 'Resource';
             my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb);              my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb);
             my $disclink = $feedurl.'?symb='.&escape($$unread{$ressymb}{symb});              my $disclink = $feedurl.'?symb='. &escape($$unread{$ressymb}{symb});
             if ($feedurl =~ /bulletinboard/) {              if ($feedurl =~ /bulletinboard/) {
                 $type = 'Discussion Board';                  $type = 'Discussion Board';
             }              }

Removed from v.1.105.2.18  
changed lines
  Added in v.1.126


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