--- loncom/interface/loncoursedata.pm 2003/04/01 16:53:50 1.66 +++ loncom/interface/loncoursedata.pm 2003/04/18 19:05:30 1.69 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.66 2003/04/01 16:53:50 matthew Exp $ +# $Id: loncoursedata.pm,v 1.69 2003/04/18 19:05:30 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -137,8 +137,6 @@ sub get_sequence_assessment_data { # We need to keep track of which sequences contain homework problems # my $previous; - $curRes = $iterator->next(); # BEGIN_MAP - $curRes = $iterator->next(); # The first item in the top level map. while (scalar(@Nested_Sequences)) { $previous = $curRes; $curRes = $iterator->next(); @@ -862,7 +860,8 @@ sub update_student_data { if ($parameter !~ /(timestamp|resource\.(.*)\.(solved|tries|awarded|award|awarddetail|previous))/) { $newstring = "('".join("','", $symb_id,$student_id, - $parameter,$value)."'),\n"; + $parameter)."',". + $dbh->quote($value)."),\n"; $num_parameters ++; if ($newstring !~ /''/) { $store_parameters_command .= $newstring; @@ -1039,7 +1038,7 @@ sub get_student_data_from_performance_ca "LEFT JOIN $symb_table AS d ON d.symb_id = a.symb_id ". "WHERE student='$student'"; if (defined($symb) && $symb ne '') { - $request .= " AND d.symb='".$dbh->quote($symb)."'"; + $request .= " AND d.symb=".$dbh->quote($symb); } } elsif (defined($symb) && $symb ne '') { $request .= "FROM $symb_table as d ". @@ -1070,6 +1069,9 @@ sub get_student_data_from_performance_ca $studentdata->{$symb}->{$base.'.awarddetail'} = $awarddetail; $studentdata->{$symb}->{'timestamp'} = $time if (defined($time) && $time ne ''); } + if (defined($symb) && $symb ne '') { + $studentdata = $studentdata->{$symb}; + } return $studentdata; } @@ -1121,7 +1123,11 @@ sub get_current_state { my ($status,$data) = &ensure_current_data($sname,$sdom,$courseid); # if (defined($data)) { - return %$data; + if (defined($symb)) { + return %{$data->{$symb}}; + } else { + return %$data; + } } elsif ($status eq 'no data') { return (); } else {