--- loncom/interface/lonwhatsnew.pm 2021/01/01 15:29:14 1.105.2.19 +++ loncom/interface/lonwhatsnew.pm 2020/03/30 16:26:46 1.127 @@ -1,7 +1,5 @@ -# The LearningOnline Network -# What's New in a course # -# $Id: lonwhatsnew.pm,v 1.105.2.19 2021/01/01 15:29:14 raeburn Exp $ +# $Id: lonwhatsnew.pm,v 1.127 2020/03/30 16:26:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -82,7 +80,7 @@ sub handler { } unless ($isadhoc) { %checkallowed = ( coursenormalmail => 1, - coursecritmail => 1,); + coursecritmail => 1,); } foreach my $perm_check (['whn','whatsnew',1], ['pch','coursediscussion',1], @@ -1123,28 +1121,12 @@ sub check_discussions { sub check_handgraded { my ($resource,$symb,$title,$cdom,$cnum,$ungraded,$tograde) = @_; if ($resource->is_problem()) { - my ($handgradeable,$is_task); + my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb); my $partlist=$resource->parts(); - if ($resource->is_task()) { - $is_task = 1; - foreach my $part (@$partlist) { - if ($resource->handgrade($part) eq 'yes') { - $handgradeable=1; - last; - } - } - } else { - foreach my $part (@$partlist) { - my @types = $resource->responseType($part); - if (grep(/^essay$/,@types)) { - $handgradeable=1; - last; - } elsif (grep(/^custom$/,@types)) { - if ($resource->handgrade($part) eq 'yes') { - $handgradeable=1; - last; - } - } + my $handgradeable; + foreach my $part (@$partlist) { + if ($resource->handgrade($part) eq 'yes') { + $handgradeable=1; last; } } if ($handgradeable) { @@ -1153,7 +1135,6 @@ sub check_handgraded { if (@ungraded > 0) { $$ungraded{$symb}{count} = scalar(@ungraded); $$ungraded{$symb}{title} = $title; - $$ungraded{$symb}{is_task} = $is_task; if ($resource->encrypted()) { $$ungraded{$symb}{'enclink'} = $resource->link(); $$ungraded{$symb}{'encsymb'} = $resource->shown_symb(); @@ -1409,7 +1390,7 @@ sub getnormalmail { if (defined($sendtime) && $sendtime!~/error/) { if (($emailstatus{$msgid} eq 'new') || ($status eq 'new')) { $sendtime = &Apache::lonlocal::locallocaltime($sendtime); - $msgcount ++; + $msgcount ++; if ($shortsubj eq '') { $shortsubj = &mt('No subject'); } @@ -1819,24 +1800,13 @@ sub display_handgrade { foreach my $res (@{$tograde}) { $rowNum ++; my $css_class = $rowNum%2?' class="LC_odd_row"':''; - my $linkurl; - if ($$ungraded{$res}{'is_task'}) { - my ($map,$id,$url)=&Apache::lonnet::decode_symb($res); - $linkurl=&Apache::lonnet::clutter($url); - $linkurl .= '?symb='.&escape($res); - if ($$ungraded{$res}{'enclink'}) { - $linkurl = - $$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'}; - } + my $linkurl='/adm/grades'; + if ($$ungraded{$res}{'enclink'}) { + $linkurl.='?symb='.$$ungraded{$res}{'encsymb'}; } else { - $linkurl='/adm/grades'; - if ($$ungraded{$res}{'enclink'}) { - $linkurl.='?symb='.$$ungraded{$res}{'encsymb'}; - } else { - $linkurl.='?symb='.&escape($res); - } - $linkurl.='&command=ungraded'; + $linkurl.='?symb='.&escape($res); } + $linkurl.='&command=ungraded'; $r->print(''.$$ungraded{$res}{title}.''.$$ungraded{$res}{count}.''); } } elsif ($itemserror) { @@ -2145,7 +2115,7 @@ sub display_activity { } return; } - + sub display_coursediscussion { my ($r,$newdiscussions,$unread,$countunread,$res_title,$itemserror) = @_; my $lctype = lc(&Apache::loncommon::course_type()); @@ -2175,7 +2145,7 @@ sub display_coursediscussion { my $forum_title = $$unread{$ressymb}{'title'}; my $type = 'Resource'; 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/) { $type = 'Discussion Board'; }