--- loncom/interface/courseprefs.pm 2009/11/24 13:49:28 1.13 +++ loncom/interface/courseprefs.pm 2009/11/30 06:23:32 1.14 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set configuration settings for a course # -# $Id: courseprefs.pm,v 1.13 2009/11/24 13:49:28 bisitz Exp $ +# $Id: courseprefs.pm,v 1.14 2009/11/30 06:23:32 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -281,13 +281,14 @@ sub handler { col2 => 'Value',}], ordered => ['problem_stream_switch','suppress_tries', 'default_paper_size','print_header_format', - 'disableexampointprint'], + 'disableexampointprint','canuse_pdfforms'], itemtext => { problem_stream_switch => 'Allow problems to be split over pages', suppress_tries => 'Suppress number of tries in printing', default_paper_size => 'Default paper type', print_header_format => 'Print header format', disableexampointprint => 'Disable automatically printing point values on exams', + canuse_pdfforms => 'Users can print problems as PDF forms and upload later for grading', }, }, 'spreadsheet' => @@ -983,15 +984,21 @@ sub store_changes { $displayname = &mt($text); } if (defined($yesno{$key})) { - $displayval = 'no'; + $displayval = &mt('No'); if ($changes->{$item}{$key} eq 'yes') { - $displayval = 'yes'; + $displayval = &mt('Yes'); } } elsif (($key =~ /^default_enrollment_(start|end)_date$/) && ($displayval)) { $displayval = &Apache::lonlocal::locallocaltime($displayval); } elsif ($key eq 'categories') { $displayval = $env{'form.categories_display'}; - } + } elsif ($key eq 'canuse_pdfforms') { + if ($changes->{$item}{$key} eq '1') { + $displayval = &mt('Yes'); + } elsif ($changes->{$item}{$key} eq '0') { + $displayval = &mt('No'); + } + } if ($changes->{$item}{$key} eq '') { push(@delkeys,$key); $output .= '
  • '.&mt('Deleted setting for [_1]', @@ -1037,6 +1044,10 @@ sub store_changes { $output .= &mt('An error occurred when removing course settings which are no longer in use.'); } $output .= ''; + } else { + foreach my $key (@delkeys) { + &Apache::lonnet::delenv('course.'.$cdom.'_'.$cnum.'.'.$key); + } } } if (@need_env_update) { @@ -2301,6 +2312,16 @@ sub print_printouts { text => ''.&mt($itemtext->{'disableexampointprint'}).'', input => 'radio', }, + canuse_pdfforms => { + text => ''.&mt($itemtext->{'canuse_pdfforms'}).'', + input => 'selectbox', + options => { + 1 => &mt('Yes'), + 0 => &mt('No'), + }, + order => ['1','0'], + nullval => 'None specified - use domain default', + } ); return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype); }