--- loncom/interface/loncoursedata.pm 2003/09/26 18:31:31 1.89 +++ loncom/interface/loncoursedata.pm 2003/09/30 12:09:48 1.92 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.89 2003/09/26 18:31:31 matthew Exp $ +# $Id: loncoursedata.pm,v 1.92 2003/09/30 12:09:48 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -197,6 +197,10 @@ sub get_sequence_assessment_data { my @Ids = $curRes->responseIds($part); $partdata{$part}->{'ResponseTypes'}= \@Responses; $partdata{$part}->{'ResponseIds'} = \@Ids; + # Count how many responses of each type there are in this part + foreach (@Responses) { + $partdata{$part}->{$_}++; + } } my $assessment = { title => $title, src => $src, @@ -1157,7 +1161,15 @@ sub update_full_student_data { next; } elsif ($parameter eq 'version') { next; - } elsif ($parameter =~ /^resource\.(.*)\.(tries|award|awarded|previous|solved|awarddetail|submission)\s*$/){ + } elsif ($parameter =~ /^resource\.(.*)\.(tries| + award| + awarded| + previous| + solved| + awarddetail| + submission| + submissiongrading| + molecule)\s*$/x){ # we do not have enough information to store an # entire row, so we save it up until later. my ($part_and_resp_id,$field) = ($1,$2); @@ -1169,11 +1181,18 @@ sub update_full_student_data { } else { $part_id = &get_part_id($part_and_resp_id); } + # Deal with part specific data if ($field =~ /^(tries|award|awarded|previous)$/) { $partdata->{$symb_id}->{$part_id}->{$transaction}->{$field}=$value; } + # deal with response specific data if (defined($resp_id) && - $field =~ /^(tries|awarddetail|awarded|submission)$/) { + $field =~ /^(tries| + awarddetail| + awarded| + submission| + submissiongrading| + molecule)$/x) { if ($field eq 'submission') { # We have to be careful with user supplied input. # most of the time we are okay because it is escaped. @@ -1185,7 +1204,13 @@ sub update_full_student_data { $value =~ s/\\$/\\\\/; } } - $respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{$field}=$value; + if ($field eq 'submissiongrading' || + $field eq 'molecule') { + $respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{'response_specific'}=$field; + $respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{'response_specific_value'}=$value; + } else { + $respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{$field}=$value; + } } } } @@ -1232,7 +1257,8 @@ sub update_full_student_data { $data->{'tries'}, $data->{'awarddetail'}, $data->{'awarded'}, - '','', + $data->{'response_specific'}, + $data->{'response_specific_value'}, $data->{'submission'})."'),"; $store_rows++; } @@ -1842,7 +1868,7 @@ sub get_problem_statistics { $stats_table); my ($Solved) = &execute_SQL_request($dbh,'SELECT COUNT(tries) FROM '. $stats_table. - " WHERE solved='correct_by_student'"); + " WHERE solved='correct_by_student' OR solved='correct_by_scantron'"); my ($solved) = &execute_SQL_request($dbh,'SELECT COUNT(tries) FROM '. $stats_table. " WHERE solved='correct_by_override'");