--- loncom/interface/lonwhatsnew.pm 2005/04/29 14:54:18 1.12 +++ loncom/interface/lonwhatsnew.pm 2005/12/05 19:27:53 1.35 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.12 2005/04/29 14:54:18 raeburn Exp $ +# $Id: lonwhatsnew.pm,v 1.35 2005/12/05 19:27:53 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,8 +35,10 @@ use Apache::lonhtmlcommon(); use Apache::lonlocal; use Apache::loncoursedata(); use Apache::lonnavmaps(); +use Apache::lonuserstate; use Apache::Constants qw(:common :http); use Time::Local; +use GDBM_File; #---------------------------- # handler @@ -52,36 +54,40 @@ sub handler { } &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['command']); - my $command = $env{'form.command'}; - - if ($command eq '') { - $command = "info"; + my $command; + if ($env{'form.action'} eq 'reset') { + $command = 'reset'; + } elsif ($env{'form.action'} eq 'update') { + $command = 'update'; + } else { + $command = $env{'form.command'}; } &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - $r->print(&display_header()); - if (! (($env{'request.course.fn'}) && (&Apache::lonnet::allowed('vsa',$env{'request.course.id'})))) { - # Not in a course, or not allowed to modify parms - $env{'user.error.msg'}="/adm/whatsnew:vsa:0:0:Cannot display student activity"; + $r->print(&display_header($command)); + if (! (($env{'request.course.fn'}) && (&Apache::lonnet::allowed('bre',$env{'request.course.id'})))) { + # Not in a course, or not allowed to view action items + $env{'user.error.msg'}="/adm/whatsnew:bre:0:0:Cannot display what's new screen"; return HTTP_NOT_ACCEPTABLE; } &Apache::lonhtmlcommon::clear_breadcrumbs(); - if ($command eq 'config') { + if (($command eq 'chgthreshold') && (&Apache::lonnet::allowed('vgr',$env{'request.course.id'}))) { &Apache::lonhtmlcommon::add_breadcrumb - ({href=>'/adm/whatsnew?command=config', - text=>"Configure display"}); + ({href=>'/adm/whatsnew?command=threshold', + text=>"Change thresholds"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Course Action Items','Course_Action_Items_Config')); + (undef,'Course Action Items','Course_Action_Items_Thresholds')); } else { &Apache::lonhtmlcommon::add_breadcrumb - ({href=>'/adm/whatsnew?command=info', + ({href=>'/adm/whatsnew', text=>"Display Action Items"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs (undef,'Course Action Items','Course_Action_Items_Display')); } &display_main_box($r,$command); + return OK; } #------------------------------ @@ -94,30 +100,20 @@ sub display_main_box { my ($r,$command) = @_; my $domain=&Apache::loncommon::determinedomain(); my $tabbg=&Apache::loncommon::designparm('coordinator.tabbg',$domain); - my $selconfig; - my $selinfo; - if ($command eq 'config') { - $selinfo = 'selected="selected"'; - } else { - $selconfig = 'selected="selected"'; - } - my $picker = (' -
'); - $r->print('');
-
- if ($command eq 'config') {
- &display_config_box($r,$picker);
+
+ my %threshold_titles = (
+ av_attempts => 'Average number of attempts',
+ degdiff => 'Degree of difficulty',
+ numstudents => 'Total number of students with submissions',
+ );
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+
+ if (($command eq 'chgthreshold') && (&Apache::lonnet::allowed('vgr',$env{'request.course.id'}))) {
+ &display_config_box($r,$command,$tabbg,\%threshold_titles,$cdom,$crs);
} else {
- &display_actions_box($r,$picker);
+ &display_actions_box($r,$command,\%threshold_titles,$cdom,$crs);
}
$r->print(< '); + $r->print(' '); return; } - $r->print(''.$picker.'
'); + my @actionorder = ('handgrading','haserrors','abovethreshold','versionchanges','coursediscussion','coursenormalmail','coursecritmail'); -## BOMBS ## - $r->print(<<"END"); -
'); -# DEGDIFF AND AV. TRIES TRIGGERS - $r->print(<<"END"); -
'); - $r->print(' | ');
-## UNREAD COURSE DISCUSSION POSTS ##
- $r->print(<<"END");
-
'); -## MESSAGES ## - $r->print(<
- |
|
New critical messages in course | -||||||||||||
-
|
');
+ my ($r,$command,$tabbg,$threshold_titles,$cdom,$crs) = @_;
+ my %threshold = ();
+ my $rowColor1 = "#ffffff";
+ my $rowColor2 = "#eeeeee";
+ my $rowColor;
+
+ my @thresholditems = ("av_attempts","degdiff","numstudents");
+ my %threshold_titles = (
+ av_attempts => 'Average number of attempts',
+ degdiff => 'Degree of difficulty',
+ numstudents => 'Total number of students with submissions',
+ );
+ &get_curr_thresholds(\%threshold,$cdom,$crs);
+
+ $r->print(' |