--- loncom/interface/lonwhatsnew.pm 2005/07/10 02:31:30 1.23
+++ loncom/interface/lonwhatsnew.pm 2005/09/12 01:45:25 1.28
@@ -1,5 +1,5 @@
#
-# $Id: lonwhatsnew.pm,v 1.23 2005/07/10 02:31:30 albertel Exp $
+# $Id: lonwhatsnew.pm,v 1.28 2005/09/12 01:45:25 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,6 +38,7 @@ use Apache::lonnavmaps();
use Apache::lonuserstate;
use Apache::Constants qw(:common :http);
use Time::Local;
+use GDBM_File;
#----------------------------
# handler
@@ -190,10 +191,12 @@ sub display_actions_box() {
$r->print('
You are accessing an invalid course.
');
return;
}
-
- my ($furl,$ferr)=
- &Apache::lonuserstate::readmap($cdom.'/'.$crs);
- $r->print('Go to first resource
Change your preferences to suppress display of this screen when accessing courses as Course Coordinator in the future.
');
+ if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db',
+ &GDBM_READER(),0640)) {
+ my $furl=$bighash{'first_url'};
+ $r->print('Go to first resource
Change your preferences to suppress display of this screen when accessing courses as Course Coordinator in the future.
');
+ untie(%bighash);
+ }
my $result;
@@ -205,6 +208,7 @@ sub display_actions_box() {
if ($result) {
$r->print($result.'
');
}
+ $r->rflush();
&get_curr_thresholds(\%threshold,$cdom,$crs);
&getitems(\%unread,\%ungraded,\%bombed,\%triggered,\@newdiscussions,\@tograde,\@bombs,\@warnings,$rowColor1,$rowColor2,\%threshold,$cdom,$crs,%res_title);
@@ -418,7 +422,7 @@ END
} else {
$rowColor = $rowColor2;
}
- $r->print(''.$mailcount.'. | '.$msg->{'shortsub'}.' | '.$msg->{'from'}.'@'.$msg->{'fromdom'}.' | '.$msg->{'sendtime'}.' |
');
+ $r->print(''.$mailcount.'. | '.$msg->{'shortsub'}.' | '.$msg->{'from'}.'@'.$msg->{'fromdom'}.' | '.$msg->{'sendtime'}.' |
');
$rowNum ++;
$mailcount ++;
}
@@ -504,7 +508,8 @@ sub display_config_box() {
sub getitems {
my ($unread,$ungraded,$bombed,$triggered,$newdiscussions,$tograde,$bombs,$warnings,$rowColor1,$rowColor2,$threshold,$cdom,$crs,$res_title) = @_;
my $navmap = Apache::lonnavmaps::navmap->new();
- my @allres=$navmap->retrieveResources();
+ # force retrieve Resource to seed the part id cache we'll need it later
+ my @allres=$navmap->retrieveResources(undef,sub {if ($_[0]->is_problem) { $_[0]->parts();} return 1;});
my %discussiontime = &Apache::lonnet::dump('discussiontimes',$cdom,$crs);
my %lastread = &Apache::lonnet::dump('nohist_'.$env{'request.course.id'}.
'_discuss',$env{'user.domain'},$env{'user.name'},'lastread');
@@ -561,11 +566,12 @@ sub getitems {
if ($resource->is_problem()) {
my $ctr = 0;
my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
- my ($partlist,$handgrade,$responseType) =
- &Apache::grades::response_type($url,$symb);
+ my $partlist=$resource->parts();
my $handgradeable;
- foreach my $value (values(%{$handgrade})) {
- if ($value eq 'yes') { $handgradeable=1; last; }
+ foreach my $part (@$partlist) {
+ if ($resource->handgrade($part) eq 'yes') {
+ $handgradeable=1; last;
+ }
}
if ($handgradeable) {
foreach my $student (keys(%$classlist)) {