--- loncom/interface/statistics/lonproblemanalysis.pm 2002/08/14 16:18:55 1.7
+++ loncom/interface/statistics/lonproblemanalysis.pm 2002/08/14 21:51:51 1.9
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# (Publication Handler
#
-# $Id: lonproblemanalysis.pm,v 1.7 2002/08/14 16:18:55 stredwic Exp $
+# $Id: lonproblemanalysis.pm,v 1.9 2002/08/14 21:51:51 stredwic Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -115,17 +115,21 @@ sub BuildAnalyzePage {
splice(@$students, $studentIndex, 1);
}
}
- untie(%cache);
+ unless(untie(%cache)) {
+ $r->print('Can not untie hash.');
+ $r->rflush();
+ }
- if(&Apache::loncoursedata::DownloadStudentCourseDataSeparate($students,
- 'true',
- $cacheDB,
- 'true',
- 'true',
- $courseID,
- $r,
- $c) ne 'OK') {
- $r->print($Str);
+ my $error =
+ &Apache::loncoursedata::DownloadStudentCourseDataSeparate($students,
+ 'true',
+ $cacheDB,
+ 'true',
+ 'true',
+ $courseID,
+ $r, $c);
+ if($error ne 'OK') {
+ $r->print($error.'
Error downloading course data
');
return;
}
@@ -231,10 +235,12 @@ sub OptionResponseTable {
my @optionResponses=split(':::', $optionResponses);
my %partCount;
my %sequences;
+ my @orderedSequences=();
foreach(@optionResponses) {
my ($sequence, $problemId, $part, undef)=split(':',$_);
$partCount{$problemId.':'.$part}++;
if(!defined($sequences{$sequence})) {
+ push(@orderedSequences, $sequence);
$sequences{$sequence} = $_;
} else {
$sequences{$sequence} .= ':::'.$_;
@@ -243,7 +249,7 @@ sub OptionResponseTable {
my $Str = '';
- foreach my $sequence (sort(keys(%sequences))) {
+ foreach my $sequence (@orderedSequences) {
my @optionProblems = split(':::', $sequences{$sequence});
$Str .= ''.$cache->{$sequence.':title'}.''."\n";