--- loncom/interface/courseprefs.pm	2010/12/26 05:22:21	1.28.2.8
+++ loncom/interface/courseprefs.pm	2010/08/21 04:04:54	1.29
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set configuration settings for a course
 #
-# $Id: courseprefs.pm,v 1.28.2.8 2010/12/26 05:22:21 raeburn Exp $
+# $Id: courseprefs.pm,v 1.29 2010/08/21 04:04:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -320,7 +320,6 @@ sub handler {
                 seme => 'Send message to student when clicking Done on Tasks',
               );
     }
-    $lt{'lcrv'} = 'Required LON-CAPA version';
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/courseprefs',
         text=>$lt{'conf'}});
     my $breadcrumbs =
@@ -336,14 +335,6 @@ sub handler {
         return OK;
     }
 
-    if ($phase eq 'releaseinfo') {
-        my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'};
-        if ($loncaparev) {
-            &display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype);
-            return OK;
-        }
-    }
-
     my %values=&Apache::lonnet::dump('environment',$cdom,$cnum);
     my @prefs_order = ('courseinfo','localization','feedback','discussion',
                        'classlists','appearance','grading','printouts',
@@ -353,11 +344,9 @@ sub handler {
         'courseinfo' =>
                    { text => $lt{'gens'},
                      help => 'Course_Environment',
-                     header => [{col1 => 'Setting',
-                                 col2 => 'Value'}],
-                     ordered => ['owner','co-owners','loncaparev','description',
-                                 'courseid','categories','hidefromcat',
-                                 'externalsyllabus','cloners','url','rolenames'],
+                     ordered => ['owner','co-owners','description','courseid',
+                                 'categories','hidefromcat','externalsyllabus',
+                                 'cloners','url','rolenames'],
                      itemtext => {
                                    'owner'            => $lt{'ownr'},
                                    'co-owners'        => $lt{'cown'},
@@ -369,14 +358,11 @@ sub handler {
                                    'externalsyllabus' => 'URL of Syllabus',
                                    'url'              => 'Top Level Map',
                                    'rolenames'        => $lt{'rept'},
-                                   'loncaparev'       => $lt{'lcrv'},
                                  },
                     },
         'localization' =>
                     { text => 'Language and Time Localization',
                       help => 'Course_Environment',
-                      header => [{col1 => 'Setting',
-                                  col2 => 'Value',}],
                       ordered => ['languages','timezone','datelocale'],
                       itemtext => {
                                     languages  => 'Languages used',
@@ -388,9 +374,7 @@ sub handler {
                     { 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',
@@ -401,15 +385,15 @@ sub handler {
         'discussion' =>
                     { text => 'Discussion and Chat',
                       help => 'Course_Environment',
-                      ordered => ['pch.roles.denied','pch.users.denied',
-                                  'plc.roles.denied','plc.users.denied',
+                      ordered => ['plc.roles.denied','plc.users.denied',
+                                  'pch.roles.denied','pch.users.denied',
                                   'allow_limited_html_in_feedback',
                                   'allow_discussion_post_editing'],
                       itemtext => {
-                         'pch.roles.denied'             => 'No Resource Discussion',
-                         'pch.users.denied'             => 'No Resource Discussion',
-                         'plc.roles.denied'             => 'No Chat room use',
-                         'plc.users.denied'             => 'No Chat room use',
+                         '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',
                                   },
@@ -439,8 +423,6 @@ sub handler {
         'appearance' =>
                    { text => 'Display of resources ',
                      help => 'Course_Environment',
-                     header => [{col1 => 'Setting',
-                                 col2 => 'Value',}],
                      ordered => ['default_xml_style','pageseparators',
                                  'disable_receipt_display','texengine',
                                  'tthoptions'],
@@ -455,8 +437,6 @@ sub handler {
         'grading' =>
                   { text => 'Grading',
                     help => 'Course_Environment',
-                    header => [{col1 => 'Setting',
-                                col2 => 'Value',}],
                     ordered => ['grading','rndseed',
                                 'receiptalg','disablesigfigs'],
                     itemtext => {
@@ -470,8 +450,6 @@ sub handler {
         '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'],
@@ -487,8 +465,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'],
@@ -502,8 +478,6 @@ sub handler {
         'bridgetasks' =>
                   { text => 'Bridge tasks',
                     help => 'Course_Environment',
-                    header => [{col1 => 'Setting',
-                                col2 => 'Value'}],
                     ordered => ['task_messages','task_grading',
                                 'suppress_embed_prompt'],
                     itemtext => {
@@ -526,7 +500,7 @@ sub handler {
                                                  \@prefs_order,\%prefs,\%values,
                                                   $cnum,undef,\@allitems);
     } elsif ($phase eq 'display') {
-        my $jscript = &get_jscript($cid,$cdom,$phase,$crstype);
+        my $jscript = &get_jscript($cdom,$phase,$crstype);
         my @allitems = &get_allitems(%prefs);
         &Apache::lonconfigsettings::display_settings($r,$cdom,$phase,$context,
             \@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype);
@@ -559,17 +533,12 @@ sub print_config_box {
     my $itemtext = $item->{'itemtext'};
     my $rowtotal = 0;
     my $output =
-         '<table class="LC_nested_outer">
-          <tr>
-           <th align="left" valign="middle"><span class="LC_nobreak" style="font-size: larger;" >'.
-           &mt($item->{text}).'&nbsp;'.
-           &Apache::loncommon::help_open_topic($item->{'help'}).'</span></th>'."\n".
-          '</tr>';
+        '<h3><a href="#">'.&mt($item->{text}).'</a></h3>
+        <div>&nbsp;<span style="float:right">'.
+         &Apache::loncommon::help_open_topic($item->{'help'}).'</span>';
     if (($action eq 'feedback') || ($action eq 'classlists')) {
         $output .= '
-          <tr>
-           <td>
-            <table class="LC_nested">';
+            <table class="LC_nested">';   
         if (exists $item->{'header'}->[0]->{'col1'} || 
             exists $item->{'header'}->[0]->{'col2'}) {
 			$output .= '          
@@ -586,10 +555,6 @@ sub print_config_box {
         }
         $output .= '
            </table>
-          </td>
-         </tr>
-         <tr>
-           <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
               <td class="LC_left_item">'.&mt($item->{'header'}->[1]->{'col1'}).'</td>';
@@ -600,10 +565,6 @@ sub print_config_box {
             $output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype).
                        '
             </table>
-           </td>
-          </tr>
-          <tr>
-           <td>
             <table class="LC_nested">';
             if (exists $item->{'header'}->[0]->{'col1'} || 
             	exists $item->{'header'}->[0]->{'col2'}) {
@@ -612,12 +573,10 @@ sub print_config_box {
 				  <td class="LC_left_item">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>
 				  <td class="LC_right_item">'.&mt($item->{'header'}->[0]->{'col2'}).'</td>
 				</tr>';
-            }
+        	}
         }
     } else {
         $output .= '
-          <tr>
-           <td>
             <table class="LC_nested">';
         if (exists $item->{'header'}->[0]->{'col1'} || 
             exists $item->{'header'}->[0]->{'col2'}) {
@@ -654,9 +613,7 @@ sub print_config_box {
     }
     $output .= '
    </table>
-  </td>
- </tr>
-</table><br />';
+</div>';
     return ($output,$rowtotal);
 }
 
@@ -722,7 +679,6 @@ sub process_changes {
                     }
                 } else {
                     foreach my $entry (@ordered) {
-                        next if (($entry eq 'loncaparev') || ($entry eq 'owner'));
                         if ($entry eq 'cloners') {
                             if ($env{'form.cloners_all'}) {
                                 $newvalues{$entry} = '*';
@@ -731,8 +687,8 @@ sub process_changes {
                                 if (exists($env{'form.cloners_activate'})) {
                                     my $actnum = $env{'form.cloners_activate'};
                                     if ($actnum ne '') {
-                                        if ($env{'form.cloners_dom_'.$actnum} ne '') {
-                                            my $clonedom = $env{'form.cloners_dom_'.$actnum};
+                                        if ($env{'form.clonersdom_'.$actnum} ne '') {
+                                            my $clonedom = $env{'form.clonersdom_'.$actnum};
                                             if (&check_clone($clonedom,$disallowed) eq 'ok') {
                                                 $newvalues{$entry} = '*:'.$clonedom;
                                                 push(@clonedoms,$newvalues{$entry});
@@ -1340,7 +1296,7 @@ sub store_changes {
                                         if ($key eq 'url') {
                                             my $bkuptime=time;
                                             $output .= ('&nbsp;'x2).&mt('(Previous URL backed up)').': '.
-                                            $storehash{'top level map backup '.$bkuptime} = $values->{$key};
+                                            $storehash{'top level map backup '.$bkuptime} => $values->{$key};
                                         }
                                         $output .= '</li>';
                                     }
@@ -1555,9 +1511,9 @@ sub get_course {
 }
 
 sub get_jscript {
-    my ($cid,$cdom,$phase,$crstype) = @_;
+    my ($cdom,$phase,$crstype) = @_;
     my ($can_toggle_cat,$can_categorize) = &can_modify_catsettings($cdom,$crstype);
-    my ($jscript,$categorize_js,$loncaparev_js);
+    my ($jscript,$categorize_js);
     my $stubrowse_js = &Apache::loncommon::studentbrowser_javascript();
     my $browse_js = &Apache::loncommon::browser_and_searcher_javascript('parmset');
     my $cloners_js = &cloners_javascript($phase);
@@ -1574,23 +1530,9 @@ function catsbrowser() {
 }
 ENDSCRIPT
     }
-    my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'};
-    if ($loncaparev) {
-        $loncaparev_js = <<ENDSCRIPT;
-function loncaparevinfo() {
-    var lcrevwin = null;
-    var url = '/adm/courseprefs?phase=releaseinfo';
-    if (!lcrevwin || lcrevwin.closed) {
-        lcrevwin=window.open(url,'releasewin','height=480,width=600,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');
-    } else {
-        lcrevwin.focus();
-    }
-}
-ENDSCRIPT
-    }
     $jscript = '<script type="text/javascript" language="Javascript">'."\n".
-               $browse_js."\n".$categorize_js."\n".$loncaparev_js."\n".
-               $cloners_js."\n".'</script>'."\n".$stubrowse_js."\n";
+               $browse_js."\n".$categorize_js."\n".$cloners_js."\n".'</script>'.
+               "\n".$stubrowse_js."\n";
     return $jscript;
 }
 
@@ -1717,6 +1659,7 @@ sub print_courseinfo {
                            '</span>',
                    input => 'textbox',
                    size  => '40',
+                   advanced => 1
                  },
         'description'  => { 
                    text => '<b>'.&mt($itemtext->{'description'}).'</b>',
@@ -1740,12 +1683,14 @@ sub print_courseinfo {
                            &mt('Owner and Coordinators included automatically'),
                    input => 'textbox',
                    size  => '40',
+                   advanced => 1
                          },
         'rolenames'  => { 
                    text  => '<b>'.&mt($itemtext->{'rolenames'}).'</b><br />'.
                             '('.$replace.')',
                    input => 'textbox',
                    size  => '20',
+                   advanced => 1
                         },
         'externalsyllabus' => {
                    text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />('.
@@ -1764,9 +1709,6 @@ sub print_courseinfo {
                    input => 'textbox',
                    size  => '25',
                         },
-        'loncaparev' => {
-                   text => '<b>'.&mt($itemtext->{'loncaparev'}).'</b>',
-                        },
     );
     my $datatable;
     my $count = 0;
@@ -1777,7 +1719,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') {
@@ -1900,6 +1846,7 @@ sub print_courseinfo {
             } else {
                 $owner = &mt('None specified');
             }
+            my $domdesc = &Apache::lonnet::domain($cdom,'description');
             $datatable .= $owner;
         } elsif ($item eq 'co-owners') {
             my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
@@ -1921,16 +1868,6 @@ sub print_courseinfo {
                     $datatable .= &manage_coownership($cnum,$cdom,@currcoown);
                 }
             }
-        } elsif ($item eq 'loncaparev') {
-            my $loncaparev = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'};
-            my $showreqd;
-            if ($loncaparev) {
-                $showreqd = &mt('[_1] or newer',$loncaparev).' <a href="javascript:loncaparevinfo()">'.
-                            &mt('Details').'</a>';
-            } else {
-                $showreqd = &mt('No specific version required');
-            }
-            $datatable .= $showreqd;
         } else {
             $datatable .= &Apache::lonhtmlcommon::textbox($item,$settings->{$item},$items{$item}{size});
         }
@@ -2088,455 +2025,6 @@ ENDSCRIPT
     return;
 }
 
-sub display_loncaparev_constraints {
-    my ($r,$navmap,$loncaparev,$crstype) = @_;
-    my $cid = $env{'request.course.id'};
-    my $cdom = $env{'course.'.$cid.'.domain'};
-    my $cnum = $env{'course.'.$cid.'.num'};
-    my $output;
-    my %lt = &Apache::lonlocal::texthash (
-                                           'all'           => 'all',
-                                           'section/group' =>  'section/group',
-                                           'user'          => 'user',
-                                         );
-    my (%checkparms,%checkresponsetypes,%checkcrstypes,%anonsurvey,%randomizetry);
-    &Apache::loncommon::build_release_hashes(\%checkparms,\%checkresponsetypes,
-                                              \%checkcrstypes,\%anonsurvey,\%randomizetry);
-    if (defined($checkcrstypes{$crstype})) {
-        $output .= '<h4>'.&mt('Course type: [_1] requires [_2] or newer',$crstype,
-                              $checkcrstypes{$crstype}).'</h4>';
-    }
-    my (%fromparam,%rowspan,%bymap,%byresource,@scopeorder,%toshow,%allmaps,
-        %byresponsetype,%bysubmission);
-    @scopeorder = ('all','section/group','user');
-    my $resourcedata = &Apache::lonparmset::readdata($cnum,$cdom);
-    if (ref($resourcedata) eq 'HASH') {
-        foreach my $key (keys(%{$resourcedata})) {
-            foreach my $item (keys(%checkparms)) {
-                if ($key =~ /(\Q$item\E)$/) {
-                     if (ref($checkparms{$item}) eq 'ARRAY') {
-                         my $value = $resourcedata->{$key};
-                         my ($middle,$scope,$which,$level,$map,$resource);
-                         if (grep(/^\Q$value\E$/,@{$checkparms{$item}})) {
-                             my $stdtype = &Apache::lonparmset::standard_parameter_types($item);
-                             my $stdname = &Apache::lonparmset::standard_parameter_names($item);
-                             my $valname = &get_param_description($stdtype,$value);
-                             my $rev = $Apache::lonnet::needsrelease{'parameter:'.$item.':'.$value};
-                             my $start = $cid.'.';
-                             if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) {
-                                 $middle = $1;
-                                 $which = $2;
-                                 $scope = 'user';
-                             } elsif ($key =~ /^\Q$start\E(\[(\w+)\]\.)/) {
-                                 $middle = $1;
-                                 $which = $2;
-                                 $scope = 'section/group';
-                             } else {
-                                 $scope = 'all';
-                             }
-                             my $what="$stdname=$valname";
-                             if ($key =~ /^\Q$start$middle\E\w+\.\Q$item\E$/) {
-                                 $level = 'general';
-                                 if ($scope eq 'all') {
-                                     if (ref($fromparam{$rev}{$scope}) eq 'ARRAY') {
-                                         unless(grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}})) {
-                                             push(@{$fromparam{$rev}{$scope}},$what);
-                                         }
-                                     } else {
-                                         push(@{$fromparam{$rev}{$scope}},$what);
-                                     }
-                                 } else {
-                                     if (ref($fromparam{$rev}{$scope}{$which}) eq 'ARRAY') {
-                                         unless (grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}{$which}})) {
-                                             push(@{$fromparam{$rev}{$scope}{$which}},$what);
-                                         }
-                                     } else {
-                                         push(@{$fromparam{$rev}{$scope}{$which}},$what);
-                                     }
-                                 }
-                                 $rowspan{$rev} ++;
-                             } elsif ($key =~ /^\Q$start$middle\E(.+)___\(all\).\w+\.\Q$item\E$/) {
-                                 $level = 'folder';
-                                 $map = $1;
-                                 if ($scope eq 'all') {
-                                     if (ref($bymap{$map}{$rev}{$scope}) eq 'ARRAY') {
-                                         unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}})) {
-                                             push(@{$bymap{$map}{$rev}{$scope}},$what);
-                                         }
-                                     } else {
-                                         push(@{$bymap{$map}{$rev}{$scope}},$what);
-                                     }
-                                 } else {
-                                     if (ref($bymap{$map}{$rev}{$scope}{$which}) eq 'ARRAY') {
-                                         unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}{$which}})) {
-                                             push(@{$bymap{$map}{$rev}{$scope}{$which}},$what);
-                                         }
-                                     } else {
-                                         push(@{$bymap{$map}{$rev}{$scope}{$which}},$what);
-                                     }
-                                 }
-                             } elsif ($key =~ /^\Q$start$middle\E(.+)\.\w+\.\Q$item\E$/) {
-                                 $level = 'resource';
-                                 $resource = $1;
-                                 if ($scope eq 'all') {
-                                     if (ref($byresource{$resource}{$rev}{$scope}) eq 'ARRAY') {
-                                         unless(grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}})) {
-                                             push(@{$byresource{$resource}{$rev}{$scope}},$what);
-                                         }
-                                     } else {
-                                         push(@{$byresource{$resource}{$rev}{$scope}},$what);
-                                     }
-                                 } else {
-                                     if (ref($byresource{$resource}{$rev}{$scope}{$which}) eq 'ARRAY') {
-                                         unless (grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}{$which}})) {
-                                             push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what);
-                                         }
-                                     } else {
-                                         push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what);
-                                     }
-                                 }
-                             }
-                        }
-                    }
-                }
-            }
-        }
-        if (keys(%fromparam)) {
-            $output .= '<h4>'.&mt('Requirements from general settings').'</h4>'.
-                       &Apache::loncommon::start_data_table().
-                       &Apache::loncommon::start_data_table_header_row().
-                       '<th>'.&mt('Release').'</th><th>'.&mt('Scope').'</th>'.
-                       '<th>'.&mt('Extent').'</th><th>'.&mt('Setting').'</th>'.
-                       &Apache::loncommon::end_data_table_header_row();
-            foreach my $rev (keys(%fromparam)) {
-                $output .=  &Apache::loncommon::start_data_table_row().
-                            '<td rowspan="'.$rowspan{$rev}.'">'.$rev.'</td>';
-                my $newrow;
-                foreach my $scope (@scopeorder) {
-                    if (ref($fromparam{$rev}{$scope}) eq 'HASH') {
-                         if ($newrow) {
-                             $output .= &Apache::loncommon::continue_data_table_row();
-                         }
-                         $output .= '<td>'.$lt{$scope}.'</td>';
-                         foreach my $which (sort(keys(%{$fromparam{$rev}{$scope}}))) {
-                             $output .= '<td>'.$which.'</td><td>'.
-                                        join('<br />',@{$fromparam{$rev}{$scope}{$which}}).'</td>';
-                         }
-                         $output .= &Apache::loncommon::end_data_table_row();
-                         $newrow = 1;
-                    } elsif (ref($fromparam{$rev}{$scope}) eq 'ARRAY') {
-                         if ($newrow) {
-                             $output .= &Apache::loncommon::continue_data_table_row();
-                         }
-                         $output .= '<td>'.$lt{$scope}.'</td><td>&nbsp;</td><td>'.
-                                    join('<br />',@{$fromparam{$rev}{$scope}}).'</td>'.
-                                    &Apache::loncommon::end_data_table_row();
-                         $newrow = 1;
-                    }
-                }
-            }
-            $output .= &Apache::loncommon::end_data_table().'<br />';
-        }
-    }
-
-    if (defined($navmap)) {
-        my %anonsubms=&Apache::lonnet::dump('nohist_anonsurveys',$cdom,$cnum);
-        my $rev_anonsurv=$Apache::lonnet::needsrelease{'parameter:type:anonsurvey'};
-        my %randtrysubms=&Apache::lonnet::dump('nohist_randomizetry',$cdom,$cnum);
-        my $rev_randtry=$Apache::lonnet::needsrelease{'parameter:type:randomizetry'};
-        my $stdtype=&Apache::lonparmset::standard_parameter_types('type');
-        my $stdname=&Apache::lonparmset::standard_parameter_names('type');
-        my $valanon=&get_param_description($stdtype,'anonsurvey');
-        my $valrandtry=&get_param_description($stdtype,'randomizetry');
-
-        foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() },1,0)) {
-            my @parts = @{$res->parts()};
-            my $symb = $res->symb();
-            my $enclosing_map = &Apache::lonnet::declutter($res->enclosing_map_src());
-            foreach my $part (@parts) {
-                if (exists($anonsubms{$symb."\0".$part})) {
-                    my $rev = $rev_anonsurv;
-                    my $what="$stdname=$valanon";
-                    if (ref($bysubmission{$symb}{$rev}) eq 'ARRAY') {
-                        unless (grep(/^\Q$what\E/,@{$bysubmission{$symb}{$rev}})) {
-                            push(@{$bysubmission{$symb}{$rev}},$what);
-                        }
-                    } else {
-                        push(@{$bysubmission{$symb}{$rev}},$what);
-                    }
-                    $allmaps{$enclosing_map} = 1;
-                }
-                if (exists($randtrysubms{$symb."\0".$part})) {
-                    my $rev = $rev_randtry;
-                    my $what="$stdname=$valrandtry";
-                    if (ref($bysubmission{$symb}{$rev}) eq 'ARRAY') {
-                        unless (grep(/^\Q$what\E/,@{$bysubmission{$symb}{$rev}})) {
-                            push(@{$bysubmission{$symb}{$rev}},$what);
-                        }
-                    } else {
-                        push(@{$bysubmission{$symb}{$rev}},$what);
-                    }
-                    $allmaps{$enclosing_map} = 1;
-                }
-            }
-            my %responses = $res->responseTypes();
-            foreach my $key (keys(%responses)) {
-                if (exists($checkresponsetypes{$key})) {
-                    push(@{$byresponsetype{$symb}{$checkresponsetypes{$key}}},$key);
-                    $allmaps{$enclosing_map} = 1;
-                }
-            }
-        }
-        if (keys(%byresource) > 0) {
-            foreach my $symb (keys(%byresource)) {
-                my ($map,$resid,$resurl)=&Apache::lonnet::decode_symb($symb);
-                $allmaps{$map} = 1;
-            }
-        }
-        if (keys(%bymap) > 0) {
-            foreach my $map (keys(%bymap)) {
-                $allmaps{$map} = 1;
-            }
-        }
-        foreach my $map (keys(%allmaps)) {
-            my $mapres = $navmap->getResourceByUrl($map);
-            my $mapsymb = $mapres->symb();
-            $toshow{$mapsymb} = 1;
-            if (ref($mapres)) {
-                my $pcslist = $mapres->map_hierarchy();
-                if ($pcslist ne '') {
-                    foreach my $pc (split(/,/,$pcslist)) {
-                        my $res = $navmap->getByMapPc($pc);
-                        if (ref($res)) {
-                            my $symb = $res->symb();
-                            unless ($symb eq '______') {
-                                $toshow{$symb} = 1;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-    my $mapres_header = '<h4>'.
-                        &mt('Requirements for specific folders or resources').
-                        '</h4>';
-    if ((keys(%toshow) > 0) || (keys(%byresource) > 0) ||
-        (keys(%bysubmission) > 0) || (keys(%byresponsetype))) {
-        $output .= $mapres_header;
-    }
-    my $top_header = '<h3>'.&mt('LON-CAPA version dependencies').'</h3>';
-    my $title = 'Version Constraints';
-    my $start_page =
-        &Apache::loncommon::start_page($title,undef,{'only_body' => 1,});
-    $r->print($start_page.$top_header);
-    if ($output) {
-        $r->print($output);
-        if (defined($navmap)) {
-            &show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission,
-                                \%byresponsetype,\@scopeorder,\%lt);
-        }
-        $r->print('<br /><br />');
-    } else {
-        $r->print('<p class="LC_info">'.
-                  &mt('No version requirements from resource content or settings.').
-                  '</p>');
-    }
-    $r->print(&Apache::loncommon::end_page());
-    return;
-}
-
-sub show_contents_view {
-    my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype,
-        $scopeorder,$lt) = @_;
-    if ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) ||
-        (keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0)) {
-        my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");
-        my $whitespace = '<img src="'.$location.'/whitespace_21.gif" alt="" />';
-        my $icon =  '<img src="'.$location.'/navmap.folder.open.gif" alt="" />';
-        my $topmap = $env{'course.'.$cid.'.url'};
-        $r->print(&Apache::loncommon::start_data_table().
-                  &Apache::loncommon::start_data_table_header_row().
-                  '<th>'.&mt('Location').'</th><th>'.&mt('Release').'</th>'.
-                  '<th>'.&mt('Attribute/Setting').'</th>'.
-                  &Apache::loncommon::end_data_table_header_row().
-                  &Apache::loncommon::start_data_table_row().
-                  '<td>&nbsp;'.$icon.'&nbsp;'.&mt('Main Course Documents').'</td>');
-                  &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);
-        my $curRes;
-        my $depth = 0;
-        my %parent = ();
-        my $startcount = 5;
-        my $lastcontainer = $startcount;
-        while ($curRes = $it->next()) {
-            if ($curRes == $it->BEGIN_MAP()) {
-                $depth++;
-                $parent{$depth}= $lastcontainer;
-            }
-            if ($curRes == $it->END_MAP()) {
-                $depth--;
-                $lastcontainer = $parent{$depth};
-            }
-            my $indent;
-            for (my $i=0; $i<$depth; $i++) {
-                $indent.= $whitespace;
-            }
-            if (ref($curRes)) {
-                my $symb = $curRes->symb();
-                my $ressymb = $symb;
-                my $srcf = $curRes->src();
-                my $title = &Apache::lonnet::gettitle($srcf);
-                if (($curRes->is_sequence()) || ($curRes->is_page())) {
-                    next unless($toshow->{$symb});
-                    my ($parent,$ind,$url) = &Apache::lonnet::decode_symb($symb);
-                    $icon =  '<img src="'.$location.'/navmap.folder.open.gif" alt="" />';
-                    if ($curRes->is_page()) {
-                        $icon = '<img src="'.$location.'/navmap.page.open.gif" alt="" />';
-                    }
-                    my $rowspan = 1;
-                    if (ref($bymap->{$url}) eq 'HASH') {
-                        $rowspan = scalar(keys(%{$bymap->{$url}}));
-                    }
-                    $r->print(&Apache::loncommon::start_data_table_row().
-                              '<td rowspan="'.$rowspan.'">'.$indent.$icon.'&nbsp;'.$title.'</td>');
-                    &releases_by_map($r,$bymap,$url,$scopeorder);
-                    $r->print(&Apache::loncommon::end_data_table_row());
-                } else {
-                    my $rowspan;
-                    if (ref($byresource->{$symb}) eq 'HASH') {
-                        $rowspan += scalar(keys(%{$byresource->{$symb}}));
-                    }
-                    if (ref($bysubmission->{$symb}) eq 'HASH') {
-                        $rowspan += scalar(keys(%{$bysubmission->{$symb}}));
-                    }
-                    if (ref($byresponsetype->{$symb}) eq 'HASH') {
-                        $rowspan += scalar(keys(%{$byresponsetype->{$symb}}));
-                    }
-                    next if (!$rowspan);
-                    $icon = '<img class="LC_contentImage" src="'.$location.'/problem.gif" alt="'.
-                            &mt('Problem').'" />';
-                    $r->print(&Apache::loncommon::start_data_table_row().
-                              '<td rowspan="'.$rowspan.'">'.$indent.$icon.'&nbsp;'.$title.'</td>');
-                    my $newrow;
-                    if (ref($byresource->{$symb}) eq 'HASH') {
-                        foreach my $rev (sort(keys(%{$byresource->{$symb}}))) {
-                            if ($newrow) {
-                                $r->print(&Apache::loncommon::continue_data_table_row());
-                            }
-                            $r->print('<td valign="middle">'.$rev.'</td><td>');
-                            if (ref($byresource->{$symb}{$rev}) eq 'HASH') {
-                                $r->print('<table border="0">');
-                                foreach my $scope (@{$scopeorder}) {
-                                    if (ref($byresource->{$symb}{$rev}{$scope}) eq 'HASH') {
-                                        $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}).'</td>');
-                                        foreach my $which (sort(keys(%{$byresource->{$symb}{$rev}{$scope}}))) {
-                                            $r->print('<td>'.$which.'</td><td>'.
-                                                join('<br />',@{$byresource->{$symb}{$rev}{$scope}{$which}}).
-                                                      '</td>');
-                                        }
-                                        $r->print('</tr>');
-                                    } elsif (ref($byresource->{$symb}{$rev}{$scope}) eq 'ARRAY') {
-                                        $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}).'</td>'.
-                                                  '<td>&nbsp;</td><td>'.
-                                                  join('<br />',@{$byresource->{$symb}{$rev}{$scope}}).'</td></tr>');
-                                    }
-                                }
-                                $r->print('</table>');
-                            }
-                            $r->print('</td>');
-                            $r->print(&Apache::loncommon::end_data_table_row());
-                            $newrow = 1;
-                        }
-                    }
-                    if (ref($bysubmission->{$symb}) eq 'HASH') {
-                        foreach my $rev (sort(keys(%{$bysubmission->{$symb}}))) {
-                            if ($newrow) {
-                                $r->print(&Apache::loncommon::continue_data_table_row());
-                            }
-                            $r->print('<td>'.$rev.'</td><td>');
-                            if (ref($bysubmission->{$symb}{$rev}) eq 'ARRAY') {
-                                $r->print(&mt('Submissions to: ').' '.
-                                         join(', ',@{$bysubmission->{$symb}{$rev}}));
-                            }
-                            $r->print('</td>');
-                            $r->print(&Apache::loncommon::end_data_table_row());
-                            $newrow = 1;
-                        }
-                    }
-                    if (ref($byresponsetype->{$symb}) eq 'HASH') {
-                        foreach my $rev (sort(keys(%{$byresponsetype->{$symb}}))) {
-                            if ($newrow) {
-                                $r->print(&Apache::loncommon::continue_data_table_row());
-                            }
-                            $r->print('<td>'.$rev.'</td><td>');
-                            if (ref($byresponsetype->{$symb}{$rev}) eq 'ARRAY') {
-                                $r->print(&mt('Response Type(s): ').' '.
-                                         join('<br />',@{$byresponsetype->{$symb}{$rev}}));
-                            }
-                            $r->print('</td>');
-                        }
-                        $r->print(&Apache::loncommon::end_data_table_row());
-                    }
-                }
-            }
-        }
-        $r->print(&Apache::loncommon::end_data_table());
-    }
-}
-
-sub releases_by_map {
-    my ($r,$bymap,$url,$scopeorder,$lt) = @_;
-    return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY'));
-    if (ref($bymap->{$url}) eq 'HASH') {
-        foreach my $rev (sort(keys(%{$bymap->{$url}}))) {
-            $r->print('<td valign="middle">'.$rev.'</td><td>');
-            if (ref($bymap->{$url}{$rev}) eq 'HASH') {
-                $r->print('<table border="0">');
-                foreach my $scope (@{$scopeorder}) {
-                    if (ref($bymap->{$url}{$rev}{$scope}) eq 'HASH') {
-                        $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}).'</td>');
-                        foreach my $which (sort(keys(%{$bymap->{$url}{$rev}{$scope}}))) {
-                            $r->print('<td>'.$which.'</td><td>'.
-                                      join('<br />',@{$bymap->{$url}{$rev}{$scope}{$which}}).
-                                      '</td>');
-                        }
-                        $r->print('</tr>');
-                    } elsif (ref($bymap->{$url}{$rev}{$scope}) eq 'ARRAY') {
-                        $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}).
-                                  '</td><td>&nbsp;</td><td>'.
-                                  join('<br />',@{$bymap->{$url}{$rev}{$scope}}).'</td></tr>');
-                    }
-                }
-                $r->print('</table>');
-            }
-            $r->print('</td>');
-        }
-    } else {
-        $r->print('<td colspan="2">&nbsp;</td>');
-    }
-    return;
-}
-
-sub get_param_description {
-    my ($stdtype,$value) = @_;
-    my $name = $value;
-    my $paramstrings = &Apache::lonparmset::standard_string_options($stdtype);
-    unless (ref($paramstrings) eq 'ARRAY') {
-        return $name;
-    }
-    foreach my $possibilities (@{$paramstrings}) {
-        next unless (ref($possibilities) eq 'ARRAY');
-        my ($thing, $description) = @{ $possibilities };
-        if ($thing eq $value) {
-            $name = $description;
-            last;
-        }
-    }
-    return $name;
-}
-
 sub show_autocoowners {
     my (@currcoown) = @_;
     my $output = '<i>'.&mt('Co-ownership is set automatically when a Course Coordinator role is assigned to official course personnel (from institutional data).').'</i>';
@@ -2793,14 +2281,18 @@ sub print_feedback {
 
     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}."<br/>(Custom text)",$count, "advanced");
