--- loncom/interface/lonparmset.pm 2006/12/05 02:55:53 1.350 +++ loncom/interface/lonparmset.pm 2006/12/11 23:57:17 1.351 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.350 2006/12/05 02:55:53 albertel Exp $ +# $Id: lonparmset.pm,v 1.351 2006/12/11 23:57:17 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3188,7 +3188,6 @@ ENDMAINFORMHEAD ### Set portfolio metadata sub output_row { my ($r, $field_name, $field_text, $added_flag) = @_; - my $row_class; 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'}; @@ -3197,26 +3196,47 @@ sub output_row { $values = ''; } if (!($options =~ /deleted/)) { - $output = &Apache::loncommon::start_data_table_row(); - $output .= ''.$field_text.':'; - # $output .= ''.$field_text.':'; - $output .= ''; - $output .= &Apache::loncommon::end_data_table_row(); my @options= ( ['active', 'Show to student'], - ['onlyone','Student may select only one choice'], - ['stuadd', 'Student may type choices']); + ['stuadd', 'Provide text area for students to type catalog information'], + ['choices','Provide choices for students to select from']); +# ['onlyone','Student may select only one choice']); if ($added_flag) { push @options,['deleted', 'Delete Metadata Field']; } + $output = &Apache::loncommon::start_data_table_row(); + $output .= ''.$field_text.':'; + $output .= &Apache::loncommon::end_data_table_row(); foreach my $opt (@options) { my $checked = ($options =~ m/$opt->[0]/) ? ' checked="checked" ' : '' ; $output .= &Apache::loncommon::continue_data_table_row(); - $output .= ''.(' ' x 5).' '; + $output .= ''.(' ' x 5).' '; $output .= &Apache::loncommon::end_data_table_row(); } - + $output .= &Apache::loncommon::continue_data_table_row(); + $output .= ''.(' ' x 10).''; + $output .= &Apache::loncommon::end_data_table_row(); + my $multiple_checked; + my $single_checked; + if ($options =~ m/onlyone/) { + $multiple_checked = ""; + $single_checked = " CHECKED "; + } else { + $multiple_checked = " CHECKED "; + $single_checked = ""; + } + $output .= &Apache::loncommon::continue_data_table_row(); + $output .= ''.(' ' x 10).' + + Student may select multiple choices from list'; + $output .= &Apache::loncommon::end_data_table_row(); + $output .= &Apache::loncommon::continue_data_table_row(); + $output .= ''.(' ' x 10).' + + Student may select only one choice from list'; + $output .= &Apache::loncommon::end_data_table_row(); } return ($output); } @@ -3372,7 +3392,10 @@ sub setrestrictmeta { if ($env{'form.'.$meta_field.'_stuadd'}) { $options.='stuadd,'; } - if ($env{'form.'.$meta_field.'_onlyone'}) { + if ($env{'form.'.$meta_field.'_choices'}) { + $options.='choices,'; + } + if ($env{'form.'.$meta_field.'_onlyone'} eq 'single') { $options.='onlyone,'; } if ($env{'form.'.$meta_field.'_active'}) { @@ -3381,7 +3404,6 @@ sub setrestrictmeta { if ($env{'form.'.$meta_field.'_deleted'}) { $options.='deleted,'; } - my $name = $save_field; $put_result = &Apache::lonnet::put('environment', {'metadata.'.$meta_field.'.options'=>$options, @@ -3405,6 +3427,16 @@ sub setrestrictmeta { $output.= &output_row($r, $field, $metadata_fields{$field}); } } + my $buttons = (< +
+
+ +
+
+
+ +ENDButtons my $added_flag = 1; foreach my $field (sort(keys(%$added_metadata_fields))) { $row_alt = $row_alt ? 0 : 1; @@ -3414,14 +3446,7 @@ sub setrestrictmeta { $r->print(< $output - -
-
- -
-
-
- + $buttons
ENDenv $r->print(&Apache::loncommon::end_page());