--- loncom/interface/lonwhatsnew.pm 2005/04/05 22:49:17 1.1
+++ loncom/interface/lonwhatsnew.pm 2005/06/09 18:41:08 1.21
@@ -1,13 +1,41 @@
+#
+# $Id: lonwhatsnew.pm,v 1.21 2005/06/09 18:41:08 albertel Exp $
+#
+# Copyright Michigan State University Board of Trustees
+#
+# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
+#
+# LON-CAPA is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# LON-CAPA is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with LON-CAPA; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# /home/httpd/html/adm/gpl.txt
+#
+# http://www.lon-capa.org/
+#
+
+
package Apache::lonwhatsnew;
use strict;
use lib qw(/home/httpd/lib/perl);
use Apache::lonnet;
-use Apache::loncommon;
-use Apache::lonhtmlcommon;
+use Apache::loncommon();
+use Apache::lonhtmlcommon();
use Apache::lonlocal;
-use Apache::loncoursedata;
-use Apache::lonnavmaps;
+use Apache::loncoursedata();
+use Apache::lonnavmaps();
+use Apache::lonuserstate;
use Apache::Constants qw(:common :http);
use Time::Local;
@@ -18,22 +46,47 @@ use Time::Local;
sub handler {
my $r = shift;
+ if ($r->header_only) {
+ &Apache::loncommon::content_type($r,'text/html');
+ $r->send_http_header;
+ return OK;
+ }
&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'})))) {
+ 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";
+ $env{'user.error.msg'}="/adm/whatsnew:vsa:0:0:Cannot display student activity";
return HTTP_NOT_ACCEPTABLE;
}
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ if ($command eq 'chgthreshold') {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>'/adm/whatsnew?command=threshold',
+ text=>"Change thresholds"});
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs
+ (undef,'Course Action Items','Course_Action_Items_Thresholds'));
+ } else {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({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;
}
#------------------------------
@@ -46,63 +99,22 @@ sub display_main_box {
my ($r,$command) = @_;
my $domain=&Apache::loncommon::determinedomain();
my $tabbg=&Apache::loncommon::designparm('coordinator.tabbg',$domain);
- $r->print(<
-
-
');
+
+# DEGDIFF AND AV. TRIES TRIGGERS
+ $r->print(<<"END");
+
+
+
+
+
+
Problems with av. attempts ≥ $threshold{'av_attempts'} or deg. difficulty ≥ $threshold{'degdiff'} and total number of students with submissions ≥ $threshold{'numstudents'}