--- loncom/interface/lonparmset.pm 2005/10/26 21:42:10 1.262
+++ loncom/interface/lonparmset.pm 2005/11/11 23:07:27 1.265
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.262 2005/10/26 21:42:10 banghart Exp $
+# $Id: lonparmset.pm,v 1.265 2005/11/11 23:07:27 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2753,36 +2753,24 @@ ENDMAINFORMHEAD
sub output_row {
my ($r, $field_name, $field_text) = @_;
my $output;
- my $options=$env{'course.'.$env{'request.course.id'}.'.'.$field_name.'.options'};
- my $values=$env{'course.'.$env{'request.course.id'}.'.'.$field_name.'.values'};
- my $checked;
+ my $options=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.options'};
+ my $values=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.values'};
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);
}
@@ -2832,7 +2820,10 @@ sub setrestrictmeta {
&Apache::lonnet::coursedescription($env{'request.course.id'});
my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio');
foreach my $field (sort(keys(%metadata_fields))) {
- $output.= &output_row($r, $field, $metadata_fields{$field});
+ &Apache::lonnet::logthis ($field);
+ if ($field ne 'courserestricted') {
+ $output.= &output_row($r, $field, $metadata_fields{$field});
+ }
}
$r->print(<