version 1.31, 2011/05/29 19:10:10
|
version 1.38, 2012/03/15 23:01:59
|
Line 93 FULLTEXT idx_language (language),
|
Line 93 FULLTEXT idx_language (language),
|
FULLTEXT idx_owner (owner), |
FULLTEXT idx_owner (owner), |
FULLTEXT idx_copyright (copyright)) |
FULLTEXT idx_copyright (copyright)) |
|
|
TYPE=MYISAM; |
ENGINE=MYISAM; |
|
|
=cut |
=cut |
|
|
Line 384 sub create_metadata_storage {
|
Line 384 sub create_metadata_storage {
|
$text .= 'idx_'.$colname.' ('.$colname.')'; |
$text .= 'idx_'.$colname.' ('.$colname.')'; |
push (@Columns,$text); |
push (@Columns,$text); |
} |
} |
$request .= "(".join(", ",@Columns).") TYPE=MyISAM"; |
$request .= "(".join(", ",@Columns).") ENGINE=MyISAM"; |
return $request; |
return $request; |
} |
} |
|
|
Line 463 sub store_metadata {
|
Line 463 sub store_metadata {
|
$mdata->{$fname} eq '') { |
$mdata->{$fname} eq '') { |
push(@MData,'NULL'); |
push(@MData,'NULL'); |
} else { |
} else { |
push(@MData,$mdata->{$fname}); |
push(@MData, $field->{type} eq 'DATETIME' ? |
|
sqltime($mdata->{$fname}) : $mdata->{$fname}); |
} |
} |
} else { |
} else { |
push(@MData,undef); |
push(@MData,undef); |
Line 759 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 786 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 798 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 918 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 969 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; |
} |
} |
|
|