version 1.16, 2005/06/03 19:33:37
|
version 1.21, 2005/06/09 18:41:08
|
Line 35 use Apache::lonhtmlcommon();
|
Line 35 use Apache::lonhtmlcommon();
|
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::loncoursedata(); |
use Apache::loncoursedata(); |
use Apache::lonnavmaps(); |
use Apache::lonnavmaps(); |
|
use Apache::lonuserstate; |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
use Time::Local; |
use Time::Local; |
|
|
Line 186 sub display_actions_box() {
|
Line 187 sub display_actions_box() {
|
my $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain); |
my $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain); |
|
|
unless ($env{'request.course.id'}) { |
unless ($env{'request.course.id'}) { |
$r->print('<br /><b><center>You are accessing an invalid course</center></b><br /><br />'); |
$r->print('<br /><b><center>You are accessing an invalid course.</center></b><br /><br />'); |
return; |
return; |
} |
} |
|
|
|
my ($furl,$ferr)= |
|
&Apache::lonuserstate::readmap($cdom.'/'.$crs); |
|
$r->print('<font size="+1"><a href="'.$furl.'">Go to first resource</a></font><a href="/adm/preferences?action=changecourseinit"></font><br />Change your preferences</a> to suppress display of this screen when accessing courses as Course Coordinator in the future.<br /><hr />'); |
|
|
my $result; |
my $result; |
|
|
if ($command eq 'reset') { |
if ($command eq 'reset') { |
Line 381 END
|
Line 386 END
|
} else { |
} else { |
$rowColor = $rowColor2; |
$rowColor = $rowColor2; |
} |
} |
$r->print('<tr bgcolor="'.$rowColor.'"><td valign="top"><small>'.$mailcount.'. <small></td><td valign="top"><small><a href="/adm/mail?">'.$msg->{'shortsub'}.'</a> </small></td><td valign="top"><small> '.$msg->{'from'}.'@'.$msg->{'fromdom'}.' </small></td><td valign="top"><small>'.$msg->{'sendtime'}.'</small></td></tr>'); |
$r->print('<tr bgcolor="'.$rowColor.'"><td valign="top"><small>'.$mailcount.'. <small></td><td valign="top"><small><a href="/adm/communicate">'.$msg->{'shortsub'}.'</a> </small></td><td valign="top"><small> '.$msg->{'from'}.'@'.$msg->{'fromdom'}.' </small></td><td valign="top"><small>'.$msg->{'sendtime'}.'</small></td></tr>'); |
$rowNum ++; |
$rowNum ++; |
$mailcount ++; |
$mailcount ++; |
} |
} |
Line 527 sub getitems {
|
Line 532 sub getitems {
|
$$res_title{$symb} = $title; |
$$res_title{$symb} = $title; |
my $ressymb = $resource->wrap_symb(); |
my $ressymb = $resource->wrap_symb(); |
# Check for unread discussion postings |
# Check for unread discussion postings |
if (defined($discussiontime{$ressymb})) { |
if ($resource->hasDiscussion()) { |
push(@discussions,$ressymb); |
push(@discussions,$ressymb); |
my $prevread = 0; |
my $prevread = 0; |
my $unreadcount = 0; |
my $unreadcount = 0; |
Line 556 sub getitems {
|
Line 561 sub getitems {
|
if ($resource->is_problem()) { |
if ($resource->is_problem()) { |
my $ctr = 0; |
my $ctr = 0; |
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); |
|
my $handgradeable; |
|
foreach my $value (values(%{$handgrade})) { |
|
if ($value eq 'yes') { $handgradeable=1; last; } |
|
} |
|
next if (!$handgradeable); |
|
|
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); |
Line 623 sub getitems {
|
Line 635 sub getitems {
|
$stats{$part}{degdiff} = $degdiff; |
$stats{$part}{degdiff} = $degdiff; |
$stats{$part}{attempts} = $av_attempts; |
$stats{$part}{attempts} = $av_attempts; |
$stats{$part}{users} = $users; |
$stats{$part}{users} = $users; |
my %resethash = &Apache::lonnet::restore($symb,'nohist_resourcetracker',$cdom,$crs); |
$lastreset{$part} = $resourcetracker{$symb."\0".$part."\0resettime"}; |
$lastreset{$part} = &get_counter_resets(\%resethash,$part); |
|
$warning = 1; |
$warning = 1; |
} |
} |
} |
} |
Line 665 sub getitems {
|
Line 676 sub getitems {
|
} |
} |
} |
} |
|
|
sub get_counter_resets { |
|
my ($resethash,$part) = @_; |
|
my $lastreset = 'None'; |
|
if ($$resethash{'version'}) { |
|
for (my $version=1;$version<=$$resethash{'version'};$version++) { |
|
if (exists($$resethash{$version.':'.$part."\0".'prev_attempts'})) { |
|
$lastreset = $$resethash{$version.':timestamp'}; |
|
} |
|
} |
|
} |
|
unless ($lastreset eq 'None') { |
|
$lastreset = localtime($lastreset); |
|
} |
|
return $lastreset; |
|
} |
|
|
|
sub get_curr_thresholds { |
sub get_curr_thresholds { |
my ($threshold,$cdom,$crs) = @_; |
my ($threshold,$cdom,$crs) = @_; |
my %coursesettings = &Apache::lonnet::dump('environment', |
my %coursesettings = &Apache::lonnet::dump('environment', |
Line 707 sub process_reset {
|
Line 702 sub process_reset {
|
); |
); |
my @resets = (); |
my @resets = (); |
my %titles = (); |
my %titles = (); |
foreach my $key (keys %env) { |
foreach my $key (keys(%env)) { |
next if ($key !~ /^form\.reset_(.+)$/); |
next if ($key !~ /^form\.reset_(.+)$/); |
my $title = &Apache::lonnet::unescape($env{'form.title_'.$1}); |
my $title = &Apache::lonnet::unescape($env{'form.title_'.$1}); |
my $reset_item = &Apache::lonnet::unescape($1); |
my $reset_item = &Apache::lonnet::unescape($1); |
my %curr_aggregates = &Apache::lonnet::dump('nohist_resourcetracker',$dom,$crs,$reset_item); |
my %curr_aggregates = &Apache::lonnet::dump('nohist_resourcetracker',$dom,$crs,$reset_item); |
my %resethash = (); |
|
my %aggregates = (); |
my %aggregates = (); |
my ($symb,$part) = split/\0/,$reset_item; |
my ($symb,$part) = split(/\0/,$reset_item); |
foreach my $type (@agg_types) { |
foreach my $type (@agg_types) { |
$aggregates{$reset_item."\0".$type} = 0; |
$aggregates{$reset_item."\0".$type} = 0; |
$resethash{$part."\0".'prev_'.$type} = $curr_aggregates{$reset_item."\0".$type}; |
|
} |
} |
|
$aggregates{$reset_item."\0".'resettime'} = time; |
my $putresult = &Apache::lonnet::put('nohist_resourcetracker',\%aggregates, |
my $putresult = &Apache::lonnet::put('nohist_resourcetracker',\%aggregates, |
$dom,$crs); |
$dom,$crs); |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
my $storeresult = &Apache::lonnet::cstore(\%resethash,$symb,'nohist_resourcetracker',$dom,$crs); |
|
$result .= $title.' -part '.$part.': '; |
$result .= $title.' -part '.$part.': '; |
my %new_aggregates = &Apache::lonnet::dump('nohist_resourcetracker',$dom,$crs,$reset_item); |
my %new_aggregates = &Apache::lonnet::dump('nohist_resourcetracker',$dom,$crs,$reset_item); |
foreach my $type (@agg_types) { |
foreach my $type (@agg_types) { |