--- loncom/interface/lonwhatsnew.pm 2010/08/09 23:39:43 1.98.2.2
+++ loncom/interface/lonwhatsnew.pm 2010/09/19 15:05:59 1.98.2.4
@@ -1,5 +1,5 @@
#
-# $Id: lonwhatsnew.pm,v 1.98.2.2 2010/08/09 23:39:43 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.98.2.4 2010/09/19 15:05:59 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -197,10 +197,10 @@ sub display_main_box {
86400 => 'roles which expired since yesterday',
);
my %crslogins = (
- -1 => 'last login for anyone who has ever logged in',
- 2592000 => 'last login for users in last 30 days',
- 604800 => 'last login for users in last 7 days',
- 86400 => 'last login for users in last 24 hours',
+ -1 => 'last logins for anyone who has ever logged in',
+ 2592000 => 'last logins for users in last 30 days',
+ 604800 => 'last logins for users in last 7 days',
+ 86400 => 'last logins for users in last 24 hours',
);
my %interval_titles = (
versions => \%versions,
@@ -267,6 +267,7 @@ sub display_header {
$command eq 'chgnewroleinterval' || $command eq 'chgcrslogininterval') {
$scripttag = <<"END";
';
}
@@ -556,17 +558,21 @@ sub display_actions_box {
$countunread = 'on';
}
if ($$checkallowed{'abovethreshold'}) {
- &get_curr_thresholds(\%threshold,$uname,$udom,$cid,$cdom,$crs);
+ &get_curr_thresholds(\%threshold,$uname,$udom,$cid,$cdom,$crs,$custommenu);
}
- $headings{'abovethreshold'} =
- &mt('(Problems with av. attempts ≥ [_1] or deg. difficulty ≥ [_2]) [_3] and total number of '.$stulabel{$crstype}.' with submissions ≥ [_4]',
- $threshold{'av_attempts'},$threshold{'degdiff'},
- '
',$threshold{'numstudents'});
+ if ($custommenu) {
+ $headings{'abovethreshold'} = &mt('Questions with submissions');
+ } else {
+ $headings{'abovethreshold'} =
+ &mt('(Problems with av. attempts ≥ [_1] or deg. difficulty ≥ [_2]) [_3] and total number of '.$stulabel{$crstype}.' with submissions ≥ [_4]',
+ $threshold{'av_attempts'},$threshold{'degdiff'},
+ '
',$threshold{'numstudents'});
+ }
my @actionorder;
if ($custommenu) {
- @actionorder = ('coursenormalmail','coursecritmail','newroles','oldroles','crslogin');
+ @actionorder = ('coursenormalmail','coursecritmail','abovethreshold','newroles','oldroles','crslogin');
} else {
@actionorder = ('handgrading','haserrors','abovethreshold','versionchanges','coursediscussion','coursenormalmail','coursecritmail','newroles','oldroles');
}
@@ -593,7 +599,7 @@ sub display_actions_box {
my $itemserror;
if ($needitems) {
- $itemserror = &getitems(\%unread,\%ungraded,\%bombed,\%triggered,\%changed,\@newdiscussions,\@tograde,\@bombs,\@warnings,\%threshold,$cdom,$crs,\%res_title,\%show,$starttime,$countunread);
+ $itemserror = &getitems(\%unread,\%ungraded,\%bombed,\%triggered,\%changed,\@newdiscussions,\@tograde,\@bombs,\@warnings,\%threshold,$cdom,$crs,\%res_title,\%show,$starttime,$countunread,$custommenu);
}
if ($show{'coursenormalmail'}) {
$msgcount = &getnormalmail(\@newmsgs);
@@ -621,7 +627,11 @@ sub display_actions_box {
}
}
- $r->print('
');
+ $r->print('');
+ unless($custommenu) {
+ $r->print('');
+ }
+ $r->print('
' .&mt('Choose whether or not to display a count of the number of new posts for each resource or discussion board which has unread posts.') @@ -897,10 +912,10 @@ sub display_launcher { $tograde,$ungraded,$bombs,$bombed,$changed,$warnings,$triggered, $newdiscussions,$unread,$msgcount,$newmsgs,$critmsgcount,$critmsgs, $interval,$countunread,$expired,$expirecount,$activated,$activecount, - $crstype,$itemserror,$loggedin,$logincount) = @_; + $crstype,$itemserror,$loggedin,$logincount,$custommenu) = @_; if ($$checkallowed{$action}) { - &start_box($r,$show,$headings,$action,$refpage,$action); + &start_box($r,$show,$headings,$action,$refpage,$action,$custommenu); if ($$show{$action}) { if ($action eq 'handgrading') { # UNGRADED ITEMS &display_handgrade($r,$tograde,$ungraded,$itemserror); @@ -910,7 +925,7 @@ sub display_launcher { &display_versionchanges($r,$changed,$res_title,$interval->{'versions'},$itemserror); } elsif ($action eq 'abovethreshold') { # DEGDIFF/AV. TRIES TRIGGERS &display_abovethreshold($r,$refpage,$warnings,$triggered, - $res_title,$itemserror); + $res_title,$itemserror,$custommenu); } elsif ($action eq 'coursediscussion') { # UNREAD COURSE DISCUSSION &display_coursediscussion($r,$newdiscussions,$unread, $countunread,$res_title,$itemserror); @@ -938,7 +953,7 @@ sub display_launcher { sub getitems { my ($unread,$ungraded,$bombed,$triggered,$changed,$newdiscussions, $tograde,$bombs,$warnings,$threshold,$cdom,$crs,$res_title,$show, - $starttime,$countunread) = @_; + $starttime,$countunread,$custommenu) = @_; my $navmap = Apache::lonnavmaps::navmap->new(); if (!defined($navmap)) { my $itemserror = ''.&mt('An error occurred retrieving information about the course.').' '.&mt('It is recommended that you [_1]re-select the course[_2].','','').''; @@ -998,7 +1013,7 @@ sub getitems { # Maxtries and degree of difficulty for problem parts, unless handgradeable if ($$show{'abovethreshold'}) { &check_thresholds($resource,$symb,\%resourcetracker, - $triggered,$threshold,$warnings); + $triggered,$threshold,$warnings,$custommenu); } } @@ -1072,7 +1087,7 @@ sub check_bombed { } sub check_thresholds { - my ($resource,$symb,$resourcetracker,$triggered,$threshold,$warnings) = @_; + my ($resource,$symb,$resourcetracker,$triggered,$threshold,$warnings,$custommenu) = @_; # Compile maxtries and degree of difficulty for problem parts, unless handgradeable my @parts = @{$resource->parts()}; my %stats; @@ -1130,12 +1145,17 @@ sub check_thresholds { $$triggered{$symb}{text}[$partcount] = ' | '.&mt('single part').' | '; } - $$triggered{$symb}{text}[$partcount] .= ' -'.$stats{$part}{users}.' | -'.$stats{$part}{attempts}.' | -'.$stats{$part}{degdiff}.' | -'.$lastreset{$part}.' | -'; + if ($custommenu) { + $$triggered{$symb}{text}[$partcount] .= ' + | '.$stats{$part}{users}.' | '; + } else { + $$triggered{$symb}{text}[$partcount] .= ' +'.$stats{$part}{users}.' | +'.$stats{$part}{attempts}.' | +'.$stats{$part}{degdiff}.' | +'.$lastreset{$part}.' | +'; + } $partcount ++; } $$triggered{$symb}{numparts} = $partcount; @@ -1146,7 +1166,14 @@ sub check_thresholds { sub get_curr_thresholds { - my ($threshold,$uname,$udom,$cid,$cdom,$crs) = @_; + my ($threshold,$uname,$udom,$cid,$cdom,$crs,$custommenu) = @_; + if ($custommenu) { + %$threshold = (av_attempts => 0, + degdiff => 0.00000000000000, + numstudents => 1 + ); + return; + } # set default values %$threshold = (av_attempts => 2, degdiff => 0.5, @@ -1658,7 +1685,7 @@ sub display_haserrors { } sub display_abovethreshold { - my ($r,$refpage,$warnings,$triggered,$res_title,$itemserror) = @_; + my ($r,$refpage,$warnings,$triggered,$res_title,$itemserror,$custommenu) = @_; my %lt = &Apache::lonlocal::texthash( reso => 'Resource', part => 'Part', @@ -1672,16 +1699,35 @@ sub display_abovethreshold { ); if (@{$warnings} > 0) { @{$warnings} = sort { &cmp_title($a,$b,$res_title) } @{$warnings}; - $r->print(''); + unless ($custommenu) { + $r->print(' | |||
'.$itemserror.' | |||||||||||||||
'.$lt{'number'}.' | '. ''.$lt{'role'}.' | '. - ''.$lt{'sec'}.' | '.$lt{'sec'}; my (%bylastname,%counts); if (ref($loggedin) eq 'HASH') { my @logins = sort { $b <=> $a } (keys(%{$loggedin})); @@ -1863,12 +1912,13 @@ sub display_crslogins { } } } + my $table; foreach my $person (sort(keys(%bylastname))) { if (ref($bylastname{$person}) eq 'ARRAY') { foreach my $item (@{$bylastname{$person}}) { $numlogin ++; my $css_class = $numlogin%2?' class="LC_odd_row"':''; - $r->print(' | '); + $table .= ' '; } } } @@ -1879,16 +1929,16 @@ sub display_crslogins { foreach my $sec (sort { $b <=> $a } (keys(%{$counts{$role}}))) { $numrow ++; my $css_class = $numrow%2?' class="LC_odd_row"':''; - $r->print('||||||||||||
'.$counts{$role}{$sec}.' | '. ''.$showrole.' | '. - ''.$sec.' | '.$sec.' | '; } } } - $r->print(''); + '" />'.$table); } } else { $r->print('||||||||||||
'. @@ -2157,7 +2207,7 @@ sub store_courseinit_setting { } sub start_box { - my ($r,$show,$heading,$caller,$refpage) = @_; + my ($r,$show,$heading,$caller,$refpage,$action,$custommenu) = @_; my %lt = &Apache::lonlocal::texthash( chth => 'Change thresholds?', chin => 'Change interval?', @@ -2182,7 +2232,7 @@ sub start_box { | '.$showhide.' | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
'.$lt{'chth'}.' |