--- loncom/interface/courseprefs.pm 2015/03/11 00:28:28 1.49.2.17 +++ loncom/interface/courseprefs.pm 2013/09/01 01:12:01 1.60 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set configuration settings for a course # -# $Id: courseprefs.pm,v 1.49.2.17 2015/03/11 00:28:28 raeburn Exp $ +# $Id: courseprefs.pm,v 1.60 2013/09/01 01:12:01 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -215,14 +215,10 @@ use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonconfigsettings; -use Apache::lonrelrequtils; use Apache::lonparmset; use Apache::lonlocal; use LONCAPA qw(:DEFAULT :match); -my $registered_cleanup; -my $modified_courses; - sub handler { my $r=shift; if ($r->header_only) { @@ -232,7 +228,7 @@ sub handler { } my $context = 'course'; my $cid = $env{'request.course.id'}; - my ($cnum,$cdom,$chome) = &get_course($cid); + my ($cnum,$cdom) = &get_course($cid); my $crstype = &Apache::loncommon::course_type(); my $parm_permission = &Apache::lonnet::allowed('opa',$cid); my $navmap = Apache::lonnavmaps::navmap->new(); @@ -261,9 +257,6 @@ sub handler { return HTTP_NOT_ACCEPTABLE; } - $registered_cleanup=0; - @{$modified_courses}=(); - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['phase','actions','origin']); &Apache::lonhtmlcommon::clear_breadcrumbs(); @@ -279,7 +272,6 @@ sub handler { edit => 'Edit Community Settings', gens => 'General community settings', idnu => 'Community ID or number', - unco => 'Unique code', desc => 'Community Description', ownr => 'Community Owner', cown => 'Community Co-owners', @@ -307,9 +299,8 @@ sub handler { edit => 'Edit Course Settings', gens => 'General course settings', idnu => 'Course ID or number', - unco => 'Unique code', desc => 'Course Description', - cred => 'Student credits', + cred => 'Student credits', ownr => 'Course Owner', cown => 'Course Co-owners', catg => 'Categorize course', @@ -351,14 +342,7 @@ sub handler { if ($phase eq 'releaseinfo') { my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'}; if ($loncaparev) { - if (&display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype)) { - push(@{$modified_courses},[$cdom,$cnum,$chome,$crstype]); - unless ($registered_cleanup) { - my $handlers = $r->get_handlers('PerlCleanupHandler'); - $r->set_handlers('PerlCleanupHandler' => [\&update_releasereq,@{$handlers}]); - $registered_cleanup=1; - } - } + &display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype); return OK; } } @@ -373,15 +357,13 @@ sub handler { { text => $lt{'gens'}, help => 'Course_Prefs_General', ordered => ['owner','co-owners','loncaparev','description', - 'clonedfrom','courseid','uniquecode','categories', - 'hidefromcat','externalsyllabus','cloners','url', - 'rolenames'], + 'courseid','categories','hidefromcat', + 'externalsyllabus','cloners','url','rolenames'], itemtext => { 'owner' => $lt{'ownr'}, 'co-owners' => $lt{'cown'}, 'description' => $lt{'desc'}, 'courseid' => $lt{'idnu'}, - 'uniquecode' => $lt{'unco'}, 'categories' => $lt{'catg'}, 'hidefromcat' => $lt{'excc'}, 'cloners' => $lt{'clon'}, @@ -389,7 +371,6 @@ sub handler { 'url' => 'Top Level Map', 'rolenames' => $lt{'rept'}, 'loncaparev' => $lt{'lcrv'}, - 'clonedfrom' => 'Cloned from', }, }, 'localization' => @@ -463,15 +444,13 @@ sub handler { help => 'Course_Prefs_Display', ordered => ['default_xml_style','pageseparators', 'disable_receipt_display','texengine', - 'tthoptions','uselcmath','usejsme'], + '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', tthoptions => 'Default set of options to pass to tth/m when converting TeX', - uselcmath => 'Student formula entry uses inline preview, not DragMath pop-up', - usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)', }, }, 'grading' => @@ -492,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', @@ -726,8 +705,7 @@ sub process_changes { next if (($entry eq 'categories') && (!$can_categorize)); next if (($entry eq 'loncaparev') || - ($entry eq 'owner') || - ($entry eq 'clonedfrom')); + ($entry eq 'owner')); push(@ordered,$entry); } } elsif ($action eq 'classlists') { @@ -1049,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; @@ -1064,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}; @@ -1073,7 +1051,7 @@ sub process_changes { } if ($fontchange) { $changes->{$entry} = 1; - } + } } elsif ($entry eq 'nothideprivileged') { my @curr_nothide; my @new_nothide; @@ -1148,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'}; @@ -1164,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; @@ -1407,7 +1385,7 @@ sub store_changes { $displayval = &Apache::lonlocal::locallocaltime($displayval); } elsif ($key eq 'categories') { $displayval = $env{'form.categories_display'}; - } elsif (($key eq 'canuse_pdfforms') || ($key eq 'usejsme') || ($key eq 'uselcmath')) { + } elsif ($key eq 'canuse_pdfforms') { if ($changes->{$item}{$key} eq '1') { $displayval = &mt('Yes'); } elsif ($changes->{$item}{$key} eq '0') { @@ -1679,8 +1657,7 @@ sub get_course { } my $cdom=$env{'course.'.$courseid.'.domain'}; my $cnum=$env{'course.'.$courseid.'.num'}; - my $chome=$env{'course.'.$courseid.'.home'}; - return ($cnum,$cdom,$chome); + return ($cnum,$cdom); } sub get_jscript { @@ -1730,7 +1707,7 @@ function syllabusinfo() { } ENDSCRIPT $jscript = '