--- loncom/interface/courseprefs.pm 2013/06/27 03:09:17 1.49.2.9 +++ loncom/interface/courseprefs.pm 2013/04/11 15:30:37 1.56 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set configuration settings for a course # -# $Id: courseprefs.pm,v 1.49.2.9 2013/06/27 03:09:17 raeburn Exp $ +# $Id: courseprefs.pm,v 1.56 2013/04/11 15:30:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -288,7 +288,7 @@ sub handler { stuv => 'Member-viewable membership list options', stul => 'Member agreement needed to be listed', clas => 'Membership and facilitator listing', - prus => 'Privileged users (Domain Coordinators) in facilitator listing', + priv => 'Privileged users (Domain Coordinators) in facilitator listing', defc => 'Default Community Spreadsheet', defs => 'Default User Spreadsheet', seme => 'Send message to member when clicking Done on Tasks' @@ -300,7 +300,7 @@ sub handler { gens => 'General course settings', idnu => 'Course ID or number', desc => 'Course Description', - cred => 'Student credits', + cred => 'Student credits', ownr => 'Course Owner', cown => 'Course Co-owners', catg => 'Categorize course', @@ -316,7 +316,7 @@ sub handler { stuv => 'Student-viewable classlist options', stul => 'Student agreement needed to be listed', clas => 'Classlists and staff listing', - prus => 'Privileged users (Domain Coordinators) in staff listing', + priv => 'Privileged users (Domain Coordinators) in staff listing', prdo => "Domains to check for privileged users (besides course's domain)", defc => 'Default Course Spreadsheet', defs => 'Default Student Spreadsheet', @@ -431,7 +431,7 @@ sub handler { itemtext => { default_enrollment_start_date => 'Start date', default_enrollment_end_date => 'End date', - nothideprivileged => $lt{'prus'}, + nothideprivileged => $lt{'priv'}, checkforpriv => $lt{'prdo'}, student_classlist_view => $lt{'stuv'}, student_classlist_opt_in => $lt{'stul'}, @@ -471,7 +471,7 @@ sub handler { help => 'Course_Prefs_Printouts', 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', @@ -1027,14 +1027,14 @@ sub process_changes { my ($classorder,$classtitles) = &discussion_vote_classes(); my $fontchange = 0; foreach my $class (@{$classorder}) { - my $ext_entry = $entry.'_'.$class; + my $ext_entry = $entry.'_'.$class; my $size = $env{'form.'.$ext_entry.'_size'}; my $unit = $env{'form.'.$ext_entry.'_unit'}; my $weight = $env{'form.'.$ext_entry.'_weight'}; my $style = $env{'form.'.$ext_entry.'_style'}; my $other = $env{'form.'.$ext_entry.'_other'}; $size =~ s/,//g; - $unit =~ s/,//g; + $unit =~ s/,//g; $weight =~ s/,//g; $style =~ s/,//g; $other =~ s/[^\w;:\s\-\%.]//g; @@ -1042,7 +1042,7 @@ sub process_changes { $newvalues{$ext_entry} = join(',',($size.$unit,$weight,$style,$other)); my $current = $values->{$ext_entry}; if ($values->{$ext_entry} eq '') { - $current = ',,,'; + $current = ',,,'; } if ($newvalues{$ext_entry} ne $current) { $changes->{$ext_entry} = $newvalues{$ext_entry}; @@ -1051,7 +1051,7 @@ sub process_changes { } if ($fontchange) { $changes->{$entry} = 1; - } + } } elsif ($entry eq 'nothideprivileged') { my @curr_nothide; my @new_nothide; @@ -1126,7 +1126,7 @@ sub process_changes { my $newtext = $maxnum-1; $newhdr[$env{'form.printfmthdr_pos_'.$newtext}] = $env{'form.printfmthdr_text_'.$newtext}; $newvalues{$entry} = join('',@newhdr); - } elsif (($entry eq 'languages') || + } elsif (($entry eq 'languages') || ($entry eq 'checkforpriv')) { my $settings; my $total = $env{'form.'.$entry.'_total'}; @@ -1142,7 +1142,7 @@ sub process_changes { } if ($env{'form.'.$entry.'_'.$total} ne '') { my $new = $env{'form.'.$entry.'_'.$total}; - if ($entry eq 'languages') { + if ($entry eq 'languages') { my %langchoices = &get_lang_choices(); if ($langchoices{$new}) { $settings .= $new; @@ -1695,7 +1695,7 @@ function loncaparevinfo() { ENDSCRIPT } $jscript = ''."\n".$stubrowse_js."\n"; @@ -1891,7 +1891,7 @@ sub print_courseinfo { next if (!$can_categorize); } unless (($item eq 'cloners') || ($item eq 'rolenames')) { - $colspan = 2; + $colspan = 2; } $count ++; if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) { @@ -2239,13 +2239,6 @@ sub display_loncaparev_constraints { if ($key =~ /(\Q$item\E)$/) { if (ref($checkparms{$item}) eq 'ARRAY') { my $value = $resourcedata->{$key}; - if ($item eq 'examcode') { - if (&Apache::lonnet::validCODE($value)) { - $value = 'valid'; - } else { - $value = ''; - } - } my ($middle,$scope,$which,$level,$map,$resource); if (grep(/^\Q$value\E$/,@{$checkparms{$item}})) { my $stdtype = &Apache::lonparmset::standard_parameter_types($item); @@ -2491,7 +2484,7 @@ sub show_contents_view { ''.&mt('Attribute/Setting').''. &Apache::loncommon::end_data_table_header_row(). &Apache::loncommon::start_data_table_row(). - ' '.$icon.' '.&mt('Main Content').''); + ' '.$icon.' '.&mt('Main Course Documents').''); &releases_by_map($r,$bymap,$topmap,$scopeorder,$lt); $r->print(&Apache::loncommon::end_data_table_row()); my $it=$navmap->getIterator(undef,undef,undef,1,1,undef); @@ -2815,7 +2808,7 @@ sub print_localization { $count ++; my $colspan; unless ($item eq 'languages') { - $colspan = 2; + $colspan = 2; } $datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); if ($item eq 'timezone') { @@ -2935,8 +2928,8 @@ sub print_feedback { } if ($position eq 'top') { my $includeempty = 0; - $datatable .= ''. - &user_table($cdom,$item,\@sections, + $datatable .= ''. + &user_table($cdom,$item,\@sections, $settings->{$item},\%lt); } else { $datatable .= &Apache::lonhtmlcommon::textbox($item.'.text', @@ -3125,15 +3118,15 @@ sub print_discussion { my $colspan; if ($item eq 'allow_limited_html_in_feedback') { $colspan = 2; - } + } $datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); if ($item eq 'plc.roles.denied') { $datatable .= ''. ''.&role_checkboxes($cdom,$cnum,$item,$settings). '
'; } elsif ($item eq 'plc.users.denied') { - $datatable .= ''. - &user_table($cdom,$item,undef, + $datatable .= ''. + &user_table($cdom,$item,undef, $settings->{$item},\%lt); } elsif ($item eq 'pch.roles.denied') { $datatable .= ''. @@ -3162,7 +3155,7 @@ sub print_discussion { ''.&mt('font-size').''. ''.&mt('font-weight').''. ''.&mt('font-style').''. - ''.&mt('Other css').''. + ''.&mt('Other css').''. &Apache::loncommon::end_data_table_row(). &set_discussion_fonts($cdom,$cnum,$item,$settings). &Apache::loncommon::end_data_table().'
'; @@ -3334,7 +3327,7 @@ sub set_discussion_fonts { sub discussion_vote_classes { my $classorder = ['twoplus','oneplus','zero','oneminus','twominus']; - my %classtitles = &Apache::lonlocal::texthash( + my %classtitles = &Apache::lonlocal::texthash( 'twoplus' => 'Two sigma above mean', 'oneplus' => 'One sigma above mean', 'zero' => 'Within one sigma of mean', @@ -3400,7 +3393,7 @@ sub print_classlists { 'defaultcredits' => { text => ''.&mt($itemtext->{'defaultcredits'}).'', }, - + 'nothideprivileged' => { text => ''.&mt($itemtext->{'nothideprivileged'}).'', input => 'checkbox', @@ -3495,11 +3488,12 @@ sub print_grading { input => 'selectbox', options => { standard => &mt('Standard: shows points'), + categories => &mt('Categories: shows points according to categories'), external => &mt('External: shows number of completed parts and totals'), externalnototals => &mt('External: shows only number of completed parts'), spreadsheet => &mt('Spreadsheet: (with link to detailed scores)'), }, - order => ['standard','external','externalnototals','spreadsheet'], + order => ['standard','categories','external','externalnototals','spreadsheet'], }, 'rndseed' => { text => ''.&mt($itemtext->{'rndseed'}).''. @@ -3872,7 +3866,7 @@ sub nothidepriv_row { } } if ($settings->{'checkforpriv'}) { - @checkdoms = split(/,/,$settings->{'checkforpriv'}); + @checkdoms = split(/,/,$settings->{'checkforpriv'}); } } push(@checkdoms,$cdom); @@ -3886,7 +3880,7 @@ sub nothidepriv_row { if ($end == -1 || $start == -1) { next; } - foreach my $dom (@checkdoms) { + foreach my $dom (@checkdoms) { if (&Apache::lonnet::privileged($uname,$udom,\@checkdoms,['dc','su'])) { unless (grep(/^\Q$user\E$/,@privusers)) { push(@privusers,$user); @@ -3952,7 +3946,7 @@ sub checkforpriv_row { my $domdesc = &Apache::lonnet::domain($currdom,'description'); if ($domdesc eq '') { $domdesc = $currdom; - } + } $datatable .= &Apache::loncommon::start_data_table_row(). ''. @@ -3964,13 +3958,13 @@ sub checkforpriv_row { &mt('Delete').''. &Apache::loncommon::end_data_table_row(); $num ++; - unless (grep(/^\Q$currdom\E$/,@excdoms)) { + unless (grep(/^\Q$currdom\E$/,@excdoms)) { push(@excdoms,$currdom); } } } if ((scalar(keys(%domains)) - scalar(@excdoms)) > 0) { - $datatable .= + $datatable .= &Apache::loncommon::start_data_table_row(). ''. &mt('Additional domain:'). '
'.