--- loncom/interface/loncoursedata.pm 2003/03/26 16:25:06 1.62 +++ loncom/interface/loncoursedata.pm 2003/03/27 19:29:36 1.63 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.62 2003/03/26 16:25:06 matthew Exp $ +# $Id: loncoursedata.pm,v 1.63 2003/03/27 19:29:36 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -506,8 +506,6 @@ sub init_dbs { type => 'TINYTEXT' }, { name => 'timestamp', type => 'INT UNSIGNED'}, - { name => 'weight', - type => 'INT UNSIGNED'}, ], 'PRIMARY KEY' => ['symb_id','student_id','part_id'], 'KEY' => [{ columns=>['student_id'] }, @@ -859,10 +857,9 @@ sub update_student_data { my $symb_id = &get_symb_id($current_symb); # # Load data into the tables - foreach my $parameter (keys(%$param_hash)) { - my $value = $param_hash->{$parameter}; + while (my ($parameter,$value) = each(%$param_hash)) { my $newstring; - if ($parameter !~ /(timestamp|resource\.(.*)\.(solved|tries|awarded|award|awarddetail|previous|weight))/) { + if ($parameter !~ /(timestamp|resource\.(.*)\.(solved|tries|awarded|award|awarddetail|previous))/) { $newstring = "('".join("','", $symb_id,$student_id, $parameter,$value)."'),\n"; @@ -883,11 +880,6 @@ sub update_student_data { my $award = $param_hash->{'resource.'.$part.'.award'}; my $awarddetail = $param_hash->{'resource.'.$part.'.awarddetail'}; my $timestamp = $param_hash->{'timestamp'}; - # use EXT to get the weight - my $weight = &Apache::lonnet::EXT('resource.'.$part.'.weight', - $current_symb,$sdom,$sname); - # Give the weight back to the user - $param_hash->{'resource.'.$part.'.weight'}=$weight; # $solved = '' if (! defined($awarded)); $tries = '' if (! defined($tries)); @@ -896,7 +888,7 @@ sub update_student_data { $awarddetail = '' if (! defined($awarddetail)); $newstring = "('".join("','",$symb_id,$student_id,$part_id, $solved,$tries,$awarded,$award, - $awarddetail,$timestamp,$weight)."'),\n"; + $awarddetail,$timestamp)."'),\n"; $store_performance_command .= $newstring; $rows_stored++; } @@ -1039,7 +1031,7 @@ sub get_student_data_from_performance_ca my $dbh = &Apache::lonmysql::get_dbh(); my $request = "SELECT ". "d.symb,c.part,a.solved,a.tries,a.awarded,a.award,a.awarddetail,". - "a.timestamp,a.weight "; + "a.timestamp "; if (defined($student)) { $request .= "FROM $student_table AS b ". "LEFT JOIN $performance_table AS a ON b.student_id=a.student_id ". @@ -1068,7 +1060,7 @@ sub get_student_data_from_performance_ca } foreach my $row (@{$sth->fetchall_arrayref}) { $rows_retrieved++; - my ($symb,$part,$solved,$tries,$awarded,$award,$awarddetail,$time,$weight) = + my ($symb,$part,$solved,$tries,$awarded,$award,$awarddetail,$time) = (@$row); my $base = 'resource.'.$part; $studentdata->{$symb}->{$base.'.solved'} = $solved; @@ -1077,7 +1069,6 @@ sub get_student_data_from_performance_ca $studentdata->{$symb}->{$base.'.award'} = $award; $studentdata->{$symb}->{$base.'.awarddetail'} = $awarddetail; $studentdata->{$symb}->{'timestamp'} = $time if (defined($time) && $time ne ''); - $studentdata->{$symb}->{'resource.'.$part.'.weight'}=$weight; } return $studentdata; }