+        }
         if ($position eq 'top') {
             my $includeempty = 0;
             $datatable .= &user_table($cdom,$item,\@sections,
                                       $settings->{$item},\%lt);
         } else {
             $datatable .= &Apache::lonhtmlcommon::textbox($item.'.text',
-                              $settings->{$item.'.text'},$items{$item}{size});
+                              $settings->{$item.'.text'},$items{$item}{size});  
         }
         $datatable .= &item_table_row_end();
     }
@@ -3064,7 +2556,7 @@ sub role_checkboxes {
                 $output .= '<tr>';
             }
         }
-        $output .= '<td align="left"><span class="LC_nobreak"><label><input type="checkbox" name="'.
+        $output .= '<td align="left"><span class="LC_nobreak"><label><input type="checkbox" name='.
                    $item.'" value="'.$role.'"'.$checked.'/>&nbsp;'.
                    $plrole.'</label></span></td>';
         if ($showsections) {
@@ -3096,7 +2588,7 @@ sub role_checkboxes {
                     $output .= '<tr>';
                 }
             }
-            $output .= '<td><span class="LC_nobreak"><label><input type="checkbox" name="'.
+            $output .= '<td><span class="LC_nobreak"><label><input type="checkbox" name='.
                        $item.'" value="'.$value.'"'.$checked.' />&nbsp;'.$rolename.
                        '</label></span></td>';
             if ($showsections) {