--- loncom/interface/loncommon.pm 2003/10/30 13:57:06 1.140 +++ loncom/interface/loncommon.pm 2003/11/04 19:01:01 1.142 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.140 2003/10/30 13:57:06 matthew Exp $ +# $Id: loncommon.pm,v 1.142 2003/11/04 19:01:01 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1771,7 +1771,7 @@ sub get_previous_attempt { } else { $value=$returnhash{$version.':'.$_}; } - $prevattempts.=''.$value.' '; + $prevattempts.=''.&Apache::lonnet::unescape($value).' '; } } } @@ -1783,6 +1783,7 @@ sub get_previous_attempt { } else { $value=$lasthash{$_}; } + $value=&Apache::lonnet::unescape($value); if ($_ =~/$regexp$/ && (defined &$gradesub)) {$value = &$gradesub($value)} $prevattempts.=''.$value.' '; } @@ -2672,11 +2673,14 @@ sub check_if_partid_hidden { my ($id,$symb,$udom,$uname) = @_; my $hiddenparts=&Apache::lonnet::EXT('resource.0.hiddenparts', $symb,$udom,$uname); + my $truth=1; + #if the string starts with !, then the list is the list to show not hide + if ($hiddenparts=~s/^\s*!//) { $truth=undef; } my @hiddenlist=split(/,/,$hiddenparts); foreach my $checkid (@hiddenlist) { - if ($checkid =~ /^\s*\Q$id\E\s*$/) { return 1; } + if ($checkid =~ /^\s*\Q$id\E\s*$/) { return $truth; } } - return undef; + return !$truth; }