--- loncom/interface/statistics/lonproblemstatistics.pm 2004/04/06 15:45:13 1.83 +++ loncom/interface/statistics/lonproblemstatistics.pm 2004/04/16 21:43:56 1.84 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemstatistics.pm,v 1.83 2004/04/06 15:45:13 matthew Exp $ +# $Id: lonproblemstatistics.pm,v 1.84 2004/04/16 21:43:56 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -55,6 +55,7 @@ use Apache::loncommon(); use Apache::lonhtmlcommon; use Apache::loncoursedata; use Apache::lonstatistics; +use LONCAPA::lonmetadata(); use Apache::lonlocal; use Spreadsheet::WriteExcel; use Apache::lonstathelpers(); @@ -1453,22 +1454,17 @@ sub get_statistics { } # # Store in metadata if computations were done for all students - if ($Apache::lonstatistics::SelectedSections[0] eq 'all' && - $data->{'num_students'} > 1) { - my %storestats; - # + if ($data->{'num_students'} > 1) { + my @Sections = @Apache::lonstatistics::SelectedSections; + my $sections = '"'.join(' ',@Sections).'"'; + $sections =~ s/&+/_/g; # Ensure no special characters + $data->{'sections'}=$sections; + $data->{'course'} = $ENV{'request.course.id'}; my $urlres=(&Apache::lonnet::decode_symb($resource->{'symb'}))[2]; + $data->{'urlres'}=$urlres; + my %storestats = + &LONCAPA::lonmetadata::dynamic_metadata_storage($data); my ($dom,$user) = $urlres=~/^(\w+)\/(\w+)/; - my $preamble = $courseid.'___'.$urlres.'___'; - # - $storestats{$preamble.'timestamp'} = time; - $storestats{$preamble.'stdno'} = $data->{'num_students'}; - $storestats{$preamble.'avetries'} = $data->{'mean_tries'}; - $storestats{$preamble.'difficulty'} = $data->{'deg_of_diff'}; - if ($SelectedFields{'deg_of_disc'}) { - $storestats{$preamble.'discrimination'} = $data->{'deg_of_disc'}; - } - # &Apache::lonnet::put('nohist_resevaldata',\%storestats,$dom,$user); } return $data;