--- loncom/html/adm/helper/resettimes.helper 2005/01/16 08:04:10 1.1 +++ loncom/html/adm/helper/resettimes.helper 2009/02/16 15:47:21 1.8 @@ -4,8 +4,8 @@ Select - Reset times on one or more maps for a single student. - Reset times on a single map for a section or whole clase. + Reset times on one or more folders/maps, resources or the course for a single student. + Reset times on a single folder/map, resource or the course for a section or the whole class. @@ -16,39 +16,69 @@ + + This is a list of first access times and what was accessed, please select those you want deleted. + - FinishStu my ($uname,$udom,$sec,$fullname)=split(':',$helper->{'VARS'}{'stu1'}); my %times=&Apache::lonnet::dump('firstaccesstimes',$udom,$uname, - "^$ENV{'request.course.id'}\0"); + "^$env{'request.course.id'}\0"); foreach my $res (sort(keys(%times))) { my (undef,$symb)=split("\0",$res); my $escsymb=&Apache::lonnet::escape($symb); - my $title=&Apache::lonnet::gettitle($symb); + my $title = + ($symb ne 'course') ? &Apache::lonnet::gettitle($symb) + : $env{'course.'.$env{'request.course.id'}.'.description'}; my $time=&Apache::lonlocal::locallocaltime($times{$res}); - my $description="$title"; + my $description="$title on $time"; push(@{$state->{CHOICES}},[$description,$escsymb]); } + + + Will remove access times from user
    + + + my ($uname,$udom,undef,$fullname)=split(':',$helper->{'VARS'}{'stu1'}); + if (!$fullname) { $fullname="$uname\@$udom"; } + return '
  • '.$fullname.'
  • '; +
    +
for
    + + my $list; + my @symbs=split(/\|\|\|/,$helper->{'VARS'}{'delete'}); + foreach my $escsymb (@symbs) { + my $symb=&Apache::lonnet::unescape($escsymb); + my $title = + ($symb ne 'course') ? &Apache::lonnet::gettitle($symb) + : $env{'course.'.$env{'request.course.id'}.'.description'}; + $list.='
  • '.$title.'
  • '; + } + return $list; +
    + + - &Apache::lonnet::logthis($helper->{'VARS'}{'delete'}); if ($helper->{'STATE'} ne 'FinishStu') { return; } my $result; - my $courseid=$ENV{'request.course.id'}; + my $courseid=$env{'request.course.id'}; my ($uname,$udom,$sec,$fullname)=split(':',$helper->{'VARS'}{'stu1'}); &Apache::lonnet::logthis($helper->{'VARS'}{'delete'}); foreach my $escsymb (split(/\|\|\|/,$helper->{'VARS'}{'delete'})) { my $symb=&Apache::lonnet::unescape($escsymb); my $res=&Apache::lonnet::del('firstaccesstimes', ["$courseid\0$symb"],$udom,$uname); + my $title = + ($symb ne 'course') ? &Apache::lonnet::gettitle($symb) + : $env{'course.'.$env{'request.course.id'}.'.description'}; $result.="Removing access time from ". - &Apache::lonnet::gettitle($symb).": ".$res.'
  • '; + $title.": ".$res.'
  • '; } $result=~s/
  • $//; return $result; @@ -59,15 +89,14 @@ - Select:
    - - Choose a resource - - return $res->is_map() + + + return (($res->is_map() && $res->map_contains_problem()) + ||$res->is_problem() ); return $res->symb() ShowPlan @@ -98,7 +127,7 @@ if ($helper->{'STATE'} ne 'FINISH') { return; } my $result; my $symb=$helper->{'VARS'}{'res2'}; - my $key=$ENV{'request.course.id'}."\0".$symb; + my $key=$env{'request.course.id'}."\0".$symb; my @names=split(/\|\|\|/,$helper->{'VARS'}{'stu1'}); foreach my $name (@names) { my ($uname,$udom,$sec,$fullname)=split(':',$name);