--- loncom/interface/lonparmset.pm 2005/11/04 20:08:09 1.263
+++ loncom/interface/lonparmset.pm 2005/11/14 14:01:52 1.266
@@ -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.266 2005/11/14 14:01:52 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -316,6 +316,8 @@ sub storeparm_by_symb {
# store parameter
&storeparm_by_symb_inner
($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec);
+# don't do anything if parameter was reset
+ unless ($nval) { return; }
my ($prefix,$parm)=($spnam=~/^(.*[\_\.])([^\_\.]+)$/);
# remember that this was set
$recstack{$parm}=1;
@@ -2755,34 +2757,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);
}
@@ -2832,7 +2822,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(<