--- loncom/interface/statistics/lonproblemanalysis.pm 2006/12/21 19:52:28 1.129
+++ loncom/interface/statistics/lonproblemanalysis.pm 2008/10/23 09:07:51 1.131
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemanalysis.pm,v 1.129 2006/12/21 19:52:28 albertel Exp $
+# $Id: lonproblemanalysis.pm,v 1.131 2008/10/23 09:07:51 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -636,11 +636,21 @@ sub numerical_determine_answers {
$sdom);
# make the key
my $key = $partid.'.'.$respid;
+ # pick one of the possible answers
+ my $which = 'INTERNAL';
+ if (!exists($analysis->{$key}{$which})) {
+ $which = (sort(keys(%{ $analysis->{$key} })))[0];
+ }
foreach my $item ('answer','unit','ans_high','ans_low') {
- $correct->{$sname.':'.$sdom}->{$item} =
- $analysis->{$key.'.'.$item}->[0];
+ if (ref($analysis->{$key.'.'.$item}) eq 'ARRAY') {
+ $correct->{$sname.':'.$sdom}->{$item} =
+ $analysis->{$key.'.'.$item}[0];
+ } else {
+ $correct->{$sname.':'.$sdom}->{$item} =
+ $analysis->{$key.'.'.$item}{$which}[0][0];
+ }
}
- $answers{$analysis->{$key.'.answer'}->[0]}++;
+ $answers{$correct->{$sname.':'.$sdom}{'answer'}}++;
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
&mt('last student'));
}
@@ -1908,11 +1918,11 @@ sub CreateInterface {
$Str .= '';
##
- $Str .= '';
+ $Str .= '';
$Str .= '';
##
##