--- loncom/interface/lonwhatsnew.pm 2020/03/30 11:04:13 1.126 +++ loncom/interface/lonwhatsnew.pm 2024/09/11 05:20:52 1.130 @@ -1,5 +1,7 @@ +# The LearningOnline Network +# What's New in a course # -# $Id: lonwhatsnew.pm,v 1.126 2020/03/30 11:04:13 raeburn Exp $ +# $Id: lonwhatsnew.pm,v 1.130 2024/09/11 05:20:52 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -653,7 +655,8 @@ sub display_actions_box { foreach my $item (@actionorder) { 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}) { $needitems = 1; last; @@ -766,13 +769,18 @@ sub display_threshold_config { my $onchange = 'onfocus="javascript:window.document.forms'. "['thresholdform'].elements['".$parameter."_setparmval']". '.checked=true;"'; + my $aria_textbox = ' aria-label="'.&mt('Threshold value for [_1]', + $threshold_titles{$type}).'"'; + my $aria_checkbox = ' aria-label="'.&mt('Change threshold value for [_1]', + $threshold_titles{$type}).'"'; $r->print(&Apache::loncommon::start_data_table_row()."\n". ''.$threshold_titles{$type}.''."\n". ''.&Apache::lonhtmlcommon::textbox($parameter.'_value', $threshold{$type}, - 10,$onchange).''."\n". + 10,$onchange.$aria_textbox).''."\n". ''. - &Apache::lonhtmlcommon::checkbox($parameter.'_setparmval'). + &Apache::lonhtmlcommon::checkbox($parameter.'_setparmval', + '','',$aria_checkbox). ''."\n". &Apache::loncommon::end_data_table_row()); } @@ -826,7 +834,7 @@ sub display_interval_config { '. &mt('Display:').' - '); if (ref($interval_titles) eq 'HASH') { @@ -1120,12 +1128,28 @@ sub check_discussions { sub check_handgraded { my ($resource,$symb,$title,$cdom,$cnum,$ungraded,$tograde) = @_; if ($resource->is_problem()) { - my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb); + my ($handgradeable,$is_task); my $partlist=$resource->parts(); - my $handgradeable; - foreach my $part (@$partlist) { - if ($resource->handgrade($part) eq 'yes') { - $handgradeable=1; last; + 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; + } + } } } if ($handgradeable) { @@ -1134,6 +1158,7 @@ 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(); @@ -1230,8 +1255,10 @@ sub check_thresholds { '.$stats{$part}{degdiff}.' '.$lastreset{$part}.''; if ($checkallowed->{'resetcounters'}) { + my $aria = ' aria-label="'.&mt('Reset counter for [_1] (part [_2])', + $$triggered{$symb}{title},$part).'"'; $$triggered{$symb}{text}[$partcount] .= - ''. + ''. ''; } $partcount ++; @@ -1799,13 +1826,24 @@ sub display_handgrade { foreach my $res (@{$tograde}) { $rowNum ++; my $css_class = $rowNum%2?' class="LC_odd_row"':''; - my $linkurl='/adm/grades'; - if ($$ungraded{$res}{'enclink'}) { - $linkurl.='?symb='.$$ungraded{$res}{'encsymb'}; + 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'}; + } } else { - $linkurl.='?symb='.&escape($res); + $linkurl='/adm/grades'; + if ($$ungraded{$res}{'enclink'}) { + $linkurl.='?symb='.$$ungraded{$res}{'encsymb'}; + } else { + $linkurl.='?symb='.&escape($res); + } + $linkurl.='&command=ungraded'; } - $linkurl.='&command=ungraded'; $r->print(''.$$ungraded{$res}{title}.''.$$ungraded{$res}{count}.''); } } elsif ($itemserror) {