Diff for /loncom/lond between versions 1.271 and 1.272

version 1.271, 2004/12/31 01:24:14 version 1.272, 2005/01/01 02:31:05
Line 3108  sub reply_query_handler { Line 3108  sub reply_query_handler {
 #   $tail     - Tail of the command.  In this case consists of a colon  #   $tail     - Tail of the command.  In this case consists of a colon
 #               separated list contaning the domain to apply this to and  #               separated list contaning the domain to apply this to and
 #               an ampersand separated list of keyword=value pairs.  #               an ampersand separated list of keyword=value pairs.
   #               Each value is a colon separated list that includes:  
   #               description, institutional code and course owner.
   #               For backward compatibility with versions included
   #               in LON-CAPA 1.1.X (and earlier) and 1.2.X, institutional
   #               code and/or course owner are preserved from the existing 
   #               record when writing a new record in response to 1.1 or 
   #               1.2 implementations of lonnet::flushcourselogs().   
   #                      
 #   $client   - Socket open on the client.  #   $client   - Socket open on the client.
 # Returns:  # Returns:
 #   1    - indicating that processing should continue  #   1    - indicating that processing should continue
Line 3131  sub put_course_id_handler { Line 3139  sub put_course_id_handler {
  foreach my $pair (@pairs) {   foreach my $pair (@pairs) {
             my ($key,$courseinfo) = split(/=/,$pair,2);              my ($key,$courseinfo) = split(/=/,$pair,2);
             $courseinfo =~ s/=/:/g;              $courseinfo =~ s/=/:/g;
   
               my @current_items = split/:/,$hashref->{$key};
               shift @current_items; # remove description
               pop @current_items;   # remove last access
               my $numcurrent = scalar(@current_items);
   
               my @new_items = split/:/,$courseinfo;
               my $numnew = scalar(@new_items);
               if ($numcurrent > 0) {
                   if ($numnew == 1) { # flushcourselogs() from 1.1 or earlier
                       $courseinfo .= ':'.join(':',@current_items);
                   } elsif ($numnew == 2) { # flushcourselogs() from 1.2.X
                       $courseinfo .= ':'.$current_items[$numcurrent-1];
                   }
               }
     $hashref->{$key}=$courseinfo.':'.$now;      $hashref->{$key}=$courseinfo.':'.$now;
  }   }
  if (untie(%$hashref)) {   if (untie(%$hashref)) {
Line 3169  sub put_course_id_handler { Line 3192  sub put_course_id_handler {
 #                 description - regular expression that is used to filter  #                 description - regular expression that is used to filter
 #                            the dump.  Only keywords matching this regexp  #                            the dump.  Only keywords matching this regexp
 #                            will be used.  #                            will be used.
   #                 institutional code - optional supplied code to filter 
   #                            the dump. Only courses with an institutional code 
   #                            that match the supplied code will be returned.
   #                 owner    - optional supplied username of owner to filter
   #                            the dump.  Only courses for which the course 
   #                            owner matches the supplied username will be
   #                            returned. Implicit assumption that owner is a user
   #                            in the domain in which the course database is defined.        
 #     $client  - The socket open on the client.  #     $client  - The socket open on the client.
 # Returns:  # Returns:
 #    1     - Continue processing.  #    1     - Continue processing.
Line 3202  sub dump_course_id_handler { Line 3233  sub dump_course_id_handler {
     if ($hashref) {      if ($hashref) {
  while (my ($key,$value) = each(%$hashref)) {   while (my ($key,$value) = each(%$hashref)) {
     my ($descr,$lasttime,$inst_code,$owner);      my ($descr,$lasttime,$inst_code,$owner);
             if ($value =~  m/^([^\:]*):([^\:]*):([^\:]*):(\d+)$/) {              my @courseitems = split/:/,$value;
                 ($descr,$inst_code,$owner,$lasttime)=($1,$2,$3,$4);              $descr = shift @courseitems;
     } elsif ($value =~ m/^([^\:]*):([^\:]*):(\d+)$/) {              $lasttime = pop @courseitems;
  ($descr,$inst_code,$lasttime)=($1,$2,$3);              if (@courseitems > 0) {
     } else {                  $inst_code = shift @courseitems;
  ($descr,$lasttime) = split(/\:/,$value);              }
     }              if (@courseitems > 0) {
                   $owner = shift @courseitems;
               }
     if ($lasttime<$since) { next; }      if ($lasttime<$since) { next; }
             my $match = 1;              my $match = 1;
     unless ($description eq '.') {      unless ($description eq '.') {

Removed from v.1.271  
changed lines
  Added in v.1.272


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