--- loncom/interface/courseprefs.pm 2010/01/07 18:43:32 1.17 +++ loncom/interface/courseprefs.pm 2010/01/18 20:14:25 1.21 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set configuration settings for a course # -# $Id: courseprefs.pm,v 1.17 2010/01/07 18:43:32 faziophi Exp $ +# $Id: courseprefs.pm,v 1.21 2010/01/18 20:14:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -115,15 +115,15 @@ sub handler { %lt = ( conf => 'Course Configuration', edit => 'Edit Course Configuration', - gens => 'General Settings', - idnu => 'ID/Number', - desc => 'Title', + gens => 'General course settings', + idnu => 'Course ID or number', + desc => 'Course Description', catg => 'Categorize course', excc => 'Exclude from course catalog', clon => 'Users allowed to clone course', rept => 'Replacement titles for standard course roles', - time => 'Timezone', - date => 'Calendar Locale', + time => 'Timezone in which the course takes place', + date => 'Locale used for course calendar', coco => 'Course Content', copo => 'Course Policy', priv => 'Domain Coordinators in course', @@ -161,18 +161,16 @@ sub handler { 'courseinfo' => { text => $lt{'gens'}, help => 'Course_Environment', - header => [{col1 => 'Setting', - col2 => 'Value'}], ordered => ['description','courseid','categories', 'hidefromcat','externalsyllabus', - 'url','rolenames','cloners'], + 'cloners','url','rolenames'], itemtext => { description => $lt{'desc'}, courseid => $lt{'idnu'}, categories => $lt{'catg'}, hidefromcat => $lt{'excc'}, cloners => $lt{'clon'}, - externalsyllabus => 'External Syllabus URL', + externalsyllabus => 'URL of Syllabus', url => 'Top Level Map', rolenames => $lt{'rept'}, }, @@ -180,22 +178,18 @@ sub handler { 'localization' => { text => 'Language & Time Localization', help => 'Course_Environment', - header => [{col1 => 'Setting', - col2 => 'Value',}], ordered => ['languages','timezone','datelocale'], itemtext => { - languages => 'Language(s)', + languages => 'Languages used', timezone => $lt{'time'}, datelocale => $lt{'date'}, }, }, 'feedback' => - { text => 'Feedback Messages', + { text => 'Feedback messages', help => 'Course_Environment', header => [{col1 => 'Questions about:', - col2 => 'Recipients'}, - {col1 => 'Questions about:', - col2 => 'Custom Text'}], + col2 => 'Recipients'}], ordered => ['question.email','comment.email','policy.email'], itemtext => { 'question.email' => 'Resource Content', @@ -206,19 +200,17 @@ sub handler { 'discussion' => { text => 'Discussion and Chat', help => 'Course_Environment', - header => [{col1 => 'Setting', - col2 => 'Value',}], ordered => ['plc.roles.denied','plc.users.denied', 'pch.roles.denied','pch.users.denied', 'allow_limited_html_in_feedback', 'allow_discussion_post_editing'], itemtext => { - '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', + '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', + allow_discussion_post_editing => 'Users can edit/delete own discussion posts', }, }, 'classlists' => @@ -244,41 +236,35 @@ sub handler { }, }, 'appearance' => - { text => 'Display of Resources ', + { text => 'Display of resources ', help => 'Course_Environment', - header => [{col1 => 'Setting', - col2 => 'Value'}], ordered => ['default_xml_style','pageseparators', 'disable_receipt_display','texengine', 'tthoptions'], itemtext => { 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', + pageseparators => 'Visibly Separate Items on Pages', + disable_receipt_display => 'Disable display of problem receipts', + texengine => 'Force use of a specific math rendering engine', tthoptions => 'Default set of options to pass to tth/m when converting TeX', }, }, 'grading' => { text => 'Grading', help => 'Course_Environment', - header => [{col1 => 'Setting', - col2 => 'Value',}], ordered => ['grading','rndseed', 'receiptalg','disablesigfigs'], itemtext => { - grading => 'Grading Type', - rndseed => 'Randomization algorithm', - receiptalg => 'Receipt algorithm', - disablesigfigs => 'Disable significant figure checks', + grading => 'Grading', + rndseed => 'Randomization algorithm used', + receiptalg => 'Receipt algorithm used', + disablesigfigs => 'Disable checking of Significant Figures', }, }, 'printouts' => - { text => 'Printouts', + { text => 'Printout generation', help => 'Course_Environment', - header => [{col1 => 'Setting', - col2 => 'Value',}], ordered => ['problem_stream_switch','suppress_tries', 'default_paper_size','print_header_format', 'disableexampointprint','canuse_pdfforms'], @@ -294,8 +280,6 @@ sub handler { 'spreadsheet' => { text => 'Spreadsheets', help => 'Course_Environment', - header => [{col1 => 'Setting', - col2 => 'Value'}], ordered => ['spreadsheet_default_classcalc', 'spreadsheet_default_studentcalc', 'spreadsheet_default_assesscalc','hideemptyrows'], @@ -309,8 +293,6 @@ sub handler { 'bridgetasks' => { text => 'Bridge tasks', help => 'Course_Environment', - header => [{col1 => 'Setting', - col2 => 'Value'}], ordered => ['task_messages','task_grading', 'suppress_embed_prompt'], itemtext => { @@ -371,11 +353,15 @@ sub print_config_box { &Apache::loncommon::help_open_topic($item->{'help'}).''; if (($action eq 'feedback') || ($action eq 'classlists')) { $output .= ' - - +
'; + if (exists $item->{'header'}->[0]->{'col1'} || + exists $item->{'header'}->[0]->{'col2'}) { + $output .= ' + - '; + '; + } $rowtotal ++; if ($action eq 'feedback') { $output .= &print_feedback('top',$cdom,$settings,$ordered,$itemtext,\$rowtotal); @@ -394,19 +380,27 @@ sub print_config_box { $output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype). '
'.&mt($item->{'header'}->[0]->{'col1'}).' '.&mt($item->{'header'}->[0]->{'col2'}).'
- - - - - '; +
'.&mt($item->{'header'}->[2]->{'col1'}).''.&mt($item->{'header'}->[2]->{'col2'}).'
'; + if (exists $item->{'header'}->[0]->{'col1'} || + exists $item->{'header'}->[0]->{'col2'}) { + $output .= ' + + + + '; + } } } else { $output .= ' -
'.&mt($item->{'header'}->[0]->{'col1'}).''.&mt($item->{'header'}->[0]->{'col2'}).'
- +
'; + if (exists $item->{'header'}->[0]->{'col1'} || + exists $item->{'header'}->[0]->{'col2'}) { + $output .= ' + - '; + '; + } } $rowtotal ++; if ($action eq 'courseinfo') { @@ -1313,6 +1307,7 @@ sub print_courseinfo { '', input => 'textbox', size => '40', + advanced => 1 }, 'description' => { text => ''.&mt($itemtext->{'description'}).'', @@ -1330,12 +1325,14 @@ sub print_courseinfo { &mt('Coordinators included automatically'), input => 'textbox', size => '40', + advanced => 1 }, 'rolenames' => { text => ''.&mt($itemtext->{'rolenames'}).'
'. '('.$replace.')', input => 'textbox', size => '20', + advanced => 1 }, 'externalsyllabus' => { text => ''.&mt($itemtext->{'externalsyllabus'}).'
('. @@ -1364,7 +1361,11 @@ sub print_courseinfo { next if (!$can_categorize); } $count ++; - $datatable .= &item_table_row_start($items{$item}{text},$count); + if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) { + $datatable .= &item_table_row_start($items{$item}{text},$count,"advanced"); + } else { + $datatable .= &item_table_row_start($items{$item}{text},$count); + } if ($items{$item}{input} eq 'radio') { $datatable .= &yesno_radio($item,$settings); } elsif ($item eq 'cloners') { @@ -1750,16 +1751,20 @@ sub print_feedback { my %sections = &Apache::loncommon::get_sections($cdom,$cnum); my @sections = sort( { $a <=> $b } keys(%sections)); my %lt = &Apache::lonlocal::texthash ( - currone => 'Current recipient:', - curmult => 'Current recipients:', - add => 'Additional recipient:', - del => 'Delete?', - sec => 'Sections:', + currone => 'Current recipient:', + currmult => 'Current recipients:', + add => 'Additional recipient:', + del => 'Delete?', + sec => 'Sections:', ); foreach my $item (@{$ordered}) { $count ++; - $datatable .= &item_table_row_start($items{$item}{text},$count); + if ($position eq 'top') { + $datatable .= &item_table_row_start($items{$item}{text},$count); + } else { + $datatable .= &item_table_row_start($items{$item}{text}."
(Custom text)",$count, "advanced"); + } if ($position eq 'top') { my $includeempty = 0; $datatable .= &user_table($cdom,$item,\@sections, @@ -1815,7 +1820,7 @@ sub user_table { if ($num) { $output .= ''. ''; - } else { - $output .= ''; - } + my $css_class = ($count % 2) ? 'LC_odd_row' : 'LC_even_row'; + $css_class = (join(' ',$css_class,$add_class)) unless ($add_class eq ''); + $output .= ''."\n";; $output .= '
'.&mt($item->{'header'}->[0]->{'col1'}).' '.&mt($item->{'header'}->[0]->{'col2'}).'
'; - if ($num > 1) { + if ($num == 1) { $output .= $lt->{'currone'}; } else { $output .= $lt->{'currmult'}; @@ -1935,11 +1940,11 @@ sub print_discussion { my %sections = &Apache::loncommon::get_sections($cdom,$cnum); my @sections = sort( { $a <=> $b } keys(%sections)); my %lt = &Apache::lonlocal::texthash ( - currone => 'Disallowed:', - curmult => 'Disallowed:', - add => 'Disallow more:', - del => 'Delete?', - sec => 'Sections:', + currone => 'Disallowed:', + currmult => 'Disallowed:', + add => 'Disallow more:', + del => 'Delete?', + sec => 'Sections:', ); foreach my $item (@{$ordered}) { @@ -2435,15 +2440,13 @@ sub get_other_items { } sub item_table_row_start { - my ($text,$count) = @_; + my ($text,$count,$add_class) = @_; my $output; - if ($count%2) { - $output .= '
'.$text. - ''; + ''; return $output; }