[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm
raeburn
raeburn@source.lon-capa.org
Wed, 18 Aug 2010 17:59:28 -0000
raeburn Wed Aug 18 17:59:28 2010 EDT
Modified files:
/loncom/interface loncommon.pm
Log:
- Don't display submission data for anonymous survey if display option is:
"last submission & parts info".
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.977 loncom/interface/loncommon.pm:1.978
--- loncom/interface/loncommon.pm:1.977 Mon Aug 16 16:02:08 2010
+++ loncom/interface/loncommon.pm Wed Aug 18 17:59:28 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.977 2010/08/16 16:02:08 bisitz Exp $
+# $Id: loncommon.pm,v 1.978 2010/08/18 17:59:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3411,7 +3411,7 @@
}
$prevattempts=&start_data_table().&start_data_table_header_row();
$prevattempts.='<th>'.&mt('History').'</th>';
- my %typeparts;
+ my (%typeparts,%lasthidden);
my $showsurv=&Apache::lonnet::allowed('vas',$env{'request.course.id'});
foreach my $key (sort(keys(%lasthash))) {
my ($ign,@parts) = split(/\./,$key);
@@ -3422,6 +3422,9 @@
unless ($showsurv) {
my $id = join(',',@parts);
$typeparts{$ign.'.'.$id} = $lasthash{$key};
+ if (($lasthash{$key} eq 'anonsurvey') || ($lasthash{$key} eq 'anonsurveycred')) {
+ $lasthidden{$ign.'.'.$id} = 1;
+ }
}
delete($lasthash{$key});
} else {
@@ -3436,7 +3439,6 @@
}
}
$prevattempts.=&end_data_table_header_row();
- my %lasthidden;
if ($getattempt eq '') {
for ($version=1;$version<=$returnhash{'version'};$version++) {
my @hidden;
@@ -3444,11 +3446,6 @@
foreach my $id (keys(%typeparts)) {
if (($returnhash{$version.':'.$id.'.type'} eq 'anonsurvey') || ($returnhash{$version.':'.$id.'.type'} eq 'anonsurveycred')) {
push(@hidden,$id);
- $lasthidden{$id} = 1;
- } elsif ($lasthidden{$id}) {
- if (exists($returnhash{$version.':'.$id.'.award'})) {
- delete($lasthidden{$id});
- }
}
}
}