Diff for /loncom/html/adm/helper/resettimes.helper between versions 1.1 and 1.4

version 1.1, 2005/01/16 08:04:10 version 1.4, 2007/06/06 20:18:50
Line 4 Line 4
       <message_text>Select </message_text>        <message_text>Select </message_text>
     </message>      </message>
     <choices variable="harry">      <choices variable="harry">
       <choice computer='1' nextstate="Student">Reset times on one or more maps for a single student.</choice>        <choice computer='1' nextstate="Student">Reset times on one or more folders/maps for a single student.</choice>
       <choice computer='0' nextstate="Class">Reset times on a single map for a section or whole clase.</choice>        <choice computer='0' nextstate="Class">Reset times on a single folder/map for a section or whole clase.</choice>
       </choices>        </choices>
   </state>    </state>
   <state name="Student" title="Select Student">    <state name="Student" title="Select Student">
Line 16 Line 16
   </state>    </state>
   
   <state name="SelectAccess">    <state name="SelectAccess">
       <message nextstate="ConfirmStu">
          <message_text>This is a list of folders/maps and times they were accessed, plese select those you want deleted.</message_text>
       </message>
     <choices variable='delete' multichoice='true'>      <choices variable='delete' multichoice='true'>
       <nextstate>FinishStu</nextstate>  
       <exec>        <exec>
          my ($uname,$udom,$sec,$fullname)=split(':',$helper->{'VARS'}{'stu1'});           my ($uname,$udom,$sec,$fullname)=split(':',$helper->{'VARS'}{'stu1'});
          my %times=&Apache::lonnet::dump('firstaccesstimes',$udom,$uname,           my %times=&Apache::lonnet::dump('firstaccesstimes',$udom,$uname,
  "^$ENV{'request.course.id'}\0");   "^$env{'request.course.id'}\0");
          foreach my $res (sort(keys(%times))) {           foreach my $res (sort(keys(%times))) {
      my (undef,$symb)=split("\0",$res);       my (undef,$symb)=split("\0",$res);
      my $escsymb=&Apache::lonnet::escape($symb);       my $escsymb=&Apache::lonnet::escape($symb);
      my $title=&Apache::lonnet::gettitle($symb);       my $title=&Apache::lonnet::gettitle($symb);
      my $time=&Apache::lonlocal::locallocaltime($times{$res});       my $time=&Apache::lonlocal::locallocaltime($times{$res});
      my $description="<a href='/adm/navmaps?postsymb=".&Apache::lonnet::escape($symb)."'>$title</a>";       my $description="<a href='/adm/navmaps?postsymb=".&Apache::lonnet::escape($symb)."'>$title</a> on $time";
      push(@{$state->{CHOICES}},[$description,$escsymb]);       push(@{$state->{CHOICES}},[$description,$escsymb]);
  }   }
       </exec>        </exec>
     </choices>      </choices>
   </state>    </state>
   
     <state name="ConfirmStu">
       <message nextstate="FinishStu">
          <message_text>Will remove access times from user <ul></message_text>
       </message>
       <eval>
           my ($uname,$udom,undef,$fullname)=split(':',$helper->{'VARS'}{'stu1'});
           if (!$fullname) { $fullname="$uname\@$udom"; }
           return '<li>'.$fullname.'</li>';
       </eval>
       <message><message_text></ul> for folders/maps <ul></message_text></message>
       <eval>
    my $list;
    my @symbs=split(/\|\|\|/,$helper->{'VARS'}{'delete'});
    foreach my $escsymb (@symbs) {
       my $symb=&Apache::lonnet::unescape($escsymb);
       $list.='<li>'.&Apache::lonnet::gettitle($symb).'</li>';
    }
    return $list;
       </eval>
     </state>
   
   <state name="FinishStu" title="Processing">    <state name="FinishStu" title="Processing">
     <final>      <final>
       <finalcode>        <finalcode>
         &Apache::lonnet::logthis($helper->{'VARS'}{'delete'});          &Apache::lonnet::logthis($helper->{'VARS'}{'delete'});
         if ($helper->{'STATE'} ne 'FinishStu') { return; }          if ($helper->{'STATE'} ne 'FinishStu') { return; }
         my $result;          my $result;
         my $courseid=$ENV{'request.course.id'};          my $courseid=$env{'request.course.id'};
         my ($uname,$udom,$sec,$fullname)=split(':',$helper->{'VARS'}{'stu1'});          my ($uname,$udom,$sec,$fullname)=split(':',$helper->{'VARS'}{'stu1'});
         &Apache::lonnet::logthis($helper->{'VARS'}{'delete'});          &Apache::lonnet::logthis($helper->{'VARS'}{'delete'});
         foreach my $escsymb (split(/\|\|\|/,$helper->{'VARS'}{'delete'})) {          foreach my $escsymb (split(/\|\|\|/,$helper->{'VARS'}{'delete'})) {
Line 64 Line 87
     <student variable='stu1' coursepersonnel='true' activeonly='true' multichoice='true' />      <student variable='stu1' coursepersonnel='true' activeonly='true' multichoice='true' />
   </state>    </state>
   
   <state name="SelectMap" title="Select a map">    <state name="SelectMap" title="Select a folder/map">
     <message><message_text>Choose a resource</message_text></message>      <message><message_text>Choose a resource</message_text></message>
     <resource variable="res2">      <resource variable="res2">
       <filterfunc>return $res->is_map()</filterfunc>        <filterfunc>return $res->is_map()</filterfunc>
Line 98 Line 121
         if ($helper->{'STATE'} ne 'FINISH') { return; }          if ($helper->{'STATE'} ne 'FINISH') { return; }
         my $result;          my $result;
         my $symb=$helper->{'VARS'}{'res2'};          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'});   my @names=split(/\|\|\|/,$helper->{'VARS'}{'stu1'});
  foreach my $name (@names) {   foreach my $name (@names) {
     my ($uname,$udom,$sec,$fullname)=split(':',$name);      my ($uname,$udom,$sec,$fullname)=split(':',$name);

Removed from v.1.1  
changed lines
  Added in v.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>