--- loncom/interface/lonhelper.pm 2005/02/17 08:29:42 1.96 +++ loncom/interface/lonhelper.pm 2005/02/22 22:56:08 1.99 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.96 2005/02/17 08:29:42 albertel Exp $ +# $Id: lonhelper.pm,v 1.99 2005/02/22 22:56:08 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1977,6 +1977,7 @@ BUTTONS $mapUrl = $self->{MAP_URL}; } + # Create the composite function that renders the column on the nav map # have to admit any language that lets me do this can't be all bad # - Jeremy (Pythonista) ;-) @@ -2005,14 +2006,21 @@ BUTTONS return $result; } else { my $col = ""; + my $raw_name = &$valueFunc($resource); my $resource_name = - HTML::Entities::encode(&$valueFunc($resource),"<>&\"'"); + HTML::Entities::encode($raw_name,"<>&\"'"); if($option_vars) { foreach my $option_var (@$option_vars) { + my $var_value = "\|\|\|" . $helper->{VARS}->{$option_var} . + "\|\|\|"; + my $checked =""; + if($var_value =~ /\Q|||$raw_name|||\E/) { + $checked = "checked"; + } $col .= " "; + $resource_name . "' $checked /> "; } } @@ -2870,7 +2878,7 @@ sub render { my $result = ''; if (defined $self->{ERROR_MSG}) { - $result .= '
' . $self->{ERROR_MSG} . '

'; + $result .= '

' . $self->{ERROR_MSG} . '

'; } $result .= '