Diff for /loncom/metadata_database/LONCAPA/lonmetadata.pm between versions 1.34 and 1.38

version 1.34, 2012/03/06 21:48:28 version 1.38, 2012/03/15 23:01:59
Line 760  sub process_reseval_data { Line 760  sub process_reseval_data {
     #      #
     # Process every stored element      # Process every stored element
     while (my ($storedkey,$value) = each(%{$evaldata})) {      while (my ($storedkey,$value) = each(%{$evaldata})) {
         my ($source,$file,$type) = split('___',$storedkey);          my (@keycomponents) = split('___',$storedkey);
         $source = &unescape($source);          my $type=pop(@keycomponents);
           my $file=&unescape(pop(@keycomponents));
           my $source = &unescape(join('___',@keycomponents));
         $file = &unescape($file);          $file = &unescape($file);
         $value = &unescape($value);          $value = &unescape($value);
          "    got ".$file."\n        ".$type." ".$source."\n";  
         if ($type =~ /^(avetries|count|difficulty|stdno|timestamp)$/) {          if ($type =~ /^(avetries|count|difficulty|stdno|timestamp)$/) {
             #              #
             # Statistics: $source is course id              # Statistics: $source is course id
Line 787  sub process_reseval_data { Line 788  sub process_reseval_data {
             # $source is $cid\_$sec\_$stdno              # $source is $cid\_$sec\_$stdno
             # $value is stat1=value&stat2=value&stat3=value,....              # $value is stat1=value&stat2=value&stat3=value,....
             #              #
             my ($cid,$sec,$stdno)=split('&',$source);              my ($cid,$sec,$stdno,$part,$instance)=split('&',$source);
             my $crssec = $cid.'&'.$sec;              my $datakey = $cid.'&'.$sec.'&'.$part.'&'.$instance;
             my @Data = split('&',$value);              my @Data = split('&',$value);
             my %Statistics;              my %Statistics;
             while (my ($key,$value) = split('=',pop(@Data))) {              while (my ($key,$value) = split('=',pop(@Data))) {
Line 799  sub process_reseval_data { Line 800  sub process_reseval_data {
             #              #
             # Only store the data if the number of students is greater              # Only store the data if the number of students is greater
             # than the data already stored              # than the data already stored
             if (! exists($DynamicData{$file}->{'stats'}->{$crssec}) ||              if (! exists($DynamicData{$file}->{'stats'}->{$datakey}) ||
                 $DynamicData{$file}->{'stats'}->{$crssec}->{'stdno'}<$stdno){                  $DynamicData{$file}->{'stats'}->{$datakey}->{'stdno'}<$stdno){
                 $DynamicData{$file}->{'stats'}->{$crssec}=\%Statistics;                  $DynamicData{$file}->{'stats'}->{$datakey}=\%Statistics;
             }              }
         }          }
     }      }
Line 919  sub process_dynamic_metadata { Line 920  sub process_dynamic_metadata {
             $data{$type.'_list'} = join(',',@{$resdata->{$type}});              $data{$type.'_list'} = join(',',@{$resdata->{$type}});
         }          }
     }      }
   #
   # NOTE: usage is named sequsage elsewhere in LON-CAPA
   # The translation happens here
   #
     if (defined($resdata->{'usage'}) &&       if (defined($resdata->{'usage'}) && 
         ref($resdata->{'usage'}) eq 'ARRAY') {          ref($resdata->{'usage'}) eq 'ARRAY') {
         $data{'sequsage'} = scalar(@{$resdata->{'usage'}});          $data{'sequsage'} = scalar(@{$resdata->{'usage'}});
Line 970  sub dynamic_metadata_storage { Line 975  sub dynamic_metadata_storage {
     my $courseid = $data->{'course'};      my $courseid = $data->{'course'};
     my $sections = $data->{'sections'};      my $sections = $data->{'sections'};
     my $numstu = $data->{'num_students'};      my $numstu = $data->{'num_students'};
     my $urlres = $data->{'urlres'};      my $part = $data->{'part'};
     my $key = $courseid.'&'.$sections.'&'.$numstu.'___'.$urlres.'___stats';      my $symb = $data->{'symb'};
       my $key = $courseid.'&'.$sections.'&'.$numstu.'&'.$part.'&'.$symb.'___stats';
     $Store{$key} =      $Store{$key} =
         'course='.$courseid.'&'.          'course='.$courseid.'&'.
         'sections='.$sections.'&'.          'sections='.$sections.'&'.
         'timestamp='.time.'&'.          'timestamp='.time.'&'.
         'stdno='.$data->{'num_students'}.'&'.          'part='.$part.'&'.
           'stdno='.$numstu.'&'.
         'avetries='.$data->{'mean_tries'}.'&'.          'avetries='.$data->{'mean_tries'}.'&'.
         'difficulty='.$data->{'deg_of_diff'};          'difficulty='.$data->{'deg_of_diff'}.'&'.
     if (exists($data->{'deg_of_disc'})) {          'disc='.$data->{'deg_of_disc'};
         $Store{$key} .= '&'.'disc='.$data->{'deg_of_disc'};  
     }  
     return %Store;      return %Store;
 }  }
   

Removed from v.1.34  
changed lines
  Added in v.1.38


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