version 1.1, 2005/04/05 22:49:17
|
version 1.4, 2005/04/07 04:22:03
|
Line 1
|
Line 1
|
|
# |
|
# $Id$ |
|
# |
|
# 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; |
package Apache::lonwhatsnew; |
|
|
use strict; |
use strict; |
use lib qw(/home/httpd/lib/perl); |
use lib qw(/home/httpd/lib/perl); |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon; |
use Apache::loncommon(); |
use Apache::lonhtmlcommon; |
use Apache::lonhtmlcommon(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::loncoursedata; |
use Apache::loncoursedata(); |
use Apache::lonnavmaps; |
use Apache::lonnavmaps(); |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
use Time::Local; |
use Time::Local; |
|
|
Line 150 sub display_nav_box {
|
Line 177 sub display_nav_box {
|
#------------------------------- |
#------------------------------- |
|
|
sub display_header{ |
sub display_header{ |
|
my $html=&Apache::lonxml::xmlbegin(); |
my $bodytag=&Apache::loncommon::bodytag('Course Action Items'); |
my $bodytag=&Apache::loncommon::bodytag('Course Action Items'); |
return(<<ENDHEAD); |
return(<<ENDHEAD); |
<html> |
$html |
<head> |
<head> |
<title>Course Action Items</title> |
<title>Course Action Items</title> |
</head> |
</head> |
Line 223 END
|
Line 251 END
|
my $rowNum = 0; |
my $rowNum = 0; |
foreach my $ressymb (@newdiscussions) { |
foreach my $ressymb (@newdiscussions) { |
my $forum_title = $unread{$ressymb}{'title'}; |
my $forum_title = $unread{$ressymb}{'title'}; |
my ($map,$ind,$url)=&Apache::lonnet::decode_symb($ressymb); |
my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb); |
my $feedurl = &Apache::lonnet::clutter($url); |
my $unreadnum = keys(%{$unread{$ressymb}}); |
# backward compatibility (bulletin boards used to be 'wrapped') |
|
if ($feedurl=~m|^/adm/wrapper/adm/.*/bulletinboard$|) { |
|
$feedurl=~s|^/adm/wrapper||; |
|
} |
|
my $unreadnum = keys %{$unread{$ressymb}}; |
|
$unreadnum = $unreadnum - 2; |
$unreadnum = $unreadnum - 2; |
if ($unreadnum > 0) { |
if ($unreadnum > 0) { |
if ($rowNum %2 == 1) { |
if ($rowNum %2 == 1) { |
Line 389 sub getitems {
|
Line 412 sub getitems {
|
my @discussions = (); |
my @discussions = (); |
my ($classlist,$keylist) = &Apache::loncoursedata::get_classlist(); |
my ($classlist,$keylist) = &Apache::loncoursedata::get_classlist(); |
|
|
foreach (keys %lastread) { |
foreach my $key (keys(%lastread)) { |
my $key = $_; |
my $newkey = $key; |
$key =~ s/_lastread$//; |
$newkey =~ s/_lastread$//; |
$lastreadtime{$key} = $lastread{$_}; |
$lastreadtime{$newkey} = $lastread{$key}; |
} |
} |
foreach my $resource (@allres) { |
foreach my $resource (@allres) { |
my $result = ''; |
my $result = ''; |
Line 403 sub getitems {
|
Line 426 sub getitems {
|
my $title = $resource->compTitle(); |
my $title = $resource->compTitle(); |
my $ressymb = $symb; |
my $ressymb = $symb; |
if ($ressymb =~ m-(___adm/\w+/\w+)/(\d+)/bulletinboard$-) { |
if ($ressymb =~ m-(___adm/\w+/\w+)/(\d+)/bulletinboard$-) { |
$ressymb = 'bulletin___'.$2.$1.'/'.$2.'/bulletinboard'; |
$ressymb = &Apache::lonfeedback::wrap_symb('bulletin___'.$2.$1.'/'. |
unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) { |
$2.'/bulletinboard'); |
$ressymb=~s|(bulletin___\d+___)|$1adm/wrapper/|; |
|
} |
|
} |
} |
|
|
# Check for unread discussion postings |
# Check for unread discussion postings |
Line 442 sub getitems {
|
Line 463 sub getitems {
|
my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb); |
my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb); |
my ($partlist,$handgrade,$responseType) = &Apache::grades::response_type($url,$symb); |
my ($partlist,$handgrade,$responseType) = &Apache::grades::response_type($url,$symb); |
foreach my $student (keys(%$classlist)) { |
foreach my $student (keys(%$classlist)) { |
my ($uname,$udom) = split/:/,$student; |
my ($uname,$udom) = split(/:/,$student); |
my %status=&Apache::grades::student_gradeStatus($url,$symb,$udom,$uname,$partlist); |
my %status=&Apache::grades::student_gradeStatus($url,$symb,$udom,$uname,$partlist); |
my $submitted = 0; |
my $submitted = 0; |
my $graded = 0; |
my $graded = 0; |
Line 483 sub getmail {
|
Line 504 sub getmail {
|
my ($newmsgs,$critmsgs) = @_; |
my ($newmsgs,$critmsgs) = @_; |
# Check for unread mail in course |
# Check for unread mail in course |
my $msgcount = 0; |
my $msgcount = 0; |
my @msgids = sort split(/\&/,&Apache::lonnet::reply |
|
('keys:'.$ENV{'user.domain'}.':'. |
my @messages = &Apache::lonnet::getkeys('nohist_email'); |
$ENV{'user.name'}.':nohist_email', |
foreach my $message (@messages) { |
$ENV{'user.home'})); |
my $msgid=&Apache::lonnet::escape($message); |
foreach my $msgid (@msgids) { |
|
my ($sendtime,$shortsubj,$fromname,$fromdom,$fromcid,$status)= |
my ($sendtime,$shortsubj,$fromname,$fromdom,$fromcid,$status)= |
&Apache::lonmsg::unpackmsgid($msgid); |
&Apache::lonmsg::unpackmsgid($msgid); |
if ($fromcid eq $ENV{'request.course.id'}) { |
if ($fromcid eq $ENV{'request.course.id'}) { |
Line 512 sub getmail {
|
Line 532 sub getmail {
|
my %what=&Apache::lonnet::dump('critical'); |
my %what=&Apache::lonnet::dump('critical'); |
my $result = ''; |
my $result = ''; |
my $critmsgcount = 0; |
my $critmsgcount = 0; |
foreach my $msgid (sort keys %what) { |
foreach my $msgid (sort(keys(%what))) { |
my ($sendtime,$shortsubj,$fromname,$fromdom,$fromcid,$status)= |
my ($sendtime,$shortsubj,$fromname,$fromdom,$fromcid,$status)= |
&Apache::lonmsg::unpackmsgid($_); |
&Apache::lonmsg::unpackmsgid($_); |
if ($fromcid eq $ENV{'request.course.id'}) { |
if ($fromcid eq $ENV{'request.course.id'}) { |