--- loncom/interface/lonwhatsnew.pm 2012/02/11 17:58:17 1.101.2.1.2.2 +++ loncom/interface/lonwhatsnew.pm 2013/03/05 22:51:48 1.111 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.101.2.1.2.2 2012/02/11 17:58:17 raeburn Exp $ +# $Id: lonwhatsnew.pm,v 1.111 2013/03/05 22:51:48 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -285,6 +285,11 @@ END $scripttag.='document.visible.submit(); } +function thresholdreset() { + document.visible.command.value="reset"; + document.visible.submit(); +} + function togglelogins() { var total = document.visible.logincount.value; var sumrow = document.visible.loginrow.value; @@ -527,28 +532,33 @@ sub display_actions_box { $headings{'crslogin'} = &mt('Last login for users in last 24 hours'); } - my $now = time; + my ($now,$starttime,$activatedstart,$expiredstart,$crsloginstart); + $now = time; + if ($timediff{'versions'} == -1) { - $timediff{'versions'} = time; + $starttime = 0; + } else { + $starttime = $now - $timediff{'versions'}; } - my $starttime = $now - $timediff{'versions'}; if ($timediff{'newroles'} == -1) { - $timediff{'newroles'} = time; + $activatedstart = 0; + } else { + $activatedstart = $now - $timediff{'newroles'}; } - my $activatedstart = $now - $timediff{'newroles'}; if ($timediff{'oldroles'} == -1) { - $timediff{'oldroles'} = time; + $expiredstart = 0; + } else { + $expiredstart = $now - $timediff{'oldroles'}; } - my $expiredstart = $now - $timediff{'oldroles'}; if ($timediff{'crslogin'} == -1) { - $timediff{'crslogin'} = time; + $crsloginstart = 0; + } else { + $crsloginstart = $now - $timediff{'crslogin'}; } - my $crsloginstart = $now - $timediff{'crslogin'}; - my $countunread = $display_settings{$cid.':countunread'}; unless (defined($countunread)) { $countunread = 'on'; @@ -917,7 +927,6 @@ sub display_launcher { } elsif ($action eq 'crslogin') { #LAST LOGIN &display_crslogins($r,$logincount,$loggedin,$interval->{'crslogin'}, $crstype); - } } &end_box($r); @@ -1097,6 +1106,7 @@ sub check_thresholds { $av_attempts = $attempts/$users; $av_attempts = sprintf("%.2f",$av_attempts); } + &Apache::lonnet::statslog($symb,$part,$users,$av_attempts,$degdiff); if ((($degdiff ne '' && $degdiff >= $$threshold{'degdiff'}) || ($av_attempts ne '' && $av_attempts >= $$threshold{'av_attempts'})) && ($users >= $$threshold{'numstudents'})) { $stats{$part}{degdiff} = $degdiff; $stats{$part}{attempts} = $av_attempts; @@ -1335,15 +1345,13 @@ sub getactivated { my (%stucounted,%advcounted); my $activatedcount = 0; if (keys(%changes) > 0) { - foreach my $chg (sort { $b <=> $a } (keys(%changes))) { + foreach my $chg (keys(%changes)) { if (ref($changes{$chg}) eq 'HASH') { - my $timestamp = $changes{$chg}{'exe_time'}; - if ($timestamp) { - if ($rolechgtime > 0) { - if ($timestamp < $rolechgtime) { - last; - } - } + if ($rolechgtime > 0) { + next if ($changes{$chg}{'exe_time'} < $rolechgtime); + } + if ($changes{$chg}{'exe_time'}) { + my $timestamp = $changes{$chg}{'exe_time'}; if (ref($changes{$chg}{'logentry'}) eq 'HASH') { next if ($changes{$chg}{'delflag'}); my $start = $changes{$chg}{'logentry'}{'start'}; @@ -1604,13 +1612,13 @@ sub display_handgrade { foreach my $res (@{$tograde}) { $rowNum ++; my $css_class = $rowNum%2?' class="LC_odd_row"':''; - my ($map,$id,$url)=&Apache::lonnet::decode_symb($res); - my $linkurl=&Apache::lonnet::clutter($url); - $linkurl .= '?symb='.&escape($res); + my $linkurl='/adm/grades'; if ($$ungraded{$res}{'enclink'}) { - $linkurl = - $$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'}; - } + $linkurl.='?symb='.$$ungraded{$res}{'encsymb'}; + } else { + $linkurl.='?symb='.&escape($res); + } + $linkurl.='&command=ungraded'; $r->print('