--- loncom/interface/courseprefs.pm 2009/11/24 13:49:28 1.13 +++ loncom/interface/courseprefs.pm 2010/01/07 18:43:32 1.17 @@ -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.17 2010/01/07 18:43:32 faziophi Exp $ # # Copyright Michigan State University Board of Trustees # @@ -115,15 +115,15 @@ sub handler { %lt = ( conf => 'Course Configuration', edit => 'Edit Course Configuration', - gens => 'General course settings', - idnu => 'Course ID or number', - desc => 'Course Description', + gens => 'General Settings', + idnu => 'ID/Number', + desc => 'Title', catg => 'Categorize course', excc => 'Exclude from course catalog', clon => 'Users allowed to clone course', rept => 'Replacement titles for standard course roles', - time => 'Timezone in which the course takes place', - date => 'Locale used for course calendar', + time => 'Timezone', + date => 'Calendar Locale', coco => 'Course Content', copo => 'Course Policy', priv => 'Domain Coordinators in course', @@ -164,33 +164,33 @@ sub handler { header => [{col1 => 'Setting', col2 => 'Value'}], ordered => ['description','courseid','categories', - 'hidefromcat','cloners','externalsyllabus', - 'url','rolenames'], + 'hidefromcat','externalsyllabus', + 'url','rolenames','cloners'], itemtext => { description => $lt{'desc'}, courseid => $lt{'idnu'}, categories => $lt{'catg'}, hidefromcat => $lt{'excc'}, cloners => $lt{'clon'}, - externalsyllabus => 'URL of Syllabus', + externalsyllabus => 'External Syllabus URL', url => 'Top Level Map', rolenames => $lt{'rept'}, }, }, 'localization' => - { text => 'Language/TimeZone/Locale', + { text => 'Language & Time Localization', help => 'Course_Environment', header => [{col1 => 'Setting', col2 => 'Value',}], ordered => ['languages','timezone','datelocale'], itemtext => { - languages => 'Languages used', + languages => 'Language(s)', timezone => $lt{'time'}, datelocale => $lt{'date'}, }, }, 'feedback' => - { text => 'Feedback messages', + { text => 'Feedback Messages', help => 'Course_Environment', header => [{col1 => 'Questions about:', col2 => 'Recipients'}, @@ -213,12 +213,12 @@ sub handler { 'allow_limited_html_in_feedback', 'allow_discussion_post_editing'], itemtext => { - 'plc.roles.denied' => 'No Resource Discussion', - 'plc.users.denied' => 'No Resource Discussion', - 'pch.roles.denied' => 'No Chat room use', - 'pch.users.denied' => 'No Chat room use', - allow_limited_html_in_feedback => 'Allow limited HTML in discussion posts', - allow_discussion_post_editing => 'Users can edit/delete own discussion posts', + 'plc.roles.denied' => 'Disable resource discussion', + 'plc.users.denied' => 'Disable resource discussion', + 'pch.roles.denied' => 'Disable chat room', + 'pch.users.denied' => 'Disable chat room', + allow_limited_html_in_feedback => 'HTML in discussion', + allow_discussion_post_editing => 'Allow users to edit/delete own discussion posts', }, }, 'classlists' => @@ -244,7 +244,7 @@ sub handler { }, }, 'appearance' => - { text => 'Display of resources ', + { text => 'Display of Resources ', help => 'Course_Environment', header => [{col1 => 'Setting', col2 => 'Value'}], @@ -252,10 +252,10 @@ sub handler { 'disable_receipt_display','texengine', 'tthoptions'], itemtext => { - default_xml_style => 'Default XML Style File', - pageseparators => 'Visibly Separate Items on Pages', - disable_receipt_display => 'Disable display of problem receipts', - texengine => 'Force use of a specific math rendering engine', + default_xml_style => 'Default XML style file', + pageseparators => 'Separate items on composite pages', + disable_receipt_display => 'Disable problem receipts display', + texengine => 'Force specific math rendering engine', tthoptions => 'Default set of options to pass to tth/m when converting TeX', }, }, @@ -267,27 +267,28 @@ sub handler { ordered => ['grading','rndseed', 'receiptalg','disablesigfigs'], itemtext => { - grading => 'Grading', - rndseed => 'Randomization algorithm used', - receiptalg => 'Receipt algorithm used', - disablesigfigs => 'Disable checking of Significant Figures', + grading => 'Grading Type', + rndseed => 'Randomization algorithm', + receiptalg => 'Receipt algorithm', + disablesigfigs => 'Disable significant figure checks', }, }, 'printouts' => - { text => 'Printout generation', + { text => 'Printouts', help => 'Course_Environment', header => [{col1 => 'Setting', 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' => @@ -365,16 +366,11 @@ sub print_config_box { my $itemtext = $item->{'itemtext'}; my $rowtotal = 0; my $output = - ' - - '."\n". - ''; + '

'.&mt($item->{text}).'

+
 '. + &Apache::loncommon::help_open_topic($item->{'help'}).''; if (($action eq 'feedback') || ($action eq 'classlists')) { $output .= ' -
- - - - - - -
'. - &mt($item->{text}).' '. - &Apache::loncommon::help_open_topic($item->{'help'}).'
@@ -388,10 +384,6 @@ sub print_config_box { } $output .= '
'.&mt($item->{'header'}->[0]->{'col1'}).'
-
'; @@ -402,10 +394,6 @@ sub print_config_box { $output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype). '
'.&mt($item->{'header'}->[1]->{'col1'}).'
-
@@ -414,8 +402,6 @@ sub print_config_box { } } else { $output .= ' - - - -
'.&mt($item->{'header'}->[2]->{'col1'}).'
@@ -448,9 +434,7 @@ sub print_config_box { } $output .= '
'.&mt($item->{'header'}->[0]->{'col1'}).'
-

'; +'; return ($output,$rowtotal); } @@ -983,15 +967,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 +1027,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 +1292,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); @@ -1638,16 +1632,16 @@ sub print_localization { } my %items = ( languages => { - text => &mt($itemtext->{'languages'}).'
    '. - &mt("(will override user's preference)"), + text => ''.&mt($itemtext->{'languages'}).'
    '. + &mt("(overrides individual user preference)"), input => 'selectbox', }, timezone => { - text => &mt($itemtext->{'timezone'}), + text => ''.&mt($itemtext->{'timezone'}).'', input => 'selectbox', }, datelocale => { - text => &mt($itemtext->{'datelocale'}), + text => ''.&mt($itemtext->{'datelocale'}).'', input => 'selectbox', }, ); @@ -2229,7 +2223,7 @@ sub print_grading { }, 'rndseed' => { text => ''.&mt($itemtext->{'rndseed'}).''. - ''.'
    '. + ''.'
    '. &mt('Modifying this will make problems have different numbers and answers!'). '
    ', input => 'selectbox', @@ -2301,6 +2295,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); }