--- loncom/interface/statistics/lonstathelpers.pm 2004/11/08 15:14:52 1.30 +++ loncom/interface/statistics/lonstathelpers.pm 2004/12/03 21:20:28 1.33 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstathelpers.pm,v 1.30 2004/11/08 15:14:52 matthew Exp $ +# $Id: lonstathelpers.pm,v 1.33 2004/12/03 21:20:28 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -150,7 +150,7 @@ sub ProblemSelector { $seq_str .= &mt('response').' '.$respid; } $seq_str .= (' 'x2). - qq{view}; + qq{view}; $seq_str .= "\n"; $rb_count++; } @@ -555,6 +555,7 @@ Returns: nothing ##################################################### sub GetStudentAnswers { my ($r,$problem,$Students,$formname,$inputname) = @_; + my %answers; my $status_type; if (defined($formname)) { $status_type = 'inline'; @@ -582,6 +583,7 @@ sub GetStudentAnswers { ($resource,$sname,$sdom,$partid,$respid); &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, &mt('last student')); + $answers{$answer}++; $student->{'answer'} = $answer; } &Apache::lonstathelpers::write_analysis_cache(); @@ -589,7 +591,7 @@ sub GetStudentAnswers { $r->rflush(); # close progress window &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); - return; + return \%answers; } ##################################################### @@ -1130,7 +1132,7 @@ sub get_problem_data { $Partdata{$part}->{'_Foils'}->{$foil}->{'_Concept'}= $concept; } - } elsif ($key =~ /^(incorrect|answer|ans_low|ans_high|str_type)$/) { + } elsif ($key =~ /^(unit|incorrect|answer|ans_low|ans_high|str_type)$/) { $Partdata{$part}->{$key}=$value; } } else {