--- loncom/interface/lonparmset.pm 2005/11/04 20:08:09 1.263 +++ loncom/interface/lonparmset.pm 2005/11/11 20:37:47 1.264 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.263 2005/11/04 20:08:09 banghart Exp $ +# $Id: lonparmset.pm,v 1.264 2005/11/11 20:37:47 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2755,34 +2755,22 @@ sub output_row { my $output; my $options=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.options'}; my $values=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.values'}; - my $checked; unless (defined($options)) { $options = 'active,stuadd'; $values = ''; } $output.=''.$field_text.':'; - $output.='
'; - if ($options =~ m/active/) { - $checked = ' checked="checked" '; - } else { - $checked = ' '; - } - $output.='     '; - $output.='Show to student
'; - if ($options =~ m/onlyone/) { - $checked = ' checked="checked" '; - } else { - $checked = ' '; - } - $output.='     '; - $output.='Student may select only one choice
'; - if ($options =~ m/stuadd/) { - $checked = ' checked="checked" '; - } else { - $checked = ' '; + $output.='
'; + + my @options= ( ['active', 'Show to student'], + ['onlyone','Student may select only one choice'], + ['stuadd', 'Student may type choices']); + foreach my $opt (@options) { + my $checked = ($options =~ m/$opt->[0]/) ? ' checked="checked" ' : '' ; + $output.=(' 'x5).'
'; } - $output.='     '; - $output.='Student may type choices
'; return ($output); }