--- loncom/interface/lonwhatsnew.pm 2009/12/14 22:24:31 1.98.2.1
+++ loncom/interface/lonwhatsnew.pm 2012/05/10 19:01:40 1.105.2.1
@@ -1,5 +1,5 @@
#
-# $Id: lonwhatsnew.pm,v 1.98.2.1 2009/12/14 22:24:31 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.105.2.1 2012/05/10 19:01:40 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -88,7 +88,7 @@ sub handler {
if ( ! $env{'request.course.fn'} || ! $checkallowed{'whatsnew'}) {
# Not in a course, or no whn priv in course
- $env{'user.error.msg'}="/adm/whatsnew::whn:0:0:Cannot display what's new page";
+ $env{'user.error.msg'}="/adm/whatsnew:whn:0:0:Cannot display what's new page";
return HTTP_NOT_ACCEPTABLE;
}
@@ -282,7 +282,6 @@ END
sub display_actions_box {
my ($r,$command,$refpage,$threshold_titles,$interval_titles,$initpage,
$cdom,$crs,$checkallowed) = @_;
- my $custommenu = &Apache::loncommon::needs_gci_custom();
my $udom = $env{'user.domain'};
my $uname = $env{'user.name'};
my $cid = $env{'request.course.id'};
@@ -344,7 +343,7 @@ sub display_actions_box {
}
my $header = '';
- if (($refpage eq 'start') && (!$custommenu)) {
+ if ($refpage eq 'start') {
if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db',
&GDBM_READER(),0640)) {
my $furl=&HTML::Entities::encode($bighash{'first_url'},'"<>&');
@@ -353,8 +352,7 @@ sub display_actions_box {
'
';
}
}
- unless ($custommenu) {
- $header .= &mt('Page set to be displayed after you have selected a role in this '.$lctype).'.'
+ $header .= &mt('Page set to be displayed after you have selected a role in this '.$lctype).'.'
.' '
.&mt('Currently: [_1].',''.$currinit.'')
.' '
@@ -367,8 +365,7 @@ sub display_actions_box {
,'')
.' ';
- $r->print(&Apache::loncommon::head_subbox($header));
- }
+ $r->print(&Apache::loncommon::head_subbox($header));
if ($command eq 'reset') {
$result = &process_reset($cdom,$crs);
@@ -477,12 +474,7 @@ sub display_actions_box {
$threshold{'av_attempts'},$threshold{'degdiff'},
'
',$threshold{'numstudents'});
- my @actionorder;
- if ($custommenu) {
- @actionorder = ('coursenormalmail','coursecritmail','newroles','oldroles');
- } else {
- @actionorder = ('handgrading','haserrors','abovethreshold','versionchanges','coursediscussion','coursenormalmail','coursecritmail','newroles','oldroles');
- }
+ my @actionorder = ('handgrading','haserrors','abovethreshold','versionchanges','coursediscussion','coursenormalmail','coursecritmail','newroles','oldroles');
foreach my $key (keys(%{$checkallowed})) {
if ($key =~ /_section$/) { next; }
@@ -543,9 +535,6 @@ sub display_actions_box {
}
my $halfway = 4;
# my $halfway = int($totalboxes/2) + $totalboxes%2;
- if ($custommenu) {
- $halfway = 2;
- }
foreach my $actionitem (@actionorder) {
if ($$checkallowed{$actionitem}) {
if ($displayed == $halfway) {
@@ -985,6 +974,9 @@ sub check_thresholds {
if ($resource->handgrade($part) eq 'yes') {
next;
}
+ if ($resource->is_anonsurvey($part)) {
+ next;
+ }
if ($resource->is_survey($part)) {
next;
}
@@ -1007,6 +999,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;
@@ -1141,7 +1134,7 @@ sub process_reset {
sub process_update {
my ($uname,$udom,$threshold_titles) = @_;
- my $setoutput = ''.&mt('Changes to threshold(s) for problem tracking:').'
';
+ my $setoutput = ''.&mt('Changes to threshold(s) for problem tracking:').'
';
foreach (keys %env) {
next if ($_!~/^form\.(.+)\_setparmval$/);
my $name = $1;
@@ -1152,17 +1145,17 @@ sub process_update {
my ($shortname) = ($name =~ /^\Q$env{'request.course.id'}\E:threshold_(.+)$/);
if ($put_result eq 'ok') {
- $setoutput.=&mt('Set threshold for [_1] to [_2]',
+ $setoutput.= &Apache::lonhtmlcommon::confirm_success(&mt('Set threshold for [_1] to [_2]',
''.$$threshold_titles{$shortname}.'',
- ''.$value.'').'
';
+ ''.$value.'').'
');
} else {
- $setoutput.=&mt('Unable to set threshold for [_1] to [_2] due to [_3].',
+ $setoutput.= &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set threshold for [_1] to [_2] due to [_3].',
''.$name.'',''.$value.'',
- ''.$put_result.'').'
';
+ ''.$put_result.'').'
',1);
}
}
}
- return $setoutput;
+ return &Apache::loncommon::confirmwrapper($setoutput);
}
sub getnormalmail {
@@ -1177,7 +1170,6 @@ sub getnormalmail {
&Apache::lonmsg::unpackmsgid($msgid);
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) {
if (defined($sendtime) && $sendtime!~/error/) {
- my $numsendtime = $sendtime;
if ($status eq 'new') {
$sendtime = &Apache::lonlocal::locallocaltime($sendtime);
$msgcount ++;
@@ -1209,7 +1201,6 @@ sub getcritmail {
&Apache::lonmsg::unpackmsgid($msgid);
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) {
if (defined($sendtime) && $sendtime!~/error/) {
- my $numsendtime = $sendtime;
$sendtime = &Apache::lonlocal::locallocaltime($sendtime);
$critmsgcount ++;
if ($shortsubj eq '') {
@@ -1444,7 +1435,7 @@ sub checkversions {
'lastrevisiondate');
$revdate = &Apache::lonlocal::locallocaltime($revdate);
my $linkurl=&Apache::lonnet::clutter($key);
- my $usedversion=$navmap->usedVersion('version_'.$linkurl);
+ my $usedversion=$navmap->usedVersion($linkurl);
my @resources = $navmap->getResourceByUrl($linkurl,1);
if (($usedversion) && ($usedversion ne 'mostrecent')) {
$version = $usedversion;
@@ -1487,9 +1478,9 @@ sub display_handgrade {
my $linkurl=&Apache::lonnet::clutter($url);
$linkurl .= '?symb='.&escape($res);
if ($$ungraded{$res}{'enclink'}) {
- $linkurl =
+ $linkurl =
$$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'};
- }
+ }
$r->print('