--- loncom/interface/courseprefs.pm 2009/11/23 21:45:18 1.12 +++ loncom/interface/courseprefs.pm 2010/01/03 01:58:15 1.15 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set configuration settings for a course # -# $Id: courseprefs.pm,v 1.12 2009/11/23 21:45:18 raeburn Exp $ +# $Id: courseprefs.pm,v 1.15 2010/01/03 01:58:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -101,7 +101,7 @@ sub handler { date => 'Locale used for community calendar', coco => 'Community Content', copo => 'Community Policy', - priv => 'Domain Coodinators in community', + priv => 'Domain Coordinators in community', defd => 'Default dates for member access', stuv => 'Member-viewable membership list options', stul => 'Member agreement needed to be listed', @@ -126,7 +126,7 @@ sub handler { date => 'Locale used for course calendar', coco => 'Course Content', copo => 'Course Policy', - priv => 'Domain Coodinators in course', + priv => 'Domain Coordinators in course', defd => 'Default dates for student access', stuv => 'Student-viewable classlist options', stul => 'Student agreement needed to be listed', @@ -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) { @@ -1298,7 +1309,7 @@ sub print_courseinfo { } } if (!defined($categoriesform)) { - $categoriesform = &mt('No categories defined for this domain'); + $categoriesform = &mt('No categories defined in this domain.'); } my ($can_toggle_cat,$can_categorize) = &can_modify_catsettings($cdom,$crstype); @@ -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); }