[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm

amueller amueller@source.lon-capa.org
Fri, 23 Oct 2009 18:16:24 -0000


This is a MIME encoded message

--amueller1256321784
Content-Type: text/plain

amueller		Fri Oct 23 18:16:24 2009 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  -lonparmset: Codestyling: substitute \t with four whitespaces.
  
  
--amueller1256321784
Content-Type: text/plain
Content-Disposition: attachment; filename="amueller-20091023181624.txt"

Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.472 loncom/interface/lonparmset.pm:1.473
--- loncom/interface/lonparmset.pm:1.472	Tue Oct 20 10:19:26 2009
+++ loncom/interface/lonparmset.pm	Fri Oct 23 18:16:24 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.472 2009/10/20 10:19:26 amueller Exp $
+# $Id: lonparmset.pm,v 1.473 2009/10/23 18:16:24 amueller Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -347,7 +347,7 @@
 
     my $useropt;
     if ($uname ne '' && $udom ne '') {
-	$useropt = &Apache::lonnet::get_userresdata($uname,$udom);
+    $useropt = &Apache::lonnet::get_userresdata($uname,$udom);
     }
 
     my $result='';
@@ -375,13 +375,13 @@
 # --------------------------------------------------------- first, check course
 
     if (defined($$courseopt{$courselevel})) {
-	$outpar[14]=$$courseopt{$courselevel};
-	$result=14;
+    $outpar[14]=$$courseopt{$courselevel};
+    $result=14;
     }
 
     if (defined($$courseopt{$courselevelm})) {
-	$outpar[13]=$$courseopt{$courselevelm};
-	$result=13;
+    $outpar[13]=$$courseopt{$courselevelm};
+    $result=13;
     }
 
 # ------------------------------------------------------- second, check default
@@ -394,25 +394,25 @@
     if (defined($thisparm)) { $outpar[11]=$thisparm; $result=11; }
 
     if (defined($$courseopt{$courselevelr})) {
-	$outpar[10]=$$courseopt{$courselevelr};
-	$result=10;
+    $outpar[10]=$$courseopt{$courselevelr};
+    $result=10;
     }
 
 # ------------------------------------------------------ fourth, back to course
     if ($csec ne '') {
         if (defined($$courseopt{$seclevel})) {
-	    $outpar[9]=$$courseopt{$seclevel};
-	    $result=9;
-	}
+        $outpar[9]=$$courseopt{$seclevel};
+        $result=9;
+    }
         if (defined($$courseopt{$seclevelm})) {
-	    $outpar[8]=$$courseopt{$seclevelm};
-	    $result=8;
-	}
+        $outpar[8]=$$courseopt{$seclevelm};
+        $result=8;
+    }
 
         if (defined($$courseopt{$seclevelr})) {
-	    $outpar[7]=$$courseopt{$seclevelr};
-	    $result=7;
-	}
+        $outpar[7]=$$courseopt{$seclevelr};
+        $result=7;
+    }
     }
 # ------------------------------------------------------ fifth, check course group
     if ($cgroup ne '') {
@@ -433,20 +433,20 @@
 # ---------------------------------------------------------- fifth, check user
 
     if ($uname ne '') {
-	if (defined($$useropt{$courselevel})) {
-	    $outpar[3]=$$useropt{$courselevel};
-	    $result=3;
-	}
-
-	if (defined($$useropt{$courselevelm})) {
-	    $outpar[2]=$$useropt{$courselevelm};
-	    $result=2;
-	}
-
-	if (defined($$useropt{$courselevelr})) {
-	    $outpar[1]=$$useropt{$courselevelr};
-	    $result=1;
-	}
+    if (defined($$useropt{$courselevel})) {
+        $outpar[3]=$$useropt{$courselevel};
+        $result=3;
+    }
+
+    if (defined($$useropt{$courselevelm})) {
+        $outpar[2]=$$useropt{$courselevelm};
+        $result=2;
+    }
+
+    if (defined($$useropt{$courselevelr})) {
+        $outpar[1]=$$useropt{$courselevelr};
+        $result=1;
+    }
     }
     return ($result,@outpar);
 }
@@ -466,25 +466,25 @@
     my $parmhashid;
     my %parmhash;
     sub resetparmhash {
-	undef($parmhashid);
-	undef(%parmhash);
+    undef($parmhashid);
+    undef(%parmhash);
     }
 
     sub cacheparmhash {
-	if ($parmhashid eq  $env{'request.course.fn'}) { return; }
-	my %parmhashfile;
-	if (tie(%parmhashfile,'GDBM_File',
-		$env{'request.course.fn'}.'_parms.db',&GDBM_READER(),0640)) {
-	    %parmhash=%parmhashfile;
-	    untie(%parmhashfile);
-	    $parmhashid=$env{'request.course.fn'};
-	}
+    if ($parmhashid eq  $env{'request.course.fn'}) { return; }
+    my %parmhashfile;
+    if (tie(%parmhashfile,'GDBM_File',
+        $env{'request.course.fn'}.'_parms.db',&GDBM_READER(),0640)) {
+        %parmhash=%parmhashfile;
+        untie(%parmhashfile);
+        $parmhashid=$env{'request.course.fn'};
+    }
     }
 
     sub parmhash {
-	my ($id) = @_;
-	&cacheparmhash();
-	return $parmhash{$id};
+    my ($id) = @_;
+    &cacheparmhash();
+    return $parmhash{$id};
     }
  }
 
@@ -492,27 +492,27 @@
     my $symbsid;
     my %symbs;
     sub resetsymbcache {
-	undef($symbsid);
-	undef(%symbs);
+    undef($symbsid);
+    undef(%symbs);
     }
 
     sub symbcache {
-	my $id=shift;
-	if ($symbsid ne $env{'request.course.id'}) {
-	    undef(%symbs);
-	}
-	if (!$symbs{$id}) {
-	    my $navmap = Apache::lonnavmaps::navmap->new();
-	    if ($id=~/\./) {
-		my $resource=$navmap->getById($id);
-		$symbs{$id}=$resource->symb();
-	    } else {
-		my $resource=$navmap->getByMapPc($id);
-		$symbs{$id}=&Apache::lonnet::declutter($resource->src());
-	    }
-	    $symbsid=$env{'request.course.id'};
-	}
-	return $symbs{$id};
+    my $id=shift;
+    if ($symbsid ne $env{'request.course.id'}) {
+        undef(%symbs);
+    }
+    if (!$symbs{$id}) {
+        my $navmap = Apache::lonnavmaps::navmap->new();
+        if ($id=~/\./) {
+        my $resource=$navmap->getById($id);
+        $symbs{$id}=$resource->symb();
+        } else {
+        my $resource=$navmap->getByMapPc($id);
+        $symbs{$id}=&Apache::lonnet::declutter($resource->src());
+        }
+        $symbsid=$env{'request.course.id'};
+    }
+    return $symbs{$id};
     }
  }
 
@@ -520,20 +520,20 @@
     my $rulesid;
     my %rules;
     sub resetrulescache {
-	undef($rulesid);
-	undef(%rules);
+    undef($rulesid);
+    undef(%rules);
     }
 
     sub rulescache {
-	my $id=shift;
-	if ($rulesid ne $env{'request.course.id'}
-	    && !defined($rules{$id})) {
-	    my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
-	    my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
-	    %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs);
-	    $rulesid=$env{'request.course.id'};
-	}
-	return $rules{$id};
+    my $id=shift;
+    if ($rulesid ne $env{'request.course.id'}
+        && !defined($rules{$id})) {
+        my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+        my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+        %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs);
+        $rulesid=$env{'request.course.id'};
+    }
+    return $rules{$id};
     }
 }
 
@@ -543,13 +543,13 @@
     my $type=shift;
     if (&rulescache($type.'_action') eq 'default') {
 # yes, there is something
-	return (&rulescache($type.'_hours'),
-		&rulescache($type.'_min'),
-		&rulescache($type.'_sec'),
-		&rulescache($type.'_value'));
+    return (&rulescache($type.'_hours'),
+        &rulescache($type.'_min'),
+        &rulescache($type.'_sec'),
+        &rulescache($type.'_value'));
     } else {
 # nothing there or something else
-	return ('','','','','');
+    return ('','','','','');
     }
 }
 
@@ -614,12 +614,12 @@
     my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$recflag,$cgroup)=@_;
     unless ($recflag) {
 # first time call
-	%recstack=();
-	$recflag=1;
+    %recstack=();
+    $recflag=1;
     }
 # store parameter
     &storeparm_by_symb_inner
-	($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup);
+    ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup);
 # don't do anything if parameter was reset
     unless ($nval) { return; }
     my ($prefix,$parm)=($spnam=~/^(.*[\_\.])([^\_\.]+)$/);
@@ -629,33 +629,33 @@
     foreach my $triggered (split(/\:/,&rulescache($parm.'_triggers'))) {
 # don't backfire
        unless ((!$triggered) || ($recstack{$triggered})) {
-	   my $action=&rulescache($triggered.'_action');
-	   my ($whichaction,$whichparm)=($action=~/^(.*\_)([^\_]+)$/);
+       my $action=&rulescache($triggered.'_action');
+       my ($whichaction,$whichparm)=($action=~/^(.*\_)([^\_]+)$/);
 # set triggered parameter on same level
-	   my $newspnam=$prefix.$triggered;
-	   my $newvalue='';
-	   my $active=1;
-	   if ($action=~/^when\_setting/) {
+       my $newspnam=$prefix.$triggered;
+       my $newvalue='';
+       my $active=1;
+       if ($action=~/^when\_setting/) {
 # are there restrictions?
-	       if (&rulescache($triggered.'_triggervalue')=~/\w/) {
-		   $active=0;
-		   foreach my $possiblevalue (split(/\s*\,\s*/,&rulescache($triggered.'_triggervalue'))) {
-		       if (lc($possiblevalue) eq lc($nval)) { $active=1; }
-		   }
-	       }
-	       $newvalue=&rulescache($triggered.'_value');
-	   } else {
-	       my $totalsecs=((&rulescache($triggered.'_days')*24+&rulescache($triggered.'_hours'))*60+&rulescache($triggered.'_min'))*60+&rulescache($triggered.'_sec');
-	       if ($action=~/^later\_than/) {
-		   $newvalue=$nval+$totalsecs;
-	       } else {
-		   $newvalue=$nval-$totalsecs;
-	       }
-	   }
-	   if ($active) {
-	       &storeparm_by_symb($symb,$newspnam,$snum,$newvalue,&rulescache($triggered.'_type'),
-				   $uname,$udom,$csec,$recflag,$cgroup);
-	   }
+           if (&rulescache($triggered.'_triggervalue')=~/\w/) {
+           $active=0;
+           foreach my $possiblevalue (split(/\s*\,\s*/,&rulescache($triggered.'_triggervalue'))) {
+               if (lc($possiblevalue) eq lc($nval)) { $active=1; }
+           }
+           }
+           $newvalue=&rulescache($triggered.'_value');
+       } else {
+           my $totalsecs=((&rulescache($triggered.'_days')*24+&rulescache($triggered.'_hours'))*60+&rulescache($triggered.'_min'))*60+&rulescache($triggered.'_sec');
+           if ($action=~/^later\_than/) {
+           $newvalue=$nval+$totalsecs;
+           } else {
+           $newvalue=$nval-$totalsecs;
+           }
+       }
+       if ($active) {
+           &storeparm_by_symb($symb,$newspnam,$snum,$newvalue,&rulescache($triggered.'_type'),
+                   $uname,$udom,$csec,$recflag,$cgroup);
+       }
        }
     }
     return '';
@@ -703,62 +703,62 @@
     my $delete;
     if ($nval eq '') { $delete=1;}
     my %storecontent = ($storeunder         => $nval,
-			$storeunder.'.type' => $ntype);
+            $storeunder.'.type' => $ntype);
     my $reply='';
     if ($snum>3) {
 # ---------------------------------------------------------------- Store Course
 #
-	my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
-	my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+    my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+    my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
 # Expire sheets
-	&Apache::lonnet::expirespread('','','studentcalc');
-	if (($snum==10) || ($snum==7) || ($snum==4)) {
-	    &Apache::lonnet::expirespread('','','assesscalc',$symb);
-	} elsif (($snum==11) || ($snum==8) || ($snum==5)) {
-	    &Apache::lonnet::expirespread('','','assesscalc',$map);
-	} else {
-	    &Apache::lonnet::expirespread('','','assesscalc');
-	}
+    &Apache::lonnet::expirespread('','','studentcalc');
+    if (($snum==10) || ($snum==7) || ($snum==4)) {
+        &Apache::lonnet::expirespread('','','assesscalc',$symb);
+    } elsif (($snum==11) || ($snum==8) || ($snum==5)) {
+        &Apache::lonnet::expirespread('','','assesscalc',$map);
+    } else {
+        &Apache::lonnet::expirespread('','','assesscalc');
+    }
 # Store parameter
-	if ($delete) {
-	    $reply=&Apache::lonnet::del
-		('resourcedata',[keys(%storecontent)],$cdom,$cnum);
+    if ($delete) {
+        $reply=&Apache::lonnet::del
+        ('resourcedata',[keys(%storecontent)],$cdom,$cnum);
             &log_parmset(\%storecontent,1);
-	} else {
-	    $reply=&Apache::lonnet::cput
-		('resourcedata',\%storecontent,$cdom,$cnum);
-	    &log_parmset(\%storecontent);
-	}
-	&Apache::lonnet::devalidatecourseresdata($cnum,$cdom);
+    } else {
+        $reply=&Apache::lonnet::cput
+        ('resourcedata',\%storecontent,$cdom,$cnum);
+        &log_parmset(\%storecontent);
+    }
+    &Apache::lonnet::devalidatecourseresdata($cnum,$cdom);
     } else {
 # ------------------------------------------------------------------ Store User
 #
 # Expire sheets
-	&Apache::lonnet::expirespread($uname,$udom,'studentcalc');
-	if ($snum==1) {
-	    &Apache::lonnet::expirespread
-		($uname,$udom,'assesscalc',$symb);
-	} elsif ($snum==2) {
-	    &Apache::lonnet::expirespread
-		($uname,$udom,'assesscalc',$map);
-	} else {
-	    &Apache::lonnet::expirespread($uname,$udom,'assesscalc');
-	}
+    &Apache::lonnet::expirespread($uname,$udom,'studentcalc');
+    if ($snum==1) {
+        &Apache::lonnet::expirespread
+        ($uname,$udom,'assesscalc',$symb);
+    } elsif ($snum==2) {
+        &Apache::lonnet::expirespread
+        ($uname,$udom,'assesscalc',$map);
+    } else {
+        &Apache::lonnet::expirespread($uname,$udom,'assesscalc');
+    }
 # Store parameter
-	if ($delete) {
-	    $reply=&Apache::lonnet::del
-		('resourcedata',[keys(%storecontent)],$udom,$uname);
-	    &log_parmset(\%storecontent,1,$uname,$udom);
-	} else {
-	    $reply=&Apache::lonnet::cput
-		('resourcedata',\%storecontent,$udom,$uname);
-	    &log_parmset(\%storecontent,0,$uname,$udom);
-	}
-	&Apache::lonnet::devalidateuserresdata($uname,$udom);
+    if ($delete) {
+        $reply=&Apache::lonnet::del
+        ('resourcedata',[keys(%storecontent)],$udom,$uname);
+        &log_parmset(\%storecontent,1,$uname,$udom);
+    } else {
+        $reply=&Apache::lonnet::cput
+        ('resourcedata',\%storecontent,$udom,$uname);
+        &log_parmset(\%storecontent,0,$uname,$udom);
+    }
+    &Apache::lonnet::devalidateuserresdata($uname,$udom);
     }
 
     if ($reply=~/^error\:(.*)/) {
-	return "<span class=\"LC_error\">Write Error: $1</span>";
+    return "<span class=\"LC_error\">Write Error: $1</span>";
     }
     return '';
 }
@@ -769,11 +769,11 @@
     my $result = '';
     # Values of zero are valid.
     if (! $value && $value ne '0') {
-	if ($editable) {
-	    $result = '<span class="LC_clickhere">*</span>';
-	} else {
-	    $result='&nbsp;';
-	}
+    if ($editable) {
+        $result = '<span class="LC_clickhere">*</span>';
+    } else {
+        $result='&nbsp;';
+    }
     } else {
         if ($type eq 'date_interval') {
             my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value);
@@ -811,10 +811,10 @@
             $result.=join(", ",@timer);
         } elsif (&isdateparm($type)) {
             $result = &Apache::lonlocal::locallocaltime($value).
-		&date_sanity_info($value);
+        &date_sanity_info($value);
         } else {
             $result = $value;
-	    $result = &HTML::Entities::encode($result,'"<>&');
+        $result = &HTML::Entities::encode($result,'"<>&');
         }
     }
     return $result;
@@ -825,7 +825,7 @@
     my ($type,$dis,$value,$marker,$return,$call)=@_;
     my $winvalue=$value;
     unless ($winvalue) {
-	if (&isdateparm($type)) {
+    if (&isdateparm($type)) {
             $winvalue=$env{'form.recent_'.$type};
         } else {
             $winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]};
@@ -837,14 +837,14 @@
     my $valout = &valout($value,$type,1);
     my $unencmarker = $marker;
     foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call,
-		      \$hour, \$min, \$sec) {
-	$$item = &HTML::Entities::encode($$item,'"<>&');
-	$$item =~ s/\'/\\\'/g;
+              \$hour, \$min, \$sec) {
+    $$item = &HTML::Entities::encode($$item,'"<>&');
+    $$item =~ s/\'/\\\'/g;
     }
     return '<table width="100%"><tr valign="top" align="right"><td><a name="'.$unencmarker.'" /></td></tr><tr><td align="center">'.
-	'<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','"
-	    .$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'.
-	    $valout.'</a></td></tr></table>';
+    '<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','"
+        .$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'.
+        $valout.'</a></td></tr></table>';
 }
 
 sub page_js {
@@ -873,12 +873,12 @@
             if (typedef[0]=='date') {
                 eval('document.parmform.recent_'+
                      document.parmform.pres_type.value+
-		     '.value=document.parmform.pres_value.value;');
+             '.value=document.parmform.pres_value.value;');
             } else {
                 eval('document.parmform.recent_'+typedef[0]+
-		     '.value=document.parmform.pres_value.value;');
+             '.value=document.parmform.pres_value.value;');
             }
-	   }
+       }
             document.parmform.submit();
         } else {
             document.parmform.pres_value.value='';
@@ -903,23 +903,23 @@
     my ($r) = @_;
 
     my %loaditems = ('onunload' => "pclose()",
-		     'onload'   => "group_or_section('cgroup')",);
+             'onload'   => "group_or_section('cgroup')",);
 
     if ((($env{'form.command'} eq 'set') && ($env{'form.url'})
-	     && (!$env{'form.dis'})) || ($env{'form.symb'})) {
-	&Apache::lonhtmlcommon::add_breadcrumb({help=>'Problem_Parameters',
-	    text=>"Problem Parameters"});
+         && (!$env{'form.dis'})) || ($env{'form.symb'})) {
+    &Apache::lonhtmlcommon::add_breadcrumb({help=>'Problem_Parameters',
+        text=>"Problem Parameters"});
     } else {
-	&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable',
-	   text=>"Table Mode",
-	   help => 'Course_Setting_Parameters'});
+    &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable',
+       text=>"Table Mode",
+       help => 'Course_Setting_Parameters'});
     }
     my $start_page =
-	&Apache::loncommon::start_page('Set/Modify Course Parameters',
-				       &page_js(),
-				       {'add_entries' => \%loaditems,});
+    &Apache::loncommon::start_page('Set/Modify Course Parameters',
+                       &page_js(),
+                       {'add_entries' => \%loaditems,});
     my $breadcrumbs =
-	&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode');
+    &Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode');
     $r->print(<<ENDHEAD);
 $start_page
 $breadcrumbs
@@ -934,25 +934,25 @@
 
 sub print_row {
     my ($r,$which,$part,$name,$symbp,$rid,$default,$defaulttype,$display,$defbgone,
-	$defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups)=@_;
+    $defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups)=@_;
     my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
     my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom);
 # get the values for the parameter in cascading order
 # empty levels will remain empty
     my ($result,@outpar)=&parmval($$part{$which}.'.'.$$name{$which},
-	  $rid,$$default{$which},$uname,$udom,$csec,$cgroup,$courseopt);
+      $rid,$$default{$which},$uname,$udom,$csec,$cgroup,$courseopt);
 # get the type for the parameters
 # problem: these may not be set for all levels
     my ($typeresult,@typeoutpar)=&parmval($$part{$which}.'.'.
                                           $$name{$which}.'.type',$rid,
-		 $$defaulttype{$which},$uname,$udom,$csec,$cgroup,$courseopt);
+         $$defaulttype{$which},$uname,$udom,$csec,$cgroup,$courseopt);
 # cascade down manually
     my $cascadetype=$$defaulttype{$which};
     for (my $i=14;$i>0;$i--) {
-	 if ($typeoutpar[$i]) {
+     if ($typeoutpar[$i]) {
             $cascadetype=$typeoutpar[$i];
-	} else {
+    } else {
             $typeoutpar[$i]=$cascadetype;
         }
     }
@@ -966,7 +966,7 @@
     }
     my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers');
     if ($automatic) {
-	$parm.='<span class="LC_warning"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</span>';
+    $parm.='<span class="LC_warning"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</span>';
     }
     $r->print('<td>'.$parm.'</td>');
 
@@ -1018,16 +1018,16 @@
 
         &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
 
-	&print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
-	&print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
-	&print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
-	&print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
-
-	if ($csec) {
-	    &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
-	    &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
-	    &print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
-	}
+    &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+    &print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+    &print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+    &print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+
+    if ($csec) {
+        &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+        &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+        &print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+    }
 
         if ($cgroup) {
             &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
@@ -1035,14 +1035,14 @@
             &print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
         }
 
-	if ($uname) {
+    if ($uname) {
             if ($othergrp) {
                 $r->print($othergrp);
             }
-	    &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
-	    &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
-	    &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
-	}
+        &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+        &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+        &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+    }
 
     } # end of $parmlev if/else
     $r->print('<td style="background-color:#CCCCFF;" align="center">'.$effective_parm.'</td>');
@@ -1159,81 +1159,81 @@
     my $navmap = Apache::lonnavmaps::navmap->new();
     my @allres=$navmap->retrieveResources(undef,undef,1,undef,1);
     foreach my $resource (@allres) {
-	my $id=$resource->id();
+    my $id=$resource->id();
         my ($mapid,$resid)=split(/\./,$id);
-	if ($mapid eq '0') { next; }
-	$$ids[$#$ids+1]=$id;
-	my $srcf=$resource->src();
-	$srcf=~/\.(\w+)$/;
-	$$typep{$id}=$1;
-	$$keyp{$id}='';
+    if ($mapid eq '0') { next; }
+    $$ids[$#$ids+1]=$id;
+    my $srcf=$resource->src();
+    $srcf=~/\.(\w+)$/;
+    $$typep{$id}=$1;
+    $$keyp{$id}='';
         $$uris{$id}=$srcf;
-	foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) {
-	    next if ($key!~/^parameter_/);
+    foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) {
+        next if ($key!~/^parameter_/);
 
 # Hidden parameters
-	    next if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm');
+        next if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm');
 #
 # allparms is a hash of parameter names
 #
-	    my $name=&Apache::lonnet::metadata($srcf,$key.'.name');
-	    if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {
-		my ($display,$parmdis);
-		$display = &standard_parameter_names($name);
-		if ($display eq '') {
-		    $display= &Apache::lonnet::metadata($srcf,$key.'.display');
-		    $parmdis = $display;
-		    $parmdis =~ s/\s*\[Part.*$//g;
-		} else {
-		    $parmdis = &mt($display);
-		}
-		$$allparms{$name}=$parmdis;
-		if (ref($defkeytype)) {
-		    $$defkeytype{$name}=
-			&Apache::lonnet::metadata($srcf,$key.'.type');
-		}
-	    }
+        my $name=&Apache::lonnet::metadata($srcf,$key.'.name');
+        if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {
+        my ($display,$parmdis);
+        $display = &standard_parameter_names($name);
+        if ($display eq '') {
+            $display= &Apache::lonnet::metadata($srcf,$key.'.display');
+            $parmdis = $display;
+            $parmdis =~ s/\s*\[Part.*$//g;
+        } else {
+            $parmdis = &mt($display);
+        }
+        $$allparms{$name}=$parmdis;
+        if (ref($defkeytype)) {
+            $$defkeytype{$name}=
+            &Apache::lonnet::metadata($srcf,$key.'.type');
+        }
+        }
 
 #
 # allparts is a hash of all parts
 #
-	    my $part= &Apache::lonnet::metadata($srcf,$key.'.part');
-	    $$allparts{$part} = &mt('Part: [_1]',$part);
+        my $part= &Apache::lonnet::metadata($srcf,$key.'.part');
+        $$allparts{$part} = &mt('Part: [_1]',$part);
 #
 # Remember all keys going with this resource
 #
-	    if ($$keyp{$id}) {
-		$$keyp{$id}.=','.$key;
-	    } else {
-		$$keyp{$id}=$key;
-	    }
+        if ($$keyp{$id}) {
+        $$keyp{$id}.=','.$key;
+        } else {
+        $$keyp{$id}=$key;
+        }
 #
 # Put in order
 #
-	    unless ($$keyorder{$key}) {
-		$$keyorder{$key}=$keyordercnt;
-		$keyordercnt++;
-	    }
-	}
-
-
-	if (!exists($$mapp{$mapid})) {
-	    $$mapp{$id}=
-		&Apache::lonnet::declutter($resource->enclosing_map_src());
-	    $$mapp{$mapid}=$$mapp{$id};
-	    $$allmaps{$mapid}=$$mapp{$id};
-	    if ($mapid eq '1') {
-		$$maptitles{$mapid}=&mt('Main Course Documents');
-	    } else {
-		$$maptitles{$mapid}=
-		    &Apache::lonnet::gettitle($$mapp{$id});
-	    }
-	    $$maptitles{$$mapp{$id}}=$$maptitles{$mapid};
-	    $$symbp{$mapid}=$$mapp{$id}.'___(all)';
-	} else {
-	    $$mapp{$id} = $$mapp{$mapid};
-	}
-	$$symbp{$id}=&Apache::lonnet::encode_symb($$mapp{$id},$resid,$srcf);
+        unless ($$keyorder{$key}) {
+        $$keyorder{$key}=$keyordercnt;
+        $keyordercnt++;
+        }
+    }
+
+
+    if (!exists($$mapp{$mapid})) {
+        $$mapp{$id}=
+        &Apache::lonnet::declutter($resource->enclosing_map_src());
+        $$mapp{$mapid}=$$mapp{$id};
+        $$allmaps{$mapid}=$$mapp{$id};
+        if ($mapid eq '1') {
+        $$maptitles{$mapid}=&mt('Main Course Documents');
+        } else {
+        $$maptitles{$mapid}=
+            &Apache::lonnet::gettitle($$mapp{$id});
+        }
+        $$maptitles{$$mapp{$id}}=$$maptitles{$mapid};
+        $$symbp{$mapid}=$$mapp{$id}.'___(all)';
+    } else {
+        $$mapp{$id} = $$mapp{$mapid};
+    }
+    $$symbp{$id}=&Apache::lonnet::encode_symb($$mapp{$id},$resid,$srcf);
     }
 }
 
@@ -1263,7 +1263,7 @@
             displayOverview = "none"
         }
 
-	for (i=0; i<document.forms.parmform.elements.length; i++) {
+    for (i=0; i<document.forms.parmform.elements.length; i++) {
             ele = document.forms.parmform.elements[i];
             if (ele.name == checkName) {
                 document.forms.parmform.elements[i].checked=value;
@@ -1276,51 +1276,51 @@
 
         document.getElementById(thisvalue.concat("_li")).style.display = "";        
 
-	for (i=0; i<document.forms.parmform.elements.length; i++) {
+    for (i=0; i<document.forms.parmform.elements.length; i++) {
             ele = document.forms.parmform.elements[i];
             if (ele.name == checkName) {
-		if (ele.value == thisvalue) {
-		    document.forms.parmform.elements[i].checked=true;
-		}
+        if (ele.value == thisvalue) {
+            document.forms.parmform.elements[i].checked=true;
+        }
             }
         }
     }
 
     function checkdates() {
-	checkthis('duedate','pscat');
- 	checkthis('opendate','pscat');
-	checkthis('answerdate','pscat');
+    checkthis('duedate','pscat');
+     checkthis('opendate','pscat');
+    checkthis('answerdate','pscat');
     }
 
     function checkdisset() {
-	checkthis('discussend','pscat');
- 	checkthis('discusshide','pscat');
+    checkthis('discussend','pscat');
+     checkthis('discusshide','pscat');
     }
 
     function checkcontdates() {
-	checkthis('contentopen','pscat');
- 	checkthis('contentclose','pscat');
+    checkthis('contentopen','pscat');
+     checkthis('contentclose','pscat');
     }
 
     function checkvisi() {
-	checkthis('hiddenresource','pscat');
- 	checkthis('encrypturl','pscat');
-	checkthis('problemstatus','pscat');
-	checkthis('contentopen','pscat');
-	checkthis('opendate','pscat');
+    checkthis('hiddenresource','pscat');
+     checkthis('encrypturl','pscat');
+    checkthis('problemstatus','pscat');
+    checkthis('contentopen','pscat');
+    checkthis('opendate','pscat');
     }
 
     function checkparts() {
-	checkthis('hiddenparts','pscat');
-	checkthis('display','pscat');
-	checkthis('ordered','pscat');
+    checkthis('hiddenparts','pscat');
+    checkthis('display','pscat');
+    checkthis('ordered','pscat');
     }
 
     function checkstandard() {
         checkall(false,'pscat');
-	checkdates();
-	checkthis('weight','pscat');
-	checkthis('maxtries','pscat');
+    checkdates();
+    checkthis('weight','pscat');
+    checkthis('maxtries','pscat');
     }
 
     function hideParms() {
@@ -1456,7 +1456,7 @@
 sub keysindisplayorderCategory {
     my ($name,$keyorder)=@_;
     return sort {
-    	$$keyorder{'parameter_0_'.$a} <=> $$keyorder{'parameter_0_'.$b}; 
+        $$keyorder{'parameter_0_'.$a} <=> $$keyorder{'parameter_0_'.$b}; 
     } ( @{$name});
 }
 
@@ -1514,11 +1514,11 @@
             foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) {
                     $r->print('<span class="LC_nobreak">'
                              .'<label><input type="checkbox" name="pscat" ');
-	            $r->print('value="'.$tempkey.'" ');
+                $r->print('value="'.$tempkey.'" ');
                 $r->print('onclick="checkboxChecked(\''.$tempkey.'\')"');
-	            if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {
-	                $r->print(' checked="checked"');
-	            }
+                if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {
+                    $r->print(' checked="checked"');
+                }
                 $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey}
                                                       : $tempkey)
                         .'</label></span> ');
@@ -1592,15 +1592,15 @@
     my %temphash=();
     foreach (@{$psprt}) { $temphash{$_}=1; }
     foreach my $tempkey (sort {
-	if ($a==$b) { return ($a cmp $b) } else { return ($a <=> $b); }
+    if ($a==$b) { return ($a cmp $b) } else { return ($a <=> $b); }
     } keys(%{$allparts})) {
-	unless ($tempkey =~ /\./) {
-	    $r->print('<option value="'.$tempkey.'"');
-	    if ($$psprt[0] eq "all" ||  $temphash{$tempkey}) {
-		$r->print(' selected="selected"');
-	    }
-	    $r->print('>'.$$allparts{$tempkey}.'</option>');
-	}
+    unless ($tempkey =~ /\./) {
+        $r->print('<option value="'.$tempkey.'"');
+        if ($$psprt[0] eq "all" ||  $temphash{$tempkey}) {
+        $r->print(' selected="selected"');
+        }
+        $r->print('>'.$$allparts{$tempkey}.'</option>');
+    }
     }
     $r->print('</select>');
 }
@@ -1626,9 +1626,9 @@
             $sections .= qq| onchange="group_or_section('csec')" |;
         }
         $sections .= '>';
-	foreach my $section ('',sort keys %sectionhash) {
-	    $sections.='<option value="'.$section.'" '.
-		($section eq $csec?'selected="selected"':'').'>'.$section.
+    foreach my $section ('',sort keys %sectionhash) {
+        $sections.='<option value="'.$section.'" '.
+        ($section eq $csec?'selected="selected"':'').'>'.$section.
                                                               '</option>';
         }
         $sections.='</select>';
@@ -1755,7 +1755,7 @@
                     my $resource_name = &Apache::lonnet::gettitle($srcf);
                     if(!exists($treeinfo->{$id})) {
                         push(@$tree,$id);
-                        my $enclosing_map_folder = &Apache::lonnet::declutter($curRes->enclosing_map_src());	    
+                        my $enclosing_map_folder = &Apache::lonnet::declutter($curRes->enclosing_map_src());        
                         $treeinfo->{$id} = {
                                     depth => $depth,
                                     type  => $type,
@@ -1767,7 +1767,7 @@
             }
         }
     }
-# Show it ...	
+# Show it ...    
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder')));
     if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) {
         my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />';
@@ -1841,11 +1841,11 @@
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameter Level').&Apache::loncommon::help_open_topic('Course_Parameter_Levels')));
     $r->print('<select name="parmlev">');
     foreach (reverse sort keys %{$alllevs}) {
-	$r->print('<option value="'.$$alllevs{$_}.'"');
-	if ($parmlev eq $$alllevs{$_}) {
-	    $r->print(' selected="selected"');
-	}
-	$r->print('>'.&mt($_).'</option>');
+    $r->print('<option value="'.$$alllevs{$_}.'"');
+    if ($parmlev eq $$alllevs{$_}) {
+        $r->print(' selected="selected"');
+    }
+    $r->print('>'.&mt($_).'</option>');
     }
     $r->print("</select>");
 }
@@ -1858,14 +1858,14 @@
 
     $r->print('<select name="Section" multiple="multiple" size="8">');
     foreach my $s ('all',sort keys %sectionhash) {
-	$r->print('    <option value="'.$s.'"');
-	foreach (@{$selectedsections}) {
-	    if ($s eq $_) {
-		$r->print(' selected="selected"');
-		last;
-	    }
-	}
-	$r->print('>'.$s."</option>\n");
+    $r->print('    <option value="'.$s.'"');
+    foreach (@{$selectedsections}) {
+        if ($s eq $_) {
+        $r->print(' selected="selected"');
+        last;
+        }
+    }
+    $r->print('>'.$s."</option>\n");
     }
     $r->print("</select>\n");
 }
@@ -1877,14 +1877,14 @@
 
     $r->print('<select name="Group" multiple="multiple" size="8">');
     foreach my $group (sort(keys(%grouphash))) {
-	$r->print('    <option value="'.$group.'"');
-	foreach (@{$selectedgroups}) {
-	    if ($group eq $_) {
-		$r->print(' selected="selected"');
-		last;
-	    }
-	}
-	$r->print('>'.$group."</option>\n");
+    $r->print('    <option value="'.$group.'"');
+    foreach (@{$selectedgroups}) {
+        if ($group eq $_) {
+        $r->print(' selected="selected"');
+        last;
+        }
+    }
+    $r->print('>'.$group."</option>\n");
     }
     $r->print("</select>\n");
 }
@@ -1898,26 +1898,26 @@
 sub keysinorder {
     my ($name,$keyorder)=@_;
     return sort {
-	$$keyorder{$a} <=> $$keyorder{$b};
+    $$keyorder{$a} <=> $$keyorder{$b};
     } (keys %{$name});
 }
 
 sub keysinorder_bytype {
     my ($name,$keyorder)=@_;
     return sort {
-	my $ta=(split('_',$a))[-1];
-	my $tb=(split('_',$b))[-1];
-	if ($$keyorder{'parameter_0_'.$ta} == $$keyorder{'parameter_0_'.$tb}) {
-	    return ($a cmp $b);
-	}
-	$$keyorder{'parameter_0_'.$ta} <=> $$keyorder{'parameter_0_'.$tb};
+    my $ta=(split('_',$a))[-1];
+    my $tb=(split('_',$b))[-1];
+    if ($$keyorder{'parameter_0_'.$ta} == $$keyorder{'parameter_0_'.$tb}) {
+        return ($a cmp $b);
+    }
+    $$keyorder{'parameter_0_'.$ta} <=> $$keyorder{'parameter_0_'.$tb};
     } (keys %{$name});
 }
 
 sub keysindisplayorder {
     my ($name,$keyorder)=@_;
     return sort {
-	$$keyorder{'parameter_0_'.$a} <=> $$keyorder{'parameter_0_'.$b};
+    $$keyorder{'parameter_0_'.$a} <=> $$keyorder{'parameter_0_'.$b};
     } (keys %{$name});
 }
 
@@ -1933,28 +1933,28 @@
        $r->print(' checked="checked"');
     }
     $r->print(' />'.&mt('Sort by student (group/section) first, then realm').
-	      '</label>');
+          '</label>');
 }
 
 sub standardkeyorder {
     return ('parameter_0_opendate' => 1,
-	    'parameter_0_duedate' => 2,
-	    'parameter_0_answerdate' => 3,
-	    'parameter_0_interval' => 4,
-	    'parameter_0_weight' => 5,
-	    'parameter_0_maxtries' => 6,
-	    'parameter_0_hinttries' => 7,
-	    'parameter_0_contentopen' => 8,
-	    'parameter_0_contentclose' => 9,
-	    'parameter_0_type' => 10,
-	    'parameter_0_problemstatus' => 11,
-	    'parameter_0_hiddenresource' => 12,
-	    'parameter_0_hiddenparts' => 13,
-	    'parameter_0_display' => 14,
-	    'parameter_0_ordered' => 15,
-	    'parameter_0_tol' => 16,
-	    'parameter_0_sig' => 17,
-	    'parameter_0_turnoffunit' => 18,
+        'parameter_0_duedate' => 2,
+        'parameter_0_answerdate' => 3,
+        'parameter_0_interval' => 4,
+        'parameter_0_weight' => 5,
+        'parameter_0_maxtries' => 6,
+        'parameter_0_hinttries' => 7,
+        'parameter_0_contentopen' => 8,
+        'parameter_0_contentclose' => 9,
+        'parameter_0_type' => 10,
+        'parameter_0_problemstatus' => 11,
+        'parameter_0_hiddenresource' => 12,
+        'parameter_0_hiddenparts' => 13,
+        'parameter_0_display' => 14,
+        'parameter_0_ordered' => 15,
+        'parameter_0_tol' => 16,
+        'parameter_0_sig' => 17,
+        'parameter_0_turnoffunit' => 18,
             'parameter_0_discussend' => 19,
             'parameter_0_discusshide' => 20);
 }
@@ -2010,7 +2010,7 @@
     } elsif ($udom=$env{'request.role.domain'}) {
     } elsif ($udom=$env{'user.domain'}) {
     } else {
-		$udom=$r->dir_config('lonDefDomain');
+        $udom=$r->dir_config('lonDefDomain');
     }
     
 
@@ -2031,62 +2031,62 @@
 # ----------------------------------------------- Was this started from grades?
 
     if (($env{'form.command'} eq 'set') && ($env{'form.url'})
-	&& (!$env{'form.dis'})) {
-		my $url=$env{'form.url'};
-		$url=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
-		$pssymb=&Apache::lonnet::symbread($url);
-		if (!@pscat) { @pscat=('all'); }
-		$pschp='';
+    && (!$env{'form.dis'})) {
+        my $url=$env{'form.url'};
+        $url=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
+        $pssymb=&Apache::lonnet::symbread($url);
+        if (!@pscat) { @pscat=('all'); }
+        $pschp='';
         $parmlev = 'full';
     } elsif ($env{'form.symb'}) {
-		$pssymb=$env{'form.symb'};
-		if (!@pscat) { @pscat=('all'); }
-		$pschp='';
+        $pssymb=$env{'form.symb'};
+        if (!@pscat) { @pscat=('all'); }
+        $pschp='';
         $parmlev = 'full';
     } else {
-		$env{'form.url'}='';
+        $env{'form.url'}='';
     }
 
     my $id=$env{'form.id'};
     if (($id) && ($udom)) {
-		$uname=(&Apache::lonnet::idget($udom,$id))[1];
-		if ($uname) {
-	    	$id='';
-		} else {
-	    	$message=
-			'<span class="LC_error">'.&mt("Unknown ID")." '$id' ".
-			&mt('at domain')." '$udom'</span>";
-		}
+        $uname=(&Apache::lonnet::idget($udom,$id))[1];
+        if ($uname) {
+            $id='';
+        } else {
+            $message=
+            '<span class="LC_error">'.&mt("Unknown ID")." '$id' ".
+            &mt('at domain')." '$udom'</span>";
+        }
     } else {
-		$uname=$env{'form.uname'};
+        $uname=$env{'form.uname'};
     }
     unless ($udom) { $uname=''; }
     $uhome='';
     if ($uname) {
-		$uhome=&Apache::lonnet::homeserver($uname,$udom);
+        $uhome=&Apache::lonnet::homeserver($uname,$udom);
         if ($uhome eq 'no_host') {
-	    	$message=
-			'<span class="LC_error">'.&mt("Unknown user")." '$uname' ".
-			&mt("at domain")." '$udom'</span>";
-	    	$uname='';
+            $message=
+            '<span class="LC_error">'.&mt("Unknown user")." '$uname' ".
+            &mt("at domain")." '$udom'</span>";
+            $uname='';
         } else {
-	    	$csec=&Apache::lonnet::getsection($udom,$uname,
-					      $env{'request.course.id'});
-	    	if ($csec eq '-1') {
-				$message='<span class="LC_error">'.
-		    	&mt("User")." '$uname' ".&mt("at domain")." '$udom' ".
-		    	&mt("not in this course")."</span>";
-				$uname='';
-				$csec=$env{'form.csec'};
+            $csec=&Apache::lonnet::getsection($udom,$uname,
+                          $env{'request.course.id'});
+            if ($csec eq '-1') {
+                $message='<span class="LC_error">'.
+                &mt("User")." '$uname' ".&mt("at domain")." '$udom' ".
+                &mt("not in this course")."</span>";
+                $uname='';
+                $csec=$env{'form.csec'};
                 $cgroup=$env{'form.cgroup'};
-	    	} else {
-				my %name=&Apache::lonnet::userenvironment($udom,$uname,
-		      	('firstname','middlename','lastname','generation','id'));
-				$message="\n<p>\n".&mt("Full Name").": ".
-		    	$name{'firstname'}.' '.$name{'middlename'}.' '
-				.$name{'lastname'}.' '.$name{'generation'}.
-			    "<br />\n".&mt('ID').": ".$name{'id'}.'<p>';
-	    	}
+            } else {
+                my %name=&Apache::lonnet::userenvironment($udom,$uname,
+                  ('firstname','middlename','lastname','generation','id'));
+                $message="\n<p>\n".&mt("Full Name").": ".
+                $name{'firstname'}.' '.$name{'middlename'}.' '
+                .$name{'lastname'}.' '.$name{'generation'}.
+                "<br />\n".&mt('ID').": ".$name{'id'}.'<p>';
+            }
             @usersgroups = &Apache::lonnet::get_users_groups(
                                        $udom,$uname,$env{'request.course.id'});
             if (@usersgroups > 0) {
@@ -2102,8 +2102,8 @@
 
 # --------------------------------------------------------- Get all assessments
     &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps,
-				\%mapp, \%symbp,\%maptitles,\%uris,
-				\%keyorder);
+                \%mapp, \%symbp,\%maptitles,\%uris,
+                \%keyorder);
 
     $mapp{'0.0'} = '';
     $symbp{'0.0'} = '';
@@ -2113,7 +2113,7 @@
         my @markers=split(/\&\&\&/,$env{'form.pres_marker'});
         my @values=split(/\&\&\&/,$env{'form.pres_value'});
         my @types=split(/\&\&\&/,$env{'form.pres_type'});
-		for (my $i=0;$i<=$#markers;$i++) {
+        for (my $i=0;$i<=$#markers;$i++) {
             if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) {
                 my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
                 my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
@@ -2147,13 +2147,13 @@
                     }
                 }
             }
-	    	$message.=&storeparm(split(/\&/,$markers[$i]),
-				 $values[$i],
-				 $types[$i],
-				 $uname,$udom,$csec,$cgroup);
-		}
+            $message.=&storeparm(split(/\&/,$markers[$i]),
+                 $values[$i],
+                 $types[$i],
+                 $uname,$udom,$csec,$cgroup);
+        }
 # ---------------------------------------------------------------- Done storing
-    	$message.='<p class="LC_warning">'
+        $message.='<p class="LC_warning">'
                  .&mt('Changes can take up to 10 minutes before being active for all students.')
                  .&Apache::loncommon::help_open_topic('Caching')
                  .'</p>';
@@ -2167,10 +2167,10 @@
     &startpage($r);
 
     foreach ('tolerance','date_default','date_start','date_end',
-	    'date_interval','int','float','string') {
-		$r->print('<input type="hidden" value="'.
-		  &HTML::Entities::encode($env{'form.recent_'.$_},'"&<>').
-		  '" name="recent_'.$_.'" />');
+        'date_interval','int','float','string') {
+        $r->print('<input type="hidden" value="'.
+          &HTML::Entities::encode($env{'form.recent_'.$_},'"&<>').
+          '" name="recent_'.$_.'" />');
     }
 
     # ----- Start Parameter Selection
@@ -2200,22 +2200,22 @@
 
         &levelmenu($r,\%alllevs,$parmlev);
 
-		if ($parmlev ne 'general') {
-        	$r->print(&Apache::lonhtmlcommon::row_closure());
-	    	&mapmenu($r,\%allmaps,$pschp,\%maptitles, \%symbp);
-		}
-
-    	$r->print(&Apache::lonhtmlcommon::row_closure(1));
-    	$r->print(&Apache::lonhtmlcommon::end_pick_box());
-    	#Display Unit 2 "Select Parameter"   
-		&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder);
+        if ($parmlev ne 'general') {
+            $r->print(&Apache::lonhtmlcommon::row_closure());
+            &mapmenu($r,\%allmaps,$pschp,\%maptitles, \%symbp);
+        }
+
+        $r->print(&Apache::lonhtmlcommon::row_closure(1));
+        $r->print(&Apache::lonhtmlcommon::end_pick_box());
+        #Display Unit 2 "Select Parameter"   
+        &displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder);
     } else {
         my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb);
-		my $title = &Apache::lonnet::gettitle($pssymb);
+        my $title = &Apache::lonnet::gettitle($pssymb);
         $r->print(&mt('Specific Resource: [_1] ([_2])',$title,$resource).
                 '<input type="hidden" value="'.$pssymb.'" name="symb" />'.
-		  		'<br /><label><b>'.&mt('Show all parts').': <input type="checkbox" name="psprt" value="all"'.
-		  		($env{'form.psprt'}?' checked="checked"':'').' /></b></label><br />');
+                  '<br /><label><b>'.&mt('Show all parts').': <input type="checkbox" name="psprt" value="all"'.
+                  ($env{'form.psprt'}?' checked="checked"':'').' /></b></label><br />');
     }
     $r->print(&Apache::lonhtmlcommon::topic_bar (3,&mt('User Selection')));
     $r->print(&Apache::lonhtmlcommon::start_pick_box());
@@ -2244,7 +2244,7 @@
              .&mt('Change Parameter Selection')
              .'</a>'
              .'</p>'
-	);
+    );
 
     # Display Messages
     $r->print('<div>'.$message.'</div>');
@@ -2265,101 +2265,101 @@
         my $csudom=$env{'user.domain'};
 
         if ($parmlev eq 'full') {
-       		my $coursespan=$csec?8:5;
-           	my $userspan=3;
-           	if ($cgroup ne '') {
-            	  $coursespan += 3;
-           	}
-
-           	$r->print('<p><table border="2">');
-           	$r->print('<tr><td colspan="5"></td>');
-           	$r->print('<th colspan="'.($coursespan).'">'.&mt('Any User').'</th>');
-           	if ($uname) {
-            	if (@usersgroups > 1) {
-                   	$userspan ++;
-               	}
-               	$r->print('<th colspan="'.$userspan.'" rowspan="2">');
-               	$r->print(&mt("User")." $uname ".&mt('at Domain')." $udom</th>");
-           	}
-	   		my %lt=&Apache::lonlocal::texthash(
-				'pie'    => "Parameter in Effect",
-				'csv'    => "Current Session Value",
+               my $coursespan=$csec?8:5;
+               my $userspan=3;
+               if ($cgroup ne '') {
+                  $coursespan += 3;
+               }
+
+               $r->print('<p><table border="2">');
+               $r->print('<tr><td colspan="5"></td>');
+               $r->print('<th colspan="'.($coursespan).'">'.&mt('Any User').'</th>');
+               if ($uname) {
+                if (@usersgroups > 1) {
+                       $userspan ++;
+                   }
+                   $r->print('<th colspan="'.$userspan.'" rowspan="2">');
+                   $r->print(&mt("User")." $uname ".&mt('at Domain')." $udom</th>");
+               }
+               my %lt=&Apache::lonlocal::texthash(
+                'pie'    => "Parameter in Effect",
+                'csv'    => "Current Session Value",
                 'at'     => 'at',
                 'rl'     => "Resource Level",
-				'ic'     => 'in Course',
-				'aut'    => "Assessment URL and Title",
-				'type'   => 'Type',
-				'emof'   => "Enclosing Map or Folder",
-				'part'   => 'Part',
+                'ic'     => 'in Course',
+                'aut'    => "Assessment URL and Title",
+                'type'   => 'Type',
+                'emof'   => "Enclosing Map or Folder",
+                'part'   => 'Part',
                 'pn'     => 'Parameter Name',
-				'def'    => 'default',
-				'femof'  => 'from Enclosing Map or Folder',
-				'gen'    => 'general',
-				'foremf' => 'for Enclosing Map or Folder',
-				'fr'     => 'for Resource'
-			);
-           	$r->print(<<ENDTABLETWO);
+                'def'    => 'default',
+                'femof'  => 'from Enclosing Map or Folder',
+                'gen'    => 'general',
+                'foremf' => 'for Enclosing Map or Folder',
+                'fr'     => 'for Resource'
+            );
+               $r->print(<<ENDTABLETWO);
 <th rowspan="3">$lt{'pie'}</th>
 <th rowspan="3">$lt{'csv'}<br />($csuname $lt{'at'} $csudom)</th>
 </tr><tr><td colspan="5"></td><th colspan="2">$lt{'ic'}</th><th colspan="2">$lt{'rl'}</th>
 <th colspan="1">$lt{'ic'}</th>
 
 ENDTABLETWO
-           	if ($csec) {
-           		$r->print('<th colspan="3">'.
-			  	&mt("in Section")." $csec</th>");
-           	}
-           	if ($cgroup) {
+               if ($csec) {
+                   $r->print('<th colspan="3">'.
+                  &mt("in Section")." $csec</th>");
+               }
+               if ($cgroup) {
                 $r->print('<th colspan="3">'.
                 &mt("in Group")." $cgroup</th>");
-           	}
-           	$r->print(<<ENDTABLEHEADFOUR);
+               }
+               $r->print(<<ENDTABLEHEADFOUR);
 </tr><tr><th>$lt{'aut'}</th><th>$lt{'type'}</th>
 <th>$lt{'emof'}</th><th>$lt{'part'}</th><th>$lt{'pn'}</th>
 <th>$lt{'gen'}</th><th>$lt{'foremf'}</th>
 <th>$lt{'def'}</th><th>$lt{'femof'}</th><th>$lt{'fr'}</th>
 ENDTABLEHEADFOUR
 
-           	if ($csec) {
-           		$r->print('<th>'.&mt('general').'</th><th>'.&mt('for Enclosing Map or Folder').'</th><th>'.&mt('for Resource').'</th>');
-           	}
-
-           	if ($cgroup) {
-            	$r->print('<th>'.&mt('general').'</th><th>'.&mt('for Enclosing Map or Folder').'</th><th>'.&mt('for Resource').'</th>');
-           	}
-
-           	if ($uname) {
-            	if (@usersgroups > 1) {
-                	$r->print('<th>'.&mt('Control by other group?').'</th>');
-               	}
-               	$r->print('<th>'.&mt('general').'</th><th>'.&mt('for Enclosing Map or Folder').'</th><th>'.&mt('for Resource').'</th>');
-           	}
-
-           	$r->print('</tr>');
-
-           	my $defbgone='';
-           	my $defbgtwo='';
-           	my $defbgthree = '';
+               if ($csec) {
+                   $r->print('<th>'.&mt('general').'</th><th>'.&mt('for Enclosing Map or Folder').'</th><th>'.&mt('for Resource').'</th>');
+               }
+
+               if ($cgroup) {
+                $r->print('<th>'.&mt('general').'</th><th>'.&mt('for Enclosing Map or Folder').'</th><th>'.&mt('for Resource').'</th>');
+               }
+
+               if ($uname) {
+                if (@usersgroups > 1) {
+                    $r->print('<th>'.&mt('Control by other group?').'</th>');
+                   }
+                   $r->print('<th>'.&mt('general').'</th><th>'.&mt('for Enclosing Map or Folder').'</th><th>'.&mt('for Resource').'</th>');
+               }
+
+               $r->print('</tr>');
+
+               my $defbgone='';
+               my $defbgtwo='';
+               my $defbgthree = '';
 
-           	foreach (@ids) {
+               foreach (@ids) {
 
-            	my $rid=$_;
+                my $rid=$_;
                 my ($inmapid)=($rid=~/\.(\d+)$/);
 
                 if ((!$pssymb &&
-		     	(($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid})))
-		    	||
-		    	($pssymb && $pssymb eq $symbp{$rid})) {
+                 (($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid})))
+                ||
+                ($pssymb && $pssymb eq $symbp{$rid})) {
 # ------------------------------------------------------ Entry for one resource
-                	if ($defbgone eq '#E0E099') {
-                    	$defbgone='#E0E0DD';
+                    if ($defbgone eq '#E0E099') {
+                        $defbgone='#E0E0DD';
                     } else {
                         $defbgone='#E0E099';
                     }
                     if ($defbgtwo eq '#FFFF99') {
-                    	$defbgtwo='#FFFFDD';
+                        $defbgtwo='#FFFFDD';
                     } else {
-                    	$defbgtwo='#FFFF99';
+                        $defbgtwo='#FFFF99';
                     }
                     if ($defbgthree eq '#FFBB99') {
                         $defbgthree='#FFBBDD';
@@ -2400,21 +2400,21 @@
                     }
                     my $totalparms=scalar keys %name;
                     if ($totalparms>0) {
-                   		my $firstrow=1;
-						my $title=&Apache::lonnet::gettitle($symbp{$rid});
+                           my $firstrow=1;
+                        my $title=&Apache::lonnet::gettitle($symbp{$rid});
                         $r->print('<tr><td style="background-color:'.$defbgone.';"'.
                              ' rowspan='.$totalparms.
                              '><tt><font size="-1">'.
                              join(' / ',split(/\//,$uri)).
                              '</font></tt><p><b>'.
                              "<a href=\"javascript:openWindow('".
-				  		&Apache::lonnet::clutter($uri).'?symb='.
-				  		&escape($symbp{$rid}).
+                          &Apache::lonnet::clutter($uri).'?symb='.
+                          &escape($symbp{$rid}).
                              "', 'metadatafile', '450', '500', 'no', 'yes');\"".
                              " target=\"_self\">$title");
 
                         if ($thistitle) {
-                        	$r->print(' ('.$thistitle.')');
+                            $r->print(' ('.$thistitle.')');
                         }
                         $r->print('</a></b></td>');
                         $r->print('<td style="background-color:'.$defbgtwo.';"'.
@@ -2458,7 +2458,7 @@
 
 #-------------------------------------------- for each map, gather information
             my $mapid;
-	   		foreach $mapid (sort {$maplist{$a} cmp $maplist{$b}} keys %maplist) {
+               foreach $mapid (sort {$maplist{$a} cmp $maplist{$b}} keys %maplist) {
                 my $maptitle = $maplist{$mapid};
 
 #-----------------------  loop through ids and get all parameter types for map
@@ -2470,16 +2470,16 @@
                 my %default = ();
                 my $map = 0;
 
-#		$r->print("Catmarker: @catmarker<br />\n");
+#        $r->print("Catmarker: @catmarker<br />\n");
 
                 foreach (@ids) {
-                	($map)=(/([\d]*?)\./);
-                  	my $rid = $_;
+                    ($map)=(/([\d]*?)\./);
+                      my $rid = $_;
 
 #                  $r->print("$mapid:$map:   $rid <br /> \n");
 
-                 	if ($map eq $mapid) {
-	                    my $uri=&Apache::lonnet::declutter($uris{$rid});
+                     if ($map eq $mapid) {
+                        my $uri=&Apache::lonnet::declutter($uris{$rid});
 #                    $r->print("Keys: $keyp{$rid} <br />\n");
 
 #--------------------------------------------------------------------
@@ -2489,32 +2489,32 @@
 # When storing information, store as part 0
 # When requesting information, request from full part
 #-------------------------------------------------------------------
-    	                foreach (&keysplit($keyp{$rid})) {
-        	             	my $tempkeyp = $_;
-            	          	my $fullkeyp = $tempkeyp;
-                	      	$tempkeyp =~ s/_\w+_/_0_/;
-
-                    	  	if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
-                        		$part{$tempkeyp}="0";
-                        		$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');
-                        		my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
-                        		if ($allparms{$name{$tempkeyp}} ne '') {
-                            		my $identifier;
-                            		if ($parmdis =~ /(\s*\[Part.*)$/) {
-                                		$identifier = $1;
-                            		}
-                            		$display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier;
-                        		} else {
-                            		$display{$tempkeyp} = $parmdis;
-                        		}
-                        		unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
-                        		$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
-                        		$display{$tempkeyp} =~ s/_\w+_/_0_/;
-                        		$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp);
-                        		$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type');
-                      		}
-                    	} # end loop through keys
-                  	}
+                        foreach (&keysplit($keyp{$rid})) {
+                             my $tempkeyp = $_;
+                              my $fullkeyp = $tempkeyp;
+                              $tempkeyp =~ s/_\w+_/_0_/;
+
+                              if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
+                                $part{$tempkeyp}="0";
+                                $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');
+                                my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
+                                if ($allparms{$name{$tempkeyp}} ne '') {
+                                    my $identifier;
+                                    if ($parmdis =~ /(\s*\[Part.*)$/) {
+                                        $identifier = $1;
+                                    }
+                                    $display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier;
+                                } else {
+                                    $display{$tempkeyp} = $parmdis;
+                                }
+                                unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
+                                $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
+                                $display{$tempkeyp} =~ s/_\w+_/_0_/;
+                                $default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp);
+                                $type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type');
+                              }
+                        } # end loop through keys
+                      }
                 } # end loop through ids
 
 #---------------------------------------------------- print header information
@@ -2522,7 +2522,7 @@
                 my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':'');
                 my $tmp="";
                 if ($uname) {
-		    		my $person=&Apache::loncommon::plainname($uname,$udom);
+                    my $person=&Apache::loncommon::plainname($uname,$udom);
                     $tmp.=&mt("User")." <font color=\"red\"><i>$uname \($person\) </i></font> ".
                         &mt('in')." \n";
                 } else {
@@ -2553,8 +2553,8 @@
                          .&Apache::loncommon::end_data_table_header_row()
                 );
 
-	        	foreach (&keysinorder(\%name,\%keyorder)) {
-                	$r->print(&Apache::loncommon::start_data_table_row());
+                foreach (&keysinorder(\%name,\%keyorder)) {
+                    $r->print(&Apache::loncommon::start_data_table_row());
                     &print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default,
                            \%type,\%display,$defbgone,$defbgtwo,$defbgthree,
                            $parmlev,$uname,$udom,$csec,$cgroup);
@@ -2566,7 +2566,7 @@
         } # end of $parmlev eq map
 #--------------------------------- Entry for parm level general (Course level)
         if ($parmlev eq 'general') {
-        	my $defbgone = '#E0E099';
+            my $defbgone = '#E0E099';
             my $defbgtwo = '#FFFF99';
             my $defbgthree = '#FFBB99';
 
@@ -2592,41 +2592,41 @@
 # When storing information, store as part 0
 # When requesting information, request from full part
 #-------------------------------------------------------------------
-            	foreach (&keysplit($keyp{$rid})) {
-                	my $tempkeyp = $_;
-                  	my $fullkeyp = $tempkeyp;
-                  	$tempkeyp =~ s/_\w+_/_0_/;
-                  	if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
-                    	$part{$tempkeyp}="0";
-                    	$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');
-                    	my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
-                    	if ($allparms{$name{$tempkeyp}} ne '') {
-                        	my $identifier;
-                        	if ($parmdis =~ /(\s*\[Part.*)$/) {
-                            	$identifier = $1;
-                        	}
-                        	$display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier;
-                    	} else {
-                        	$display{$tempkeyp} = $parmdis;
-                    	}
-                    	unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
-                    	$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
-                    	$display{$tempkeyp} =~ s/_\w+_/_0_/;
-                    	$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp);
-                    	$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type');
-                  	}
+                foreach (&keysplit($keyp{$rid})) {
+                    my $tempkeyp = $_;
+                      my $fullkeyp = $tempkeyp;
+                      $tempkeyp =~ s/_\w+_/_0_/;
+                      if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
+                        $part{$tempkeyp}="0";
+                        $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');
+                        my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
+                        if ($allparms{$name{$tempkeyp}} ne '') {
+                            my $identifier;
+                            if ($parmdis =~ /(\s*\[Part.*)$/) {
+                                $identifier = $1;
+                            }
+                            $display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier;
+                        } else {
+                            $display{$tempkeyp} = $parmdis;
+                        }
+                        unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
+                        $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
+                        $display{$tempkeyp} =~ s/_\w+_/_0_/;
+                        $default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp);
+                        $type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type');
+                      }
                 } # end loop through keys
             } # end loop through ids
 
 #---------------------------------------------------- print header information
-	    	my $setdef=&mt("Set Defaults for All Resources in Course");
+            my $setdef=&mt("Set Defaults for All Resources in Course");
             $r->print(<<ENDMAPONE);
 <center>
 <h4>$setdef
 <font color="red"><i>$coursename</i></font><br />
 ENDMAPONE
             if ($uname) {
-				my $person=&Apache::loncommon::plainname($uname,$udom);
+                my $person=&Apache::loncommon::plainname($uname,$udom);
                 $r->print(" ".&mt("User")."<font color=\"red\"> <i>$uname \($person\) </i></font> \n");
             } else {
                 $r->print("<i><font color=\"red\"> ".&mt("ALL")."</i> ".&mt("USERS")."</font> \n");
@@ -2644,7 +2644,7 @@
                      .&Apache::loncommon::end_data_table_header_row()
             );
 
-	    	foreach (&keysinorder(\%name,\%keyorder)) {
+            foreach (&keysinorder(\%name,\%keyorder)) {
                 $r->print(&Apache::loncommon::start_data_table_row());
                 &print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default,
                        \%type,\%display,$defbgone,$defbgtwo,$defbgthree,
@@ -2666,20 +2666,20 @@
 
 sub tablestart {
     if ($tableopen) {
-	return '';
+    return '';
     } else {
-	$tableopen=1;
-	return &Apache::loncommon::start_data_table().'<tr><th>'.&mt('Parameter').'</th><th>'.
-	    &mt('Delete').'</th><th>'.&mt('Set to ...').'</th></tr>';
+    $tableopen=1;
+    return &Apache::loncommon::start_data_table().'<tr><th>'.&mt('Parameter').'</th><th>'.
+        &mt('Delete').'</th><th>'.&mt('Set to ...').'</th></tr>';
     }
 }
 
 sub tableend {
     if ($tableopen) {
-	$tableopen=0;
-	return &Apache::loncommon::end_data_table();
+    $tableopen=0;
+    return &Apache::loncommon::end_data_table();
     } else {
-	return'';
+    return'';
     }
 }
 
@@ -2692,16 +2692,16 @@
     my $classlist=&Apache::loncoursedata::get_classlist();
     foreach (keys %$classlist) {
         if ($_=~/^($match_username)\:($match_domain)$/) {
-	    my ($tuname,$tudom)=($1,$2);
-	    my $useropt=&Apache::lonnet::get_userresdata($tuname,$tudom);
+        my ($tuname,$tudom)=($1,$2);
+        my $useropt=&Apache::lonnet::get_userresdata($tuname,$tudom);
             foreach my $userkey (keys %{$useropt}) {
-		if ($userkey=~/^$env{'request.course.id'}/) {
+        if ($userkey=~/^$env{'request.course.id'}/) {
                     my $newkey=$userkey;
-		    $newkey=~s/^($env{'request.course.id'}\.)/$1\[useropt\:$tuname\:$tudom\]\./;
-		    $$resourcedata{$newkey}=$$useropt{$userkey};
-		}
-	    }
-	}
+            $newkey=~s/^($env{'request.course.id'}\.)/$1\[useropt\:$tuname\:$tudom\]\./;
+            $$resourcedata{$newkey}=$$useropt{$userkey};
+        }
+        }
+    }
     }
     return $resourcedata;
 }
@@ -2719,87 +2719,87 @@
     my @deldata=();
     undef @deldata;
     foreach (keys %env) {
-	if ($_=~/^form\.([a-z]+)\_(.+)$/) {
-	    my $cmd=$1;
-	    my $thiskey=$2;
-	    my ($tuname,$tudom)=&extractuser($thiskey);
-	    my $tkey=$thiskey;
+    if ($_=~/^form\.([a-z]+)\_(.+)$/) {
+        my $cmd=$1;
+        my $thiskey=$2;
+        my ($tuname,$tudom)=&extractuser($thiskey);
+        my $tkey=$thiskey;
+            if ($tuname) {
+        $tkey=~s/\.\[useropt\:$tuname\:$tudom\]\./\./;
+        }
+        if ($cmd eq 'set' || $cmd eq 'datepointer' || $cmd eq 'dateinterval') {
+        my ($data, $typeof, $text);
+        if ($cmd eq 'set') {
+            $data=$env{$_};
+            $typeof=$env{'form.typeof_'.$thiskey};
+            $text = &mt('Saved modified parameter for');
+        } elsif ($cmd eq 'datepointer') {
+            $data=&Apache::lonhtmlcommon::get_date_from_form($env{$_});
+            $typeof=$env{'form.typeof_'.$thiskey};
+            $text = &mt('Saved modified date for');
+        } elsif ($cmd eq 'dateinterval') {
+            $data=&get_date_interval_from_form($thiskey);
+            $typeof=$env{'form.typeof_'.$thiskey};
+            $text = &mt('Saved modified date for');
+        }
+        if (defined($data) and $$olddata{$thiskey} ne $data) {
             if ($tuname) {
-		$tkey=~s/\.\[useropt\:$tuname\:$tudom\]\./\./;
-	    }
-	    if ($cmd eq 'set' || $cmd eq 'datepointer' || $cmd eq 'dateinterval') {
-		my ($data, $typeof, $text);
-		if ($cmd eq 'set') {
-		    $data=$env{$_};
-		    $typeof=$env{'form.typeof_'.$thiskey};
-		    $text = &mt('Saved modified parameter for');
-		} elsif ($cmd eq 'datepointer') {
-		    $data=&Apache::lonhtmlcommon::get_date_from_form($env{$_});
-		    $typeof=$env{'form.typeof_'.$thiskey};
-		    $text = &mt('Saved modified date for');
-		} elsif ($cmd eq 'dateinterval') {
-		    $data=&get_date_interval_from_form($thiskey);
-		    $typeof=$env{'form.typeof_'.$thiskey};
-		    $text = &mt('Saved modified date for');
-		}
-		if (defined($data) and $$olddata{$thiskey} ne $data) {
-		    if ($tuname) {
-			if (&Apache::lonnet::put('resourcedata',{$tkey=>$data,
-								 $tkey.'.type' => $typeof},
-						 $tudom,$tuname) eq 'ok') {
-			    &log_parmset({$tkey=>$data,$tkey.'.type' => $typeof},0,$tuname,$tudom);
-			    $r->print('<br />'.$text.' '.
-				      &Apache::loncommon::plainname($tuname,$tudom));
-			} else {
-			    $r->print('<div class="LC_error">'.
-				      &mt('Error saving parameters').'</div>');
-			}
-			&Apache::lonnet::devalidateuserresdata($tuname,$tudom);
-		    } else {
-			$newdata{$thiskey}=$data;
- 			$newdata{$thiskey.'.type'}=$typeof;
+            if (&Apache::lonnet::put('resourcedata',{$tkey=>$data,
+                                 $tkey.'.type' => $typeof},
+                         $tudom,$tuname) eq 'ok') {
+                &log_parmset({$tkey=>$data,$tkey.'.type' => $typeof},0,$tuname,$tudom);
+                $r->print('<br />'.$text.' '.
+                      &Apache::loncommon::plainname($tuname,$tudom));
+            } else {
+                $r->print('<div class="LC_error">'.
+                      &mt('Error saving parameters').'</div>');
+            }
+            &Apache::lonnet::devalidateuserresdata($tuname,$tudom);
+            } else {
+            $newdata{$thiskey}=$data;
+             $newdata{$thiskey.'.type'}=$typeof;
                    }
-		}
-	    } elsif ($cmd eq 'del') {
-		if ($tuname) {
-		    if (&Apache::lonnet::del('resourcedata',[$tkey],$tudom,$tuname) eq 'ok') {
-			    &log_parmset({$tkey=>''},1,$tuname,$tudom);
-			$r->print('<br />'.&mt('Deleted parameter for').' '.&Apache::loncommon::plainname($tuname,$tudom));
-		    } else {
-			$r->print('<div class="LC_error">'.
-				  &mt('Error deleting parameters').'</div>');
-		    }
-		    &Apache::lonnet::devalidateuserresdata($tuname,$tudom);
-		} else {
-		    push (@deldata,$thiskey,$thiskey.'.type');
-		}
-	    }
-	}
+        }
+        } elsif ($cmd eq 'del') {
+        if ($tuname) {
+            if (&Apache::lonnet::del('resourcedata',[$tkey],$tudom,$tuname) eq 'ok') {
+                &log_parmset({$tkey=>''},1,$tuname,$tudom);
+            $r->print('<br />'.&mt('Deleted parameter for').' '.&Apache::loncommon::plainname($tuname,$tudom));
+            } else {
+            $r->print('<div class="LC_error">'.
+                  &mt('Error deleting parameters').'</div>');
+            }
+            &Apache::lonnet::devalidateuserresdata($tuname,$tudom);
+        } else {
+            push (@deldata,$thiskey,$thiskey.'.type');
+        }
+        }
+    }
     }
 # Store all course level
     my $delentries=$#deldata+1;
     my @newdatakeys=keys %newdata;
     my $putentries=$#newdatakeys+1;
     if ($delentries) {
-	if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') {
-	    my %loghash=map { $_ => '' } @deldata;
-	    &log_parmset(\%loghash,1);
-	    $r->print('<h2>'.&mt('Deleted [_1] parameter(s)</h2>',$delentries));
-	} else {
-	    $r->print('<div class="LC_error">'.
-		      &mt('Error deleting parameters').'</div>');
-	}
-	&Apache::lonnet::devalidatecourseresdata($crs,$dom);
+    if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') {
+        my %loghash=map { $_ => '' } @deldata;
+        &log_parmset(\%loghash,1);
+        $r->print('<h2>'.&mt('Deleted [_1] parameter(s)</h2>',$delentries));
+    } else {
+        $r->print('<div class="LC_error">'.
+              &mt('Error deleting parameters').'</div>');
+    }
+    &Apache::lonnet::devalidatecourseresdata($crs,$dom);
     }
     if ($putentries) {
-	if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') {
-			    &log_parmset(\%newdata,0);
-	    $r->print('<h3>'.&mt('Saved [_1] parameter(s)',$putentries/2).'</h3>');
-	} else {
-	    $r->print('<div class="LC_error">'.
-		      &mt('Error saving parameters').'</div>');
-	}
-	&Apache::lonnet::devalidatecourseresdata($crs,$dom);
+    if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') {
+                &log_parmset(\%newdata,0);
+        $r->print('<h3>'.&mt('Saved [_1] parameter(s)',$putentries/2).'</h3>');
+    } else {
+        $r->print('<div class="LC_error">'.
+              &mt('Error saving parameters').'</div>');
+    }
+    &Apache::lonnet::devalidatecourseresdata($crs,$dom);
     }
 }
 
@@ -2813,14 +2813,14 @@
     # split into student/section affected, and
     # the realm (folder/resource part and parameter
     my ($student,$realm) =
-	($key=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)$/);
+    ($key=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)$/);
     # if course wide student would be undefined
     if (!defined($student)) {
-	($realm)=($key=~/^\Q$env{'request.course.id'}\E\.(.+)$/);
+    ($realm)=($key=~/^\Q$env{'request.course.id'}\E\.(.+)$/);
     }
     # strip off the .type if it's not the Question type parameter
     if ($realm=~/\.type$/ && !exists($listdata->{$key.'.type'})) {
-	$realm=~s/\.type//;
+    $realm=~s/\.type//;
     }
     # split into resource+part and parameter name
     my ($res,    $parm) = ($realm=~/^(.*)\.(.*)$/);
@@ -2841,136 +2841,136 @@
     my %keyorder=&standardkeyorder();
 
     foreach my $thiskey (sort {
-	my ($astudent,$ares,$apart,$aparm) = &parse_listdata_key($a,$listdata);
-	my ($bstudent,$bres,$bpart,$bparm) = &parse_listdata_key($b,$listdata);
+    my ($astudent,$ares,$apart,$aparm) = &parse_listdata_key($a,$listdata);
+    my ($bstudent,$bres,$bpart,$bparm) = &parse_listdata_key($b,$listdata);
 
-	# get the numerical order for the param
-	$aparm=$keyorder{'parameter_0_'.$aparm};
-	$bparm=$keyorder{'parameter_0_'.$bparm};
+    # get the numerical order for the param
+    $aparm=$keyorder{'parameter_0_'.$aparm};
+    $bparm=$keyorder{'parameter_0_'.$bparm};
 
-	my $result=0;
+    my $result=0;
 
-	if ($sortorder eq 'realmstudent') {
+    if ($sortorder eq 'realmstudent') {
             if ($ares     ne $bres    ) {
-		$result = ($ares     cmp $bres);
+        $result = ($ares     cmp $bres);
             } elsif ($astudent ne $bstudent) {
-		$result = ($astudent cmp $bstudent);
-	    } elsif ($apart    ne $bpart   ) {
-		$result = ($apart    cmp $bpart);
-	    }
-	} else {
-	    if      ($astudent ne $bstudent) {
-		$result = ($astudent cmp $bstudent);
-	    } elsif ($ares     ne $bres    ) {
-		$result = ($ares     cmp $bres);
-	    } elsif ($apart    ne $bpart   ) {
-		$result = ($apart    cmp $bpart);
-	    }
-	}
+        $result = ($astudent cmp $bstudent);
+        } elsif ($apart    ne $bpart   ) {
+        $result = ($apart    cmp $bpart);
+        }
+    } else {
+        if      ($astudent ne $bstudent) {
+        $result = ($astudent cmp $bstudent);
+        } elsif ($ares     ne $bres    ) {
+        $result = ($ares     cmp $bres);
+        } elsif ($apart    ne $bpart   ) {
+        $result = ($apart    cmp $bpart);
+        }
+    }
 
-	if (!$result) {
+    if (!$result) {
             if (defined($aparm) && defined($bparm)) {
-		$result = ($aparm <=> $bparm);
+        $result = ($aparm <=> $bparm);
             } elsif (defined($aparm)) {
-		$result = -1;
+        $result = -1;
             } elsif (defined($bparm)) {
-		$result = 1;
-	    }
-	}
+        $result = 1;
+        }
+    }
 
-	$result;
+    $result;
     } keys %{$listdata}) {
 
-	if ($$listdata{$thiskey.'.type'}) {
+    if ($$listdata{$thiskey.'.type'}) {
             my $thistype=$$listdata{$thiskey.'.type'};
             if ($$resourcedata{$thiskey.'.type'}) {
-		$thistype=$$resourcedata{$thiskey.'.type'};
-	    }
-	    my ($middle,$part,$name)=
-		($thiskey=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
-	    my $section=&mt('All Students');
-	    if ($middle=~/^\[(.*)\]/) {
-		my $issection=$1;
-		if ($issection=~/^useropt\:($match_username)\:($match_domain)/) {
-		    $section=&mt('User').": ".&Apache::loncommon::plainname($1,$2);
-		} else {
-		    $section=&mt('Group/Section').': '.$issection;
-		}
-		$middle=~s/^\[(.*)\]//;
-	    }
-	    $middle=~s/\.+$//;
-	    $middle=~s/^\.+//;
-	    my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>';
-	    if ($middle=~/^(.+)\_\_\_\(all\)$/) {
-		$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><span class="LC_parm_folder">('.$1.')</span></span>';
-	    } elsif ($middle) {
-		my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle);
-		$realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>';
-	    }
-	    if ($sortorder eq 'realmstudent') {
-		if ($realm ne $oldrealm) {
-		    $r->print(&tableend()."\n<hr /><h1>$realm</h1>");
-		    $oldrealm=$realm;
-		    $oldsection='';
-		}
-		if ($section ne $oldsection) {
-		    $r->print(&tableend()."\n<h2>$section</h2>");
-		    $oldsection=$section;
-		    $oldpart='';
-		}
-	    } else {
-		if ($section ne $oldsection) {
-		    $r->print(&tableend()."\n<hr /><h1>$section</h1>");
-		    $oldsection=$section;
-		    $oldrealm='';
-		}
-		if ($realm ne $oldrealm) {
-		    $r->print(&tableend()."\n<h2>$realm</h2>");
-		    $oldrealm=$realm;
-		    $oldpart='';
-		}
-	    }
-	    if ($part ne $oldpart) {
-		$r->print(&tableend().
-			  "\n".'<span class="LC_parm_part">'.&mt('Part').": $part</span>");
-		$oldpart=$part;
-	    }
+        $thistype=$$resourcedata{$thiskey.'.type'};
+        }
+        my ($middle,$part,$name)=
+        ($thiskey=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
+        my $section=&mt('All Students');
+        if ($middle=~/^\[(.*)\]/) {
+        my $issection=$1;
+        if ($issection=~/^useropt\:($match_username)\:($match_domain)/) {
+            $section=&mt('User').": ".&Apache::loncommon::plainname($1,$2);
+        } else {
+            $section=&mt('Group/Section').': '.$issection;
+        }
+        $middle=~s/^\[(.*)\]//;
+        }
+        $middle=~s/\.+$//;
+        $middle=~s/^\.+//;
+        my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>';
+        if ($middle=~/^(.+)\_\_\_\(all\)$/) {
+        $realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><span class="LC_parm_folder">('.$1.')</span></span>';
+        } elsif ($middle) {
+        my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle);
+        $realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>';
+        }
+        if ($sortorder eq 'realmstudent') {
+        if ($realm ne $oldrealm) {
+            $r->print(&tableend()."\n<hr /><h1>$realm</h1>");
+            $oldrealm=$realm;
+            $oldsection='';
+        }
+        if ($section ne $oldsection) {
+            $r->print(&tableend()."\n<h2>$section</h2>");
+            $oldsection=$section;
+            $oldpart='';
+        }
+        } else {
+        if ($section ne $oldsection) {
+            $r->print(&tableend()."\n<hr /><h1>$section</h1>");
+            $oldsection=$section;
+            $oldrealm='';
+        }
+        if ($realm ne $oldrealm) {
+            $r->print(&tableend()."\n<h2>$realm</h2>");
+            $oldrealm=$realm;
+            $oldpart='';
+        }
+        }
+        if ($part ne $oldpart) {
+        $r->print(&tableend().
+              "\n".'<span class="LC_parm_part">'.&mt('Part').": $part</span>");
+        $oldpart=$part;
+        }
 #
 # Ready to print
 #
             my $parmitem = &standard_parameter_names($name);
-	    $r->print(&tablestart().
-		      &Apache::loncommon::start_data_table_row().
-		      '<td><b>'.&mt($parmitem).
-		      '</b></td><td><input type="checkbox" name="del_'.
-		      $thiskey.'" /></td><td>');
-	    $foundkeys++;
-	    if (&isdateparm($thistype)) {
-		my $jskey='key_'.$pointer;
-		$pointer++;
-		$r->print(
-			  &Apache::lonhtmlcommon::date_setter('parmform',
-							      $jskey,
-						      $$resourcedata{$thiskey},
-							      '',1,'','').
+        $r->print(&tablestart().
+              &Apache::loncommon::start_data_table_row().
+              '<td><b>'.&mt($parmitem).
+              '</b></td><td><input type="checkbox" name="del_'.
+              $thiskey.'" /></td><td>');
+        $foundkeys++;
+        if (&isdateparm($thistype)) {
+        my $jskey='key_'.$pointer;
+        $pointer++;
+        $r->print(
+              &Apache::lonhtmlcommon::date_setter('parmform',
+                                  $jskey,
+                              $$resourcedata{$thiskey},
+                                  '',1,'','').
 '<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'.
 (($$resourcedata{$thiskey}!=0)?'<span class="LC_nobreak"><a href="/adm/parmset?&action=dateshift1&timebase='.$$resourcedata{$thiskey}.'">'.
 &mt('Shift all dates based on this date').'</a></span>':'').
 &date_sanity_info($$resourcedata{$thiskey})
-			  );
-	    } elsif ($thistype eq 'date_interval') {
-		$r->print(&date_interval_selector($thiskey,
-						  $$resourcedata{$thiskey}));
-	    } elsif ($thistype =~ m/^string/) {
-		$r->print(&string_selector($thistype,$thiskey,
-					   $$resourcedata{$thiskey}));
-	    } else {
-		$r->print(&default_selector($thiskey,$$resourcedata{$thiskey}));
-	    }
-	    $r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'.
-		      $thistype.'" />');
-	    $r->print('</td>'.&Apache::loncommon::end_data_table_row());
-	}
+              );
+        } elsif ($thistype eq 'date_interval') {
+        $r->print(&date_interval_selector($thiskey,
+                          $$resourcedata{$thiskey}));
+        } elsif ($thistype =~ m/^string/) {
+        $r->print(&string_selector($thistype,$thiskey,
+                       $$resourcedata{$thiskey}));
+        } else {
+        $r->print(&default_selector($thiskey,$$resourcedata{$thiskey}));
+        }
+        $r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'.
+              $thistype.'" />');
+        $r->print('</td>'.&Apache::loncommon::end_data_table_row());
+    }
     }
     return $foundkeys;
 }
@@ -2980,17 +2980,17 @@
     my ($thiskey, $showval) = @_;
     my $result;
     foreach my $which (['days', 86400, 31],
-		       ['hours', 3600, 23],
-		       ['minutes', 60, 59],
-		       ['seconds',  1, 59]) {
-	my ($name, $factor, $max) = @{ $which };
-	my $amount = int($showval/$factor);
-	$showval  %= $factor;
-	my %select = ((map {$_ => $_} (0..$max)),
-		      'select_form_order' => [0..$max]);
-	$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey,
-						   %select);
-	$result .= ' '.&mt($name);
+               ['hours', 3600, 23],
+               ['minutes', 60, 59],
+               ['seconds',  1, 59]) {
+    my ($name, $factor, $max) = @{ $which };
+    my $amount = int($showval/$factor);
+    $showval  %= $factor;
+    my %select = ((map {$_ => $_} (0..$max)),
+              'select_form_order' => [0..$max]);
+    $result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey,
+                           %select);
+    $result .= ' '.&mt($name);
     }
     $result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />';
     return $result;
@@ -3001,13 +3001,13 @@
     my ($key) = @_;
     my $seconds = 0;
     foreach my $which (['days', 86400],
-		       ['hours', 3600],
-		       ['minutes', 60],
-		       ['seconds',  1]) {
-	my ($name, $factor) = @{ $which };
-	if (defined($env{'form.'.$name.'_'.$key})) {
-	    $seconds += $env{'form.'.$name.'_'.$key} * $factor;
-	}
+               ['hours', 3600],
+               ['minutes', 60],
+               ['seconds',  1]) {
+    my ($name, $factor) = @{ $which };
+    if (defined($env{'form.'.$name.'_'.$key})) {
+        $seconds += $env{'form.'.$name.'_'.$key} * $factor;
+    }
     }
     return $seconds;
 }
@@ -3022,12 +3022,12 @@
     (
      'string_yesno'
              => [[ 'yes', 'Yes' ],
-		 [ 'no', 'No' ]],
+         [ 'no', 'No' ]],
      'string_problemstatus'
              => [[ 'yes', 'Yes' ],
-		 [ 'answer', 'Yes, and show correct answer if they exceed the maximum number of tries.' ],
-		 [ 'no', 'No, don\'t show correct/incorrect feedback.' ],
-		 [ 'no_feedback_ever', 'No, show no feedback at all.' ]],
+         [ 'answer', 'Yes, and show correct answer if they exceed the maximum number of tries.' ],
+         [ 'no', 'No, don\'t show correct/incorrect feedback.' ],
+         [ 'no_feedback_ever', 'No, show no feedback at all.' ]],
      );
 
 
@@ -3035,18 +3035,18 @@
     my ($thistype, $thiskey, $showval) = @_;
 
     if (!exists($strings{$thistype})) {
-	return &default_selector($thiskey,$showval);
+    return &default_selector($thiskey,$showval);
     }
 
     my $result;
     foreach my $possibilities (@{ $strings{$thistype} }) {
-	my ($name, $description) = @{ $possibilities };
-	$result .= '<label><input type="radio" name="set_'.$thiskey.
-		  '" value="'.$name.'"';
-	if ($showval eq $name) {
-	    $result .= ' checked="checked"';
-	}
-	$result .= ' />'.&mt($description).'</label> ';
+    my ($name, $description) = @{ $possibilities };
+    $result .= '<label><input type="radio" name="set_'.$thiskey.
+          '" value="'.$name.'"';
+    if ($showval eq $name) {
+        $result .= ' checked="checked"';
+    }
+    $result .= ' />'.&mt($description).'</label> ';
     }
     return $result;
 }
@@ -3092,7 +3092,7 @@
     my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
-    	text=>"Overview Mode"});
+        text=>"Overview Mode"});
     my $start_page = &Apache::loncommon::start_page('Set Parameters');
     my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview');
     $r->print(<<ENDOVER);
@@ -3127,7 +3127,7 @@
     if (!@psprt) { $psprt[0]='0'; }
 
     my @selected_sections =
-	&Apache::loncommon::get_env_multiple('form.Section');
+    &Apache::loncommon::get_env_multiple('form.Section');
     @selected_sections = ('all') if (! @selected_sections);
     foreach my $sec (@selected_sections) {
         if ($sec eq 'all') {
@@ -3147,11 +3147,11 @@
     }
 
     &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps,
-				\%mapp, \%symbp,\%maptitles,\%uris,
-				\%keyorder,\%defkeytype);
+                \%mapp, \%symbp,\%maptitles,\%uris,
+                \%keyorder,\%defkeytype);
 
     if (grep {$_ eq 'all'} (@psprt)) {
-	@psprt = keys(%allparts);
+    @psprt = keys(%allparts);
     }
 # Menu to select levels, etc
 
@@ -3163,10 +3163,10 @@
     $r->print(&Apache::lonhtmlcommon::start_pick_box());
     &levelmenu($r,\%alllevs,$parmlev);
     if ($parmlev ne 'general') {
-	#$r->print('<td class="LC_parm_overview_map_menu">');
+    #$r->print('<td class="LC_parm_overview_map_menu">');
         $r->print(&Apache::lonhtmlcommon::row_closure());
-	&mapmenu($r,\%allmaps,$pschp,\%maptitles);
-	#$r->print('</td>');
+    &mapmenu($r,\%allmaps,$pschp,\%maptitles);
+    #$r->print('</td>');
     }
     $r->print(&Apache::lonhtmlcommon::row_closure(1));
     $r->print(&Apache::lonhtmlcommon::end_pick_box());
@@ -3219,19 +3219,19 @@
 
     if (($env{'form.store'}) || ($env{'form.dis'})) {
 
-	if ($env{'form.store'}) { &storedata($r,$crs,$dom); }
+    if ($env{'form.store'}) { &storedata($r,$crs,$dom); }
 
 # Read modified data
 
-	my $resourcedata=&readdata($crs,$dom);
+    my $resourcedata=&readdata($crs,$dom);
 
 # List data
 
-	&listdata($r,$resourcedata,$listdata,$sortorder);
+    &listdata($r,$resourcedata,$listdata,$sortorder);
     }
     $r->print(&tableend().
-	     ((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':'').
-	      '</form>'.&Apache::loncommon::end_page());
+         ((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':'').
+          '</form>'.&Apache::loncommon::end_page());
 }
 
 sub secgroup_lister {
@@ -3275,7 +3275,7 @@
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
 
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
-	text=>"Overview Mode"});
+    text=>"Overview Mode"});
     my $start_page=&Apache::loncommon::start_page('Modify Parameters');
     my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview');
     $r->print(<<ENDOVER);
@@ -3301,8 +3301,8 @@
     my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder);
 
     $r->print(&tableend().'<p>'.
-	($foundkeys?'<input type="submit" value="'.&mt('Save').'" />':&mt('There are no parameters.')).'</p></form>'.
-	      &Apache::loncommon::end_page());
+    ($foundkeys?'<input type="submit" value="'.&mt('Save').'" />':&mt('There are no parameters.')).'</p></form>'.
+          &Apache::loncommon::end_page());
 }
 
 sub clean_parameters {
@@ -3311,7 +3311,7 @@
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
 
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=cleanparameters',
-    	text=>"Clean Parameters"});
+        text=>"Clean Parameters"});
     my $start_page=&Apache::loncommon::start_page('Clean Parameters');
     my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Clean');
     $r->print(<<ENDOVER);
@@ -3330,65 +3330,65 @@
 # List data
 
     $r->print('<h3>'.
-	      &mt('These parameters refer to resources that do not exist.').
-	      '</h3>'.
-	      '<input type="submit" value="'.&mt('Delete Selected').'" />'.'<br />'.
-	      '<br />');
+          &mt('These parameters refer to resources that do not exist.').
+          '</h3>'.
+          '<input type="submit" value="'.&mt('Delete Selected').'" />'.'<br />'.
+          '<br />');
     $r->print(&Apache::loncommon::start_data_table().
-	      '<tr>'.
-	      '<th>'.&mt('Delete').'</th>'.
-	      '<th>'.&mt('Parameter').'</th>'.
-	      '</tr>');
+          '<tr>'.
+          '<th>'.&mt('Delete').'</th>'.
+          '<th>'.&mt('Parameter').'</th>'.
+          '</tr>');
     foreach my $thiskey (sort(keys(%{$resourcedata}))) {
-	next if (!exists($resourcedata->{$thiskey.'.type'})
-		 && $thiskey=~/\.type$/);
-	my %data = &parse_key($thiskey);
-	if (1) { #exists($data{'realm_exists'})
-	    #&& !$data{'realm_exists'}) {
-	    $r->print(&Apache::loncommon::start_data_table_row().
-		      '<tr>'.
-		      '<td><input type="checkbox" name="del_'.$thiskey.'" /></td>'		      );
-
-	    $r->print('<td>');
-	    my $display_value = $resourcedata->{$thiskey};
-	    if (&isdateparm($resourcedata->{$thiskey.'.type'})) {
-		$display_value =
-		    &Apache::lonlocal::locallocaltime($display_value);
-	    }
+    next if (!exists($resourcedata->{$thiskey.'.type'})
+         && $thiskey=~/\.type$/);
+    my %data = &parse_key($thiskey);
+    if (1) { #exists($data{'realm_exists'})
+        #&& !$data{'realm_exists'}) {
+        $r->print(&Apache::loncommon::start_data_table_row().
+              '<tr>'.
+              '<td><input type="checkbox" name="del_'.$thiskey.'" /></td>'              );
+
+        $r->print('<td>');
+        my $display_value = $resourcedata->{$thiskey};
+        if (&isdateparm($resourcedata->{$thiskey.'.type'})) {
+        $display_value =
+            &Apache::lonlocal::locallocaltime($display_value);
+        }
             my $parmitem = &standard_parameter_names($data{'parameter_name'});
             $parmitem = &mt($parmitem);
-	    $r->print(&mt('Parameter: "[_1]" with value: "[_2]"',
-			  $parmitem,$resourcedata->{$thiskey}));
-	    $r->print('<br />');
-	    if ($data{'scope_type'} eq 'all') {
-		$r->print(&mt('All users'));
-	    } elsif ($data{'scope_type'} eq 'user') {
-		$r->print(&mt('User: [_1]',join(':',@{$data{'scope'}})));
-	    } elsif ($data{'scope_type'} eq 'section') {
-		$r->print(&mt('Section: [_1]',$data{'scope'}));
-	    } elsif ($data{'scope_type'} eq 'group') {
-		$r->print(&mt('Group: [_1]',$data{'scope'}));
-	    }
-	    $r->print('<br />');
-	    if ($data{'realm_type'} eq 'all') {
-		$r->print(&mt('All Resources'));
-	    } elsif ($data{'realm_type'} eq 'folder') {
-		$r->print(&mt('Folder: [_1]'),$data{'realm'});
-	    } elsif ($data{'realm_type'} eq 'symb') {
-		my ($map,$resid,$url) =
-		    &Apache::lonnet::decode_symb($data{'realm'});
-		$r->print(&mt('Resource: [_1] <br />&nbsp;&nbsp;&nbsp;with ID: [_2] <br />&nbsp;&nbsp;&nbsp;in folder [_3]',
-			      $url,$resid,$map));
-	    }
-	    $r->print(' <br />&nbsp;&nbsp;&nbsp;'.&mt('Part: [_1]',$data{'parameter_part'}));
-	    $r->print('</td></tr>');
+        $r->print(&mt('Parameter: "[_1]" with value: "[_2]"',
+              $parmitem,$resourcedata->{$thiskey}));
+        $r->print('<br />');
+        if ($data{'scope_type'} eq 'all') {
+        $r->print(&mt('All users'));
+        } elsif ($data{'scope_type'} eq 'user') {
+        $r->print(&mt('User: [_1]',join(':',@{$data{'scope'}})));
+        } elsif ($data{'scope_type'} eq 'section') {
+        $r->print(&mt('Section: [_1]',$data{'scope'}));
+        } elsif ($data{'scope_type'} eq 'group') {
+        $r->print(&mt('Group: [_1]',$data{'scope'}));
+        }
+        $r->print('<br />');
+        if ($data{'realm_type'} eq 'all') {
+        $r->print(&mt('All Resources'));
+        } elsif ($data{'realm_type'} eq 'folder') {
+        $r->print(&mt('Folder: [_1]'),$data{'realm'});
+        } elsif ($data{'realm_type'} eq 'symb') {
+        my ($map,$resid,$url) =
+            &Apache::lonnet::decode_symb($data{'realm'});
+        $r->print(&mt('Resource: [_1] <br />&nbsp;&nbsp;&nbsp;with ID: [_2] <br />&nbsp;&nbsp;&nbsp;in folder [_3]',
+                  $url,$resid,$map));
+        }
+        $r->print(' <br />&nbsp;&nbsp;&nbsp;'.&mt('Part: [_1]',$data{'parameter_part'}));
+        $r->print('</td></tr>');
 
-	}
+    }
     }
     $r->print(&Apache::loncommon::end_data_table().'<p>'.
-	      '<input type="submit" value="'.&mt('Delete Selected').'" />'.
-	      '</p></form>'.
-	      &Apache::loncommon::end_page());
+          '<input type="submit" value="'.&mt('Delete Selected').'" />'.
+          '</p></form>'.
+          &Apache::loncommon::end_page());
 }
 
 sub date_shift_one {
@@ -3397,7 +3397,7 @@
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
 
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},
-    	text=>"Shifting Dates"});
+        text=>"Shifting Dates"});
     my $start_page=&Apache::loncommon::start_page('Shift Dates');
     my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
     $r->print(<<ENDOVER);
@@ -3424,7 +3424,7 @@
     my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},
-    	text=>"Shifting Dates"});
+        text=>"Shifting Dates"});
     my $start_page=&Apache::loncommon::start_page('Shift Dates');
     my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
     $r->print(<<ENDOVER);
@@ -3444,33 +3444,33 @@
     my ($key) = @_;
     my %data;
     my ($middle,$part,$name)=
-	($key=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
+    ($key=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
     $data{'scope_type'} = 'all';
     if ($middle=~/^\[(.*)\]/) {
-       	$data{'scope'} = $1;
-	if ($data{'scope'}=~/^useropt\:($match_username)\:($match_domain)/) {
-	    $data{'scope_type'} = 'user';
-	    $data{'scope'} = [$1,$2];
-	} else {
-	    #FIXME check for group scope
-	    $data{'scope_type'} = 'section';
-	}
-	$middle=~s/^\[(.*)\]//;
+           $data{'scope'} = $1;
+    if ($data{'scope'}=~/^useropt\:($match_username)\:($match_domain)/) {
+        $data{'scope_type'} = 'user';
+        $data{'scope'} = [$1,$2];
+    } else {
+        #FIXME check for group scope
+        $data{'scope_type'} = 'section';
+    }
+    $middle=~s/^\[(.*)\]//;
     }
     $middle=~s/\.+$//;
     $middle=~s/^\.+//;
     $data{'realm_type'}='all';
     if ($middle=~/^(.+)\_\_\_\(all\)$/) {
-	$data{'realm'} = $1;
-	$data{'realm_type'} = 'folder';
-	$data{'realm_title'} = &Apache::lonnet::gettitle($data{'realm'});
-	($data{'realm_exists'}) = &Apache::lonnet::is_on_map($data{'realm'});
+    $data{'realm'} = $1;
+    $data{'realm_type'} = 'folder';
+    $data{'realm_title'} = &Apache::lonnet::gettitle($data{'realm'});
+    ($data{'realm_exists'}) = &Apache::lonnet::is_on_map($data{'realm'});
     } elsif ($middle) {
-	$data{'realm'} = $middle;
-	$data{'realm_type'} = 'symb';
-	$data{'realm_title'} = &Apache::lonnet::gettitle($data{'realm'});
-	my ($map,$resid,$url) = &Apache::lonnet::decode_symb($data{'realm'});
-	$data{'realm_exists'} = &Apache::lonnet::symbverify($data{'realm'},$url);
+    $data{'realm'} = $middle;
+    $data{'realm_type'} = 'symb';
+    $data{'realm_title'} = &Apache::lonnet::gettitle($data{'realm'});
+    my ($map,$resid,$url) = &Apache::lonnet::decode_symb($data{'realm'});
+    $data{'realm_exists'} = &Apache::lonnet::symbverify($data{'realm'},$url);
     }
 
     $data{'parameter_part'} = $part;
@@ -3621,77 +3621,77 @@
 
     my @menu =
         ( { categorytitle=>'Settings for this Course',
-	    items => [
-		  { linktext => 'Course Configuration',
-		    url => '/adm/courseprefs?origin=params',
-		    permission => $parm_permission,
-		    linktitle =>'Edit course configuration.'  ,
-		    icon => 'preferences-desktop-remote-desktop.png'  ,
-		    #help => 'Course_Environment',
-		    },
-		  { linktext => 'Portfolio Metadata',
-		    url => '/adm/parmset?action=setrestrictmeta',
-		    permission => $parm_permission,
-		    linktitle => 'Restrict metadata for this course.' ,
-		    icon =>'contact-new.png'   ,
-		    },
-		  { linktext => 'Manage Course Slots',
-		    url => '/adm/slotrequest?command=showslots',
-		    permission => $vgr,
-		    linktitle =>'Manage slots for this course.'  ,
-		    icon => 'format-justify-fill.png'  ,
-		    },
-		  { linktext => 'Reset Student Access Times',
-		    url => '/adm/helper/resettimes.helper',
-		    permission => $mgr,
-		    linktitle =>'Reset access times for folders/maps, resources or the course.'  ,
-		    icon => 'start-here.png'  ,
-		    },
-
-		  { linktext => 'Set Parameter Setting Default Actions',
-		    url => '/adm/parmset?action=setdefaults',
-		    permission => $parm_permission,
-		    linktitle =>'Set default actions for parameters.'  ,
-		    icon => 'folder-new.png'  ,
-		    }]},
-	  { categorytitle => 'New and Existing Parameter Settings for Resources',
-	    items => [
-		  { linktext => 'Edit Resource Parameters - Helper Mode',
-		    url => '/adm/helper/parameter.helper',
-		    permission => $parm_permission,
-		    linktitle =>'Set/Modify resource parameters in helper mode.'  ,
-		    icon => 'dialog-information.png'  ,
-		    #help => 'Parameter_Helper',
-		    },
-		  { linktext => 'Edit Resource Parameters - Overview Mode',
-		    url => '/adm/parmset?action=newoverview',
-		    permission => $parm_permission,
-		    linktitle =>'Set/Modify resource parameters in overview mode.'  ,
-		    icon => 'edit-find.png'  ,
-		    #help => 'Parameter_Overview',
-		    },
-		  { linktext => 'Edit Resource Parameters - Table Mode',
-		    url => '/adm/parmset?action=settable',
-		    permission => $parm_permission,
-		    linktitle =>'Set/Modify resource parameters in table mode.'  ,
-		    icon => 'edit-copy.png'  ,
-		    #help => 'Table_Mode',
-		    }]},
+        items => [
+          { linktext => 'Course Configuration',
+            url => '/adm/courseprefs?origin=params',
+            permission => $parm_permission,
+            linktitle =>'Edit course configuration.'  ,
+            icon => 'preferences-desktop-remote-desktop.png'  ,
+            #help => 'Course_Environment',
+            },
+          { linktext => 'Portfolio Metadata',
+            url => '/adm/parmset?action=setrestrictmeta',
+            permission => $parm_permission,
+            linktitle => 'Restrict metadata for this course.' ,
+            icon =>'contact-new.png'   ,
+            },
+          { linktext => 'Manage Course Slots',
+            url => '/adm/slotrequest?command=showslots',
+            permission => $vgr,
+            linktitle =>'Manage slots for this course.'  ,
+            icon => 'format-justify-fill.png'  ,
+            },
+          { linktext => 'Reset Student Access Times',
+            url => '/adm/helper/resettimes.helper',
+            permission => $mgr,
+            linktitle =>'Reset access times for folders/maps, resources or the course.'  ,
+            icon => 'start-here.png'  ,
+            },
+
+          { linktext => 'Set Parameter Setting Default Actions',
+            url => '/adm/parmset?action=setdefaults',
+            permission => $parm_permission,
+            linktitle =>'Set default actions for parameters.'  ,
+            icon => 'folder-new.png'  ,
+            }]},
+      { categorytitle => 'New and Existing Parameter Settings for Resources',
+        items => [
+          { linktext => 'Edit Resource Parameters - Helper Mode',
+            url => '/adm/helper/parameter.helper',
+            permission => $parm_permission,
+            linktitle =>'Set/Modify resource parameters in helper mode.'  ,
+            icon => 'dialog-information.png'  ,
+            #help => 'Parameter_Helper',
+            },
+          { linktext => 'Edit Resource Parameters - Overview Mode',
+            url => '/adm/parmset?action=newoverview',
+            permission => $parm_permission,
+            linktitle =>'Set/Modify resource parameters in overview mode.'  ,
+            icon => 'edit-find.png'  ,
+            #help => 'Parameter_Overview',
+            },
+          { linktext => 'Edit Resource Parameters - Table Mode',
+            url => '/adm/parmset?action=settable',
+            permission => $parm_permission,
+            linktitle =>'Set/Modify resource parameters in table mode.'  ,
+            icon => 'edit-copy.png'  ,
+            #help => 'Table_Mode',
+            }]},
            { categorytitle => 'Existing Parameter Settings for Resources',
-	     items => [
-		  { linktext => 'Modify Resource Parameters - Overview Mode',
-		    url => '/adm/parmset?action=setoverview',
-		    permission => $parm_permission,
-		    linktitle =>'Set/Modify existing resource parameters in overview mode.'  ,
-		    icon => 'preferences-desktop-wallpaper.png'  ,
-		    #help => 'Parameter_Overview',
-		    },
-		  { linktext => 'Change Log',
-		    url => '/adm/parmset?action=parameterchangelog',
-		    permission => $parm_permission,
-		    linktitle =>'View parameter and course blog posting/user notification change log.'  ,
-		    icon => 'emblem-system.png'   ,
-		    }]}
+         items => [
+          { linktext => 'Modify Resource Parameters - Overview Mode',
+            url => '/adm/parmset?action=setoverview',
+            permission => $parm_permission,
+            linktitle =>'Set/Modify existing resource parameters in overview mode.'  ,
+            icon => 'preferences-desktop-wallpaper.png'  ,
+            #help => 'Parameter_Overview',
+            },
+          { linktext => 'Change Log',
+            url => '/adm/parmset?action=parameterchangelog',
+            permission => $parm_permission,
+            linktitle =>'View parameter and course blog posting/user notification change log.'  ,
+            icon => 'emblem-system.png'   ,
+            }]}
           );
     $r->print(&Apache::lonhtmlcommon::generate_menu(@menu));
     return;
@@ -3712,7 +3712,7 @@
         my @options= ( ['active', 'Show to student'],
                     ['stuadd', 'Provide text area for students to type metadata'],
                     ['choices','Provide choices for students to select from']);
-#		   ['onlyone','Student may select only one choice']);
+#           ['onlyone','Student may select only one choice']);
         if ($added_flag) {
             push @options,['deleted', 'Delete Metadata Field'];
         }
@@ -3720,14 +3720,14 @@
         $output .= '<td><strong>'.$field_text.':</strong></td>';
         $output .= &Apache::loncommon::end_data_table_row();
         foreach my $opt (@options) {
-	    my $checked = ($options =~ m/$opt->[0]/) ? ' checked="checked" ' : '' ;
-	    $output .= &Apache::loncommon::continue_data_table_row();
-	    $output .= '<td>'.('&nbsp;' x 5).'<label>
-	               <input type="checkbox" name="'.
-	               $field_name.'_'.$opt->[0].'" value="yes"'.$checked.' />'.
-	               &mt($opt->[1]).'</label></td>';
-	    $output .= &Apache::loncommon::end_data_table_row();
-	}
+        my $checked = ($options =~ m/$opt->[0]/) ? ' checked="checked" ' : '' ;
+        $output .= &Apache::loncommon::continue_data_table_row();
+        $output .= '<td>'.('&nbsp;' x 5).'<label>
+                   <input type="checkbox" name="'.
+                   $field_name.'_'.$opt->[0].'" value="yes"'.$checked.' />'.
+                   &mt($opt->[1]).'</label></td>';
+        $output .= &Apache::loncommon::end_data_table_row();
+    }
         $output .= &Apache::loncommon::continue_data_table_row();
         $output .= '<td>'.('&nbsp;' x 10).'<input name="'.$field_name.'_values" type="text" value="'.$values.'" size="80" /></td>';
         $output .= &Apache::loncommon::end_data_table_row();
@@ -3740,16 +3740,16 @@
             $multiple_checked = ' checked="checked"';
             $single_checked = '';
         }
-	$output .= &Apache::loncommon::continue_data_table_row();
-	$output .= '<td>'.('&nbsp;' x 10).'
-	            <input type="radio" name="'.$field_name.'_onlyone" value="multiple"'.$multiple_checked .' />
-	            '.&mt('Student may select multiple choices from list').'</td>';
-	$output .= &Apache::loncommon::end_data_table_row();
-	$output .= &Apache::loncommon::continue_data_table_row();
-	$output .= '<td>'.('&nbsp;' x 10).'
-	            <input type="radio" name="'.$field_name.'_onlyone"  value="single"'.$single_checked.' />
-	            '.&mt('Student may select only one choice from list').'</td>';
-	$output .= &Apache::loncommon::end_data_table_row();
+    $output .= &Apache::loncommon::continue_data_table_row();
+    $output .= '<td>'.('&nbsp;' x 10).'
+                <input type="radio" name="'.$field_name.'_onlyone" value="multiple"'.$multiple_checked .' />
+                '.&mt('Student may select multiple choices from list').'</td>';
+    $output .= &Apache::loncommon::end_data_table_row();
+    $output .= &Apache::loncommon::continue_data_table_row();
+    $output .= '<td>'.('&nbsp;' x 10).'
+                <input type="radio" name="'.$field_name.'_onlyone"  value="single"'.$single_checked.' />
+                '.&mt('Student may select only one choice from list').'</td>';
+    $output .= &Apache::loncommon::end_data_table_row();
     }
     return ($output);
 }
@@ -3763,7 +3763,7 @@
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
     $r->print(&Apache::loncommon::start_page('Order Metadata Fields'));
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata',
-    	text=>"Add Metadata Field"});
+        text=>"Add Metadata Field"});
     &Apache::lonhtmlcommon::add_breadcrumb
             ({href=>"/adm/parmset?action=setrestrictmeta",
               text=>"Restrict Metadata"},
@@ -3778,32 +3778,32 @@
         if ($newpos > $currentpos) {
         # moving stuff up
             for ($i=0;$i<$currentpos;$i++) {
-        	$neworder[$i]=$oldorder[$i];
+            $neworder[$i]=$oldorder[$i];
             }
             for ($i=$currentpos;$i<$newpos;$i++) {
-        	$neworder[$i]=$oldorder[$i+1];
+            $neworder[$i]=$oldorder[$i+1];
             }
             $neworder[$newpos]=$oldorder[$currentpos];
             for ($i=$newpos+1;$i<=$#oldorder;$i++) {
-        	$neworder[$i]=$oldorder[$i];
+            $neworder[$i]=$oldorder[$i];
             }
         } else {
         # moving stuff down
-    	    for ($i=0;$i<$newpos;$i++) {
-    	        $neworder[$i]=$oldorder[$i];
-    	    }
-    	    $neworder[$newpos]=$oldorder[$currentpos];
-    	    for ($i=$newpos+1;$i<$currentpos+1;$i++) {
-    	        $neworder[$i]=$oldorder[$i-1];
-    	    }
-    	    for ($i=$currentpos+1;$i<=$#oldorder;$i++) {
-    	        $neworder[$i]=$oldorder[$i];
-    	    }
+            for ($i=0;$i<$newpos;$i++) {
+                $neworder[$i]=$oldorder[$i];
+            }
+            $neworder[$newpos]=$oldorder[$currentpos];
+            for ($i=$newpos+1;$i<$currentpos+1;$i++) {
+                $neworder[$i]=$oldorder[$i-1];
+            }
+            for ($i=$currentpos+1;$i<=$#oldorder;$i++) {
+                $neworder[$i]=$oldorder[$i];
+            }
         }
-	my $ordered_fields = join ",", @neworder;
+    my $ordered_fields = join ",", @neworder;
         my $put_result = &Apache::lonnet::put('environment',
                            {'metadata.addedorder'=>$ordered_fields},$dom,$crs);
-	&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.metadata.addedorder' => $ordered_fields});
+    &Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.metadata.addedorder' => $ordered_fields});
     }
     my $fields = &get_added_meta_fieldnames($env{'request.course.id'});
     my $ordered_fields;
@@ -3854,7 +3854,7 @@
 sub addmetafield {
     my ($r)=@_;
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata',
-    	text=>"Add Metadata Field"});
+        text=>"Add Metadata Field"});
     $r->print(&Apache::loncommon::start_page('Add Metadata Field'));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs('Add Metadata Field'));
     my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
@@ -3909,7 +3909,7 @@
     my $item_num;
     my $put_result;
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setrestrictmeta',
-    	text=>"Restrict Metadata"});
+        text=>"Restrict Metadata"});
     $r->print(&Apache::loncommon::start_page('Restrict Metadata'));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs('Restrict Metadata'));
     my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
@@ -3924,21 +3924,21 @@
                 my $meta_key = $2;
                 if ($save_field ne $meta_field) {
                     $save_field = $meta_field;
-            	    if ($env{'form.'.$meta_field.'_stuadd'}) {
-            	        $options.='stuadd,';
-            	    }
-            	    if ($env{'form.'.$meta_field.'_choices'}) {
-            	        $options.='choices,';
-            	    }
-            	    if ($env{'form.'.$meta_field.'_onlyone'} eq 'single') {
-            	        $options.='onlyone,';
-            	    }
-            	    if ($env{'form.'.$meta_field.'_active'}) {
-            	        $options.='active,';
-            	    }
-            	    if ($env{'form.'.$meta_field.'_deleted'}) {
-            	        $options.='deleted,';
-            	    }
+                    if ($env{'form.'.$meta_field.'_stuadd'}) {
+                        $options.='stuadd,';
+                    }
+                    if ($env{'form.'.$meta_field.'_choices'}) {
+                        $options.='choices,';
+                    }
+                    if ($env{'form.'.$meta_field.'_onlyone'} eq 'single') {
+                        $options.='onlyone,';
+                    }
+                    if ($env{'form.'.$meta_field.'_active'}) {
+                        $options.='active,';
+                    }
+                    if ($env{'form.'.$meta_field.'_deleted'}) {
+                        $options.='deleted,';
+                    }
                     my $name = $save_field;
                      $put_result = &Apache::lonnet::put('environment',
                                                   {'metadata.'.$meta_field.'.options'=>$options,
@@ -3949,7 +3949,7 @@
         }
     }
     &Apache::lonnet::coursedescription($env{'request.course.id'},
-				       {'freshen_cache' => 1});
+                       {'freshen_cache' => 1});
     # Get the default metadata fields
     my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio');
     # Now get possible added metadata fields
@@ -3959,8 +3959,8 @@
     foreach my $field (sort(keys(%metadata_fields))) {
         if ($field ne 'courserestricted') {
             $row_alt = $row_alt ? 0 : 1;
-	    $output.= &output_row($r, $field, $metadata_fields{$field});
-	}
+        $output.= &output_row($r, $field, $metadata_fields{$field});
+    }
     }
     my $buttons = (<<ENDButtons);
         <input type="submit" name="restrictmeta" value="Save" />
@@ -4023,9 +4023,9 @@
     my ($r) = @_;
 
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setdefaults',
-    	text=>"Set Defaults"});
+        text=>"Set Defaults"});
     my $start_page =
-	&Apache::loncommon::start_page('Parameter Setting Default Actions');
+    &Apache::loncommon::start_page('Parameter Setting Default Actions');
     my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults');
     $r->print(<<ENDDEFHEAD);
 $start_page
@@ -4049,135 +4049,135 @@
     my %defkeytype=();
 
     &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps,
-				\%mapp, \%symbp,\%maptitles,\%uris,
-				\%keyorder,\%defkeytype);
+                \%mapp, \%symbp,\%maptitles,\%uris,
+                \%keyorder,\%defkeytype);
     if ($env{'form.storerules'}) {
-	my %newrules=();
-	my @delrules=();
-	my %triggers=();
-	foreach my $key (keys(%env)) {
+    my %newrules=();
+    my @delrules=();
+    my %triggers=();
+    foreach my $key (keys(%env)) {
             if ($key=~/^form\.(\w+)\_action$/) {
-		my $tempkey=$1;
-		my $action=$env{$key};
+        my $tempkey=$1;
+        my $action=$env{$key};
                 if ($action) {
-		    $newrules{$tempkey.'_action'}=$action;
-		    if ($action ne 'default') {
-			my ($whichaction,$whichparm)=($action=~/^(.*\_)([^\_]+)$/);
-			$triggers{$whichparm}.=$tempkey.':';
-		    }
-		    $newrules{$tempkey.'_type'}=$defkeytype{$tempkey};
-		    if (&isdateparm($defkeytype{$tempkey})) {
-			$newrules{$tempkey.'_days'}=$env{'form.'.$tempkey.'_days'};
-			$newrules{$tempkey.'_hours'}=$env{'form.'.$tempkey.'_hours'};
-			$newrules{$tempkey.'_min'}=$env{'form.'.$tempkey.'_min'};
-			$newrules{$tempkey.'_sec'}=$env{'form.'.$tempkey.'_sec'};
-		    } else {
-			$newrules{$tempkey.'_value'}=$env{'form.'.$tempkey.'_value'};
-			$newrules{$tempkey.'_triggervalue'}=$env{'form.'.$tempkey.'_triggervalue'};
-		    }
-		} else {
-		    push(@delrules,$tempkey.'_action');
-		    push(@delrules,$tempkey.'_type');
-		    push(@delrules,$tempkey.'_hours');
-		    push(@delrules,$tempkey.'_min');
-		    push(@delrules,$tempkey.'_sec');
-		    push(@delrules,$tempkey.'_value');
-		}
-	    }
-	}
-	foreach my $key (keys %allparms) {
-	    $newrules{$key.'_triggers'}=$triggers{$key};
-	}
-	&Apache::lonnet::put('parmdefactions',\%newrules,$dom,$crs);
-	&Apache::lonnet::del('parmdefactions',\@delrules,$dom,$crs);
-	&resetrulescache();
+            $newrules{$tempkey.'_action'}=$action;
+            if ($action ne 'default') {
+            my ($whichaction,$whichparm)=($action=~/^(.*\_)([^\_]+)$/);
+            $triggers{$whichparm}.=$tempkey.':';
+            }
+            $newrules{$tempkey.'_type'}=$defkeytype{$tempkey};
+            if (&isdateparm($defkeytype{$tempkey})) {
+            $newrules{$tempkey.'_days'}=$env{'form.'.$tempkey.'_days'};
+            $newrules{$tempkey.'_hours'}=$env{'form.'.$tempkey.'_hours'};
+            $newrules{$tempkey.'_min'}=$env{'form.'.$tempkey.'_min'};
+            $newrules{$tempkey.'_sec'}=$env{'form.'.$tempkey.'_sec'};
+            } else {
+            $newrules{$tempkey.'_value'}=$env{'form.'.$tempkey.'_value'};
+            $newrules{$tempkey.'_triggervalue'}=$env{'form.'.$tempkey.'_triggervalue'};
+            }
+        } else {
+            push(@delrules,$tempkey.'_action');
+            push(@delrules,$tempkey.'_type');
+            push(@delrules,$tempkey.'_hours');
+            push(@delrules,$tempkey.'_min');
+            push(@delrules,$tempkey.'_sec');
+            push(@delrules,$tempkey.'_value');
+        }
+        }
+    }
+    foreach my $key (keys %allparms) {
+        $newrules{$key.'_triggers'}=$triggers{$key};
+    }
+    &Apache::lonnet::put('parmdefactions',\%newrules,$dom,$crs);
+    &Apache::lonnet::del('parmdefactions',\@delrules,$dom,$crs);
+    &resetrulescache();
     }
     my %lt=&Apache::lonlocal::texthash('days' => 'Days',
-				       'hours' => 'Hours',
-				       'min' => 'Minutes',
-				       'sec' => 'Seconds',
-				       'yes' => 'Yes',
-				       'no' => 'No');
+                       'hours' => 'Hours',
+                       'min' => 'Minutes',
+                       'sec' => 'Seconds',
+                       'yes' => 'Yes',
+                       'no' => 'No');
     my @standardoptions=('','default');
     my @standarddisplay=('',&mt('Default value when manually setting'));
     my @dateoptions=('','default');
     my @datedisplay=('',&mt('Default value when manually setting'));
     foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) {
-	unless ($tempkey) { next; }
-	push @standardoptions,'when_setting_'.$tempkey;
-	push @standarddisplay,&mt('Automatically set when setting ').$tempkey;
-	if (&isdateparm($defkeytype{$tempkey})) {
-	    push @dateoptions,'later_than_'.$tempkey;
-	    push @datedisplay,&mt('Automatically set later than ').$tempkey;
-	    push @dateoptions,'earlier_than_'.$tempkey;
-	    push @datedisplay,&mt('Automatically set earlier than ').$tempkey;
-	}
+    unless ($tempkey) { next; }
+    push @standardoptions,'when_setting_'.$tempkey;
+    push @standarddisplay,&mt('Automatically set when setting ').$tempkey;
+    if (&isdateparm($defkeytype{$tempkey})) {
+        push @dateoptions,'later_than_'.$tempkey;
+        push @datedisplay,&mt('Automatically set later than ').$tempkey;
+        push @dateoptions,'earlier_than_'.$tempkey;
+        push @datedisplay,&mt('Automatically set earlier than ').$tempkey;
+    }
     }
 $r->print(&mt('Manual setting rules apply to all interfaces.').'<br />'.
-	  &mt('Automatic setting rules apply to table mode interfaces only.'));
+      &mt('Automatic setting rules apply to table mode interfaces only.'));
     $r->print("\n".&Apache::loncommon::start_data_table().
-	      &Apache::loncommon::start_data_table_header_row().
-	      "<th>".&mt('Rule for parameter').'</th><th>'.
-	      &mt('Action').'</th><th>'.&mt('Value').'</th>'.
-	      &Apache::loncommon::end_data_table_header_row());
+          &Apache::loncommon::start_data_table_header_row().
+          "<th>".&mt('Rule for parameter').'</th><th>'.
+          &mt('Action').'</th><th>'.&mt('Value').'</th>'.
+          &Apache::loncommon::end_data_table_header_row());
     foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) {
-	unless ($tempkey) { next; }
-	$r->print("\n".&Apache::loncommon::start_data_table_row().
-		  "<td>".$allparms{$tempkey}."\n<br />(".$tempkey.')</td><td>');
-	my $action=&rulescache($tempkey.'_action');
-	$r->print('<select name="'.$tempkey.'_action">');
-	if (&isdateparm($defkeytype{$tempkey})) {
-	    for (my $i=0;$i<=$#dateoptions;$i++) {
-		if ($dateoptions[$i]=~/\_$tempkey$/) { next; }
-		$r->print("\n<option value='$dateoptions[$i]'".
-			  ($dateoptions[$i] eq $action?' selected="selected"':'').
-			  ">$datedisplay[$i]</option>");
-	    }
-	} else {
-	    for (my $i=0;$i<=$#standardoptions;$i++) {
-		if ($standardoptions[$i]=~/\_$tempkey$/) { next; }
-		$r->print("\n<option value='$standardoptions[$i]'".
-			  ($standardoptions[$i] eq $action?' selected="selected"':'').
-			  ">$standarddisplay[$i]</option>");
-	    }
-	}
-	$r->print('</select>');
-	unless (&isdateparm($defkeytype{$tempkey})) {
-	    $r->print("\n<br />".&mt('Triggering value(s) of other parameter (optional, comma-separated):').
-		      '<input type="text" size="20" name="'.$tempkey.'_triggervalue" value="'.&rulescache($tempkey.'_triggervalue').'" />');
-	}
-	$r->print("\n</td><td>\n");
+    unless ($tempkey) { next; }
+    $r->print("\n".&Apache::loncommon::start_data_table_row().
+          "<td>".$allparms{$tempkey}."\n<br />(".$tempkey.')</td><td>');
+    my $action=&rulescache($tempkey.'_action');
+    $r->print('<select name="'.$tempkey.'_action">');
+    if (&isdateparm($defkeytype{$tempkey})) {
+        for (my $i=0;$i<=$#dateoptions;$i++) {
+        if ($dateoptions[$i]=~/\_$tempkey$/) { next; }
+        $r->print("\n<option value='$dateoptions[$i]'".
+              ($dateoptions[$i] eq $action?' selected="selected"':'').
+              ">$datedisplay[$i]</option>");
+        }
+    } else {
+        for (my $i=0;$i<=$#standardoptions;$i++) {
+        if ($standardoptions[$i]=~/\_$tempkey$/) { next; }
+        $r->print("\n<option value='$standardoptions[$i]'".
+              ($standardoptions[$i] eq $action?' selected="selected"':'').
+              ">$standarddisplay[$i]</option>");
+        }
+    }
+    $r->print('</select>');
+    unless (&isdateparm($defkeytype{$tempkey})) {
+        $r->print("\n<br />".&mt('Triggering value(s) of other parameter (optional, comma-separated):').
+              '<input type="text" size="20" name="'.$tempkey.'_triggervalue" value="'.&rulescache($tempkey.'_triggervalue').'" />');
+    }
+    $r->print("\n</td><td>\n");
 
         if (&isdateparm($defkeytype{$tempkey})) {
-	    my $days=&rulescache($tempkey.'_days');
-	    my $hours=&rulescache($tempkey.'_hours');
-	    my $min=&rulescache($tempkey.'_min');
-	    my $sec=&rulescache($tempkey.'_sec');
-	    $r->print(<<ENDINPUTDATE);
+        my $days=&rulescache($tempkey.'_days');
+        my $hours=&rulescache($tempkey.'_hours');
+        my $min=&rulescache($tempkey.'_min');
+        my $sec=&rulescache($tempkey.'_sec');
+        $r->print(<<ENDINPUTDATE);
 <input name="$tempkey\_days" type="text" size="4" value="$days" />$lt{'days'}<br />
 <input name="$tempkey\_hours" type="text" size="4" value="$hours" />$lt{'hours'}<br />
 <input name="$tempkey\_min" type="text" size="4" value="$min" />$lt{'min'}<br />
 <input name="$tempkey\_sec" type="text" size="4" value="$sec" />$lt{'sec'}
 ENDINPUTDATE
-	} elsif ($defkeytype{$tempkey} eq 'string_yesno') {
+    } elsif ($defkeytype{$tempkey} eq 'string_yesno') {
             my $yeschecked='';
             my $nochecked='';
             if (&rulescache($tempkey.'_value') eq 'yes') { $yeschecked=' checked="checked"'; }
             if (&rulescache($tempkey.'_value') eq 'no') { $nochecked=' checked="checked"'; }
 
-	    $r->print(<<ENDYESNO);
+        $r->print(<<ENDYESNO);
 <label><input type="radio" name="$tempkey\_value" value="yes"$yeschecked /> $lt{'yes'}</label><br />
 <label><input type="radio" name="$tempkey\_value" value="no"$nochecked /> $lt{'no'}</label>
 ENDYESNO
         } else {
-	    $r->print('<input type="text" size="20" name="'.$tempkey.'_value" value="'.&rulescache($tempkey.'_value').'" />');
-	}
+        $r->print('<input type="text" size="20" name="'.$tempkey.'_value" value="'.&rulescache($tempkey.'_value').'" />');
+    }
         $r->print('</td>'.&Apache::loncommon::end_data_table_row());
     }
     $r->print(&Apache::loncommon::end_data_table().
-	      "\n".'<input type="submit" name="storerules" value="'.
-	      &mt('Save').'" /></form>'."\n".
-	      &Apache::loncommon::end_page());
+          "\n".'<input type="submit" name="storerules" value="'.
+          &mt('Save').'" /></form>'."\n".
+          &Apache::loncommon::end_page());
     return;
 }
 
@@ -4185,38 +4185,38 @@
     my ($key,$uname,$udom,$exeuser,$exedomain,$typeflag)=@_;
 
     if ($typeflag) {
-	$key=~s/\.type$//;
+    $key=~s/\.type$//;
     }
 
     my ($middle,$part,$name)=
-	($key=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
+    ($key=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
     my $issection;
 
     my $section=&mt('All Students');
     if ($middle=~/^\[(.*)\]/) {
-	$issection=$1;
-	$section=&mt('Group/Section').': '.$issection;
-	$middle=~s/^\[(.*)\]//;
+    $issection=$1;
+    $section=&mt('Group/Section').': '.$issection;
+    $middle=~s/^\[(.*)\]//;
     }
     $middle=~s/\.+$//;
     $middle=~s/^\.+//;
     if ($uname) {
-	$section=&mt('User').": ".&Apache::loncommon::plainname($uname,$udom);
-	$issection='';
+    $section=&mt('User').": ".&Apache::loncommon::plainname($uname,$udom);
+    $issection='';
     }
     my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>';
     my $realmdescription=&mt('all resources');
     if ($middle=~/^(.+)\_\_\_\(all\)$/) {
-	$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <span class="LC_parm_folder"><br />('.$1.')</span></span>';
- 	$realmdescription=&mt('folder').' '.&Apache::lonnet::gettitle($1);
+    $realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <span class="LC_parm_folder"><br />('.$1.')</span></span>';
+     $realmdescription=&mt('folder').' '.&Apache::lonnet::gettitle($1);
    } elsif ($middle) {
-	my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle);
-	$realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>';
-	$realmdescription=&mt('resource').' '.&Apache::lonnet::gettitle($middle);
+    my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle);
+    $realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>';
+    $realmdescription=&mt('resource').' '.&Apache::lonnet::gettitle($middle);
     }
     my $what=$part.'.'.$name;
     return ($realm,$section,$name,$part,
-	    $what,$middle,$uname,$udom,$issection,$realmdescription);
+        $what,$middle,$uname,$udom,$issection,$realmdescription);
 }
 
 my %standard_parms;
@@ -4225,12 +4225,12 @@
 sub load_parameter_names {
     open(my $config,"<$Apache::lonnet::perlvar{'lonTabDir'}/packages.tab");
     while (my $configline=<$config>) {
-	if ($configline !~ /\S/ || $configline=~/^\#/) { next; }
-	chomp($configline);
-	my ($short,$plain)=split(/:/,$configline);
-	my (undef,$name,$type)=split(/\&/,$short,3);
-	if ($type eq 'display') {
-	    $standard_parms{$name} = $plain;
+    if ($configline !~ /\S/ || $configline=~/^\#/) { next; }
+    chomp($configline);
+    my ($short,$plain)=split(/:/,$configline);
+    my (undef,$name,$type)=split(/\&/,$short,3);
+    if ($type eq 'display') {
+        $standard_parms{$name} = $plain;
         } elsif ($type eq 'type') {
             $standard_parms_types{$name} = $plain;
         }
@@ -4243,12 +4243,12 @@
 sub standard_parameter_names {
     my ($name)=@_;
     if (!%standard_parms) {
-	&load_parameter_names();
+    &load_parameter_names();
     }
     if ($standard_parms{$name}) {
-	return $standard_parms{$name};
+    return $standard_parms{$name};
     } else {
-	return $name;
+    return $name;
     }
 }
 
@@ -4266,13 +4266,13 @@
 sub parm_change_log {
     my ($r)=@_;
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable',
-	text=>"Parameter Change Log"});
+    text=>"Parameter Change Log"});
     $r->print(&Apache::loncommon::start_page('Parameter Change Log'));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Change Log'));
 
     my %parmlog=&Apache::lonnet::dump('nohist_parameterlog',
-				      $env{'course.'.$env{'request.course.id'}.'.domain'},
-				      $env{'course.'.$env{'request.course.id'}.'.num'});
+                      $env{'course.'.$env{'request.course.id'}.'.domain'},
+                      $env{'course.'.$env{'request.course.id'}.'.num'});
 
     if ((keys(%parmlog))[0]=~/^error\:/) { undef(%parmlog); }
 
@@ -4286,94 +4286,94 @@
                                                 \%saveable_parameters);
     $r->print(&Apache::loncommon::display_filter().
               '<label>'.&Apache::lonhtmlcommon::checkbox('includetypes',$env{'form.includetypes'},'1').
-	      ' '.&mt('Include parameter types').'</label>'.
-	      '<input type="submit" value="'.&mt('Display').'" /></form>');
+          ' '.&mt('Include parameter types').'</label>'.
+          '<input type="submit" value="'.&mt('Display').'" /></form>');
 
     my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'},
-						     $env{'course.'.$env{'request.course.id'}.'.domain'});
+                             $env{'course.'.$env{'request.course.id'}.'.domain'});
     $r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row().
-	      '<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Extent').'</th><th>'.&mt('Users').'</th><th>'.
-	      &mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th><th>'.&mt('Announce').'</th>'.
-	      &Apache::loncommon::end_data_table_header_row());
+          '<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Extent').'</th><th>'.&mt('Users').'</th><th>'.
+          &mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th><th>'.&mt('Announce').'</th>'.
+          &Apache::loncommon::end_data_table_header_row());
     my $shown=0;
     my $folder='';
     if ($env{'form.displayfilter'} eq 'currentfolder') {
-	my $last='';
-	if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db',
-		&GDBM_READER(),0640)) {
-	    $last=$hash{'last_known'};
-	    untie(%hash);
-	}
-	if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); }
+    my $last='';
+    if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db',
+        &GDBM_READER(),0640)) {
+        $last=$hash{'last_known'};
+        untie(%hash);
+    }
+    if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); }
     }
     foreach my $id (sort
-		    {
-			if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) {
-			    return $parmlog{$b}{'exe_time'} <=>$parmlog{$a}{'exe_time'}
-			}
-			my $aid = (split('00000',$a))[-1];
-			my $bid = (split('00000',$b))[-1];
-			return $bid<=>$aid;
-		    } (keys(%parmlog))) {
+            {
+            if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) {
+                return $parmlog{$b}{'exe_time'} <=>$parmlog{$a}{'exe_time'}
+            }
+            my $aid = (split('00000',$a))[-1];
+            my $bid = (split('00000',$b))[-1];
+            return $bid<=>$aid;
+            } (keys(%parmlog))) {
         my @changes=keys(%{$parmlog{$id}{'logentry'}});
-	my $count = 0;
-	my $time =
-	    &Apache::lonlocal::locallocaltime($parmlog{$id}{'exe_time'});
-	my $plainname =
-	    &Apache::loncommon::plainname($parmlog{$id}{'exe_uname'},
-					  $parmlog{$id}{'exe_udom'});
-	my $about_me_link =
-	    &Apache::loncommon::aboutmewrapper($plainname,
-					       $parmlog{$id}{'exe_uname'},
-					       $parmlog{$id}{'exe_udom'});
-	my $send_msg_link='';
-	if ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'})
-	     || ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) {
-	    $send_msg_link ='<br />'.
-		&Apache::loncommon::messagewrapper(&mt('Send message'),
-						   $parmlog{$id}{'exe_uname'},
-						   $parmlog{$id}{'exe_udom'});
-	}
-	my $row_start=&Apache::loncommon::start_data_table_row();
-	my $makenewrow=0;
-	my %istype=();
-	my $output;
-	foreach my $changed (reverse(sort(@changes))) {
+    my $count = 0;
+    my $time =
+        &Apache::lonlocal::locallocaltime($parmlog{$id}{'exe_time'});
+    my $plainname =
+        &Apache::loncommon::plainname($parmlog{$id}{'exe_uname'},
+                      $parmlog{$id}{'exe_udom'});
+    my $about_me_link =
+        &Apache::loncommon::aboutmewrapper($plainname,
+                           $parmlog{$id}{'exe_uname'},
+                           $parmlog{$id}{'exe_udom'});
+    my $send_msg_link='';
+    if ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'})
+         || ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) {
+        $send_msg_link ='<br />'.
+        &Apache::loncommon::messagewrapper(&mt('Send message'),
+                           $parmlog{$id}{'exe_uname'},
+                           $parmlog{$id}{'exe_udom'});
+    }
+    my $row_start=&Apache::loncommon::start_data_table_row();
+    my $makenewrow=0;
+    my %istype=();
+    my $output;
+    foreach my $changed (reverse(sort(@changes))) {
             my $value=$parmlog{$id}{'logentry'}{$changed};
-	    my $typeflag = ($changed =~/\.type$/ &&
-			    !exists($parmlog{$id}{'logentry'}{$changed.'.type'}));
+        my $typeflag = ($changed =~/\.type$/ &&
+                !exists($parmlog{$id}{'logentry'}{$changed.'.type'}));
             my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)=
-		&components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag);
-	    if ($env{'form.displayfilter'} eq 'currentfolder') {
-		if ($folder) {
-		    if ($middle!~/^\Q$folder\E/) { next; }
-		}
-	    }
-	    if ($typeflag) {
-		$istype{$parmname}=$value;
-		if (!$env{'form.includetypes'}) { next; }
-	    }
-	    $count++;
-	    if ($makenewrow) {
-		$output .= $row_start;
-	    } else {
-		$makenewrow=1;
-	    }
+        &components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag);
+        if ($env{'form.displayfilter'} eq 'currentfolder') {
+        if ($folder) {
+            if ($middle!~/^\Q$folder\E/) { next; }
+        }
+        }
+        if ($typeflag) {
+        $istype{$parmname}=$value;
+        if (!$env{'form.includetypes'}) { next; }
+        }
+        $count++;
+        if ($makenewrow) {
+        $output .= $row_start;
+        } else {
+        $makenewrow=1;
+        }
             my $parmitem = &standard_parameter_names($parmname);
-	    $output .='<td>'.$realm.'</td><td>'.$section.'</td><td>'.
-		      &mt($parmitem).'</td><td>'.
-		      ($part?&mt('Part: [_1]',$part):&mt('All Parts')).'</td><td>';
-	    my $stillactive=0;
-	    if ($parmlog{$id}{'delflag'}) {
-		$output .= &mt('Deleted');
-	    } else {
-		if ($typeflag) {
+        $output .='<td>'.$realm.'</td><td>'.$section.'</td><td>'.
+              &mt($parmitem).'</td><td>'.
+              ($part?&mt('Part: [_1]',$part):&mt('All Parts')).'</td><td>';
+        my $stillactive=0;
+        if ($parmlog{$id}{'delflag'}) {
+        $output .= &mt('Deleted');
+        } else {
+        if ($typeflag) {
                     my $parmitem = &standard_parameter_names($value); 
                     $parmitem = &mt($parmitem);
-		    $output .= &mt('Type: [_1]',$parmitem);
-		} else {
-		    my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what),
-						      $uname,$udom,$issection,$issection,$courseopt);
+            $output .= &mt('Type: [_1]',$parmitem);
+        } else {
+            my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what),
+                              $uname,$udom,$issection,$issection,$courseopt);
                     my $showvalue = $value;
                     if ($istype{$parmname} eq '') {
                         my $type = &standard_parameter_types($parmname);
@@ -4384,57 +4384,57 @@
                             }
                         }
                     } else {
-		        if (&isdateparm($istype{$parmname})) {
-			    $showvalue = 
+                if (&isdateparm($istype{$parmname})) {
+                $showvalue = 
                                 &Apache::lonlocal::locallocaltime($value);
-		        }
+                }
                     }
                     $output .= $showvalue;
-		    if ($value ne $all[$level]) {
-			$output .= '<br /><span class="LC_warning">'.&mt('Not active anymore').'</span>';
-		    } else {
-			$stillactive=1;
-		    }
-		}
-	    }
-	    $output .= '</td><td>';
+            if ($value ne $all[$level]) {
+            $output .= '<br /><span class="LC_warning">'.&mt('Not active anymore').'</span>';
+            } else {
+            $stillactive=1;
+            }
+        }
+        }
+        $output .= '</td><td>';
             
-	    if ($stillactive) {
+        if ($stillactive) {
                 my $parmitem = &standard_parameter_names($parmname);
                 $parmitem = &mt($parmitem);
-		my $title=&mt('Changed [_1]',$parmitem);
+        my $title=&mt('Changed [_1]',$parmitem);
                 my $description=&mt('Changed [_1] for [_2] to [_3]',
                                     $parmitem,$realmdescription,
-				    (&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value));
-		if (($uname) && ($udom)) {
-		    $output .=
-			&Apache::loncommon::messagewrapper('Notify User',
-							   $uname,$udom,$title,
-							   $description);
-		} else {
-		    $output .=
-			&Apache::lonrss::course_blog_link($id,$title,
-							  $description);
-		}
-	    }
-	    $output .= '</td>'.&Apache::loncommon::end_data_table_row();
-	}
+                    (&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value));
+        if (($uname) && ($udom)) {
+            $output .=
+            &Apache::loncommon::messagewrapper('Notify User',
+                               $uname,$udom,$title,
+                               $description);
+        } else {
+            $output .=
+            &Apache::lonrss::course_blog_link($id,$title,
+                              $description);
+        }
+        }
+        $output .= '</td>'.&Apache::loncommon::end_data_table_row();
+    }
         if ($env{'form.displayfilter'} eq 'containing') {
-	    my $wholeentry=$about_me_link.':'.
-		$parmlog{$id}{'exe_uname'}.':'.$parmlog{$id}{'exe_udom'}.':'.
-		$output;
-	    if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; }
-	}
+        my $wholeentry=$about_me_link.':'.
+        $parmlog{$id}{'exe_uname'}.':'.$parmlog{$id}{'exe_udom'}.':'.
+        $output;
+        if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; }
+    }
         if ($count) {
-	    $r->print($row_start.'<td rowspan="'.$count.'">'.$time.'</td>
+        $r->print($row_start.'<td rowspan="'.$count.'">'.$time.'</td>
                        <td rowspan="'.$count.'">'.$about_me_link.
-		  '<br /><tt>'.$parmlog{$id}{'exe_uname'}.
-			          ':'.$parmlog{$id}{'exe_udom'}.'</tt>'.
-		  $send_msg_link.'</td>'.$output);
-	    $shown++;
-	}
-	if (!($env{'form.show'} eq &mt('all')
-	      || $shown<=$env{'form.show'})) { last; }
+          '<br /><tt>'.$parmlog{$id}{'exe_uname'}.
+                      ':'.$parmlog{$id}{'exe_udom'}.'</tt>'.
+          $send_msg_link.'</td>'.$output);
+        $shown++;
+    }
+    if (!($env{'form.show'} eq &mt('all')
+          || $shown<=$env{'form.show'})) { last; }
     }
     $r->print(&Apache::loncommon::end_data_table());
     $r->print(&Apache::loncommon::end_page());
@@ -4545,7 +4545,7 @@
     return OK if $r->header_only;
 
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
-					    ['action','state',
+                        ['action','state',
                                              'pres_marker',
                                              'pres_value',
                                              'pres_type',
@@ -4554,17 +4554,17 @@
 
     &Apache::lonhtmlcommon::clear_breadcrumbs();
     &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/parmset",
-					    text=>"Parameter Manager",
-					    faq=>10,
-					    bug=>'Instructor Interface',
+                        text=>"Parameter Manager",
+                        faq=>10,
+                        bug=>'Instructor Interface',
                                             help =>
                                             'Parameter_Manager,Course_Environment,Parameter_Helper,Parameter_Overview,Table_Mode'});
 
 # ----------------------------------------------------- Needs to be in a course
     my $parm_permission =
-	(&Apache::lonnet::allowed('opa',$env{'request.course.id'}) ||
-	 &Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'.
-				  $env{'request.course.sec'}));
+    (&Apache::lonnet::allowed('opa',$env{'request.course.id'}) ||
+     &Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'.
+                  $env{'request.course.sec'}));
     my $exists = &check_for_course_info();
 
     if ($env{'request.course.id'} &&  $parm_permission && $exists) {
@@ -4574,45 +4574,45 @@
         # Check first if coming from someone else headed directly for
         #  the table mode
         if ((($env{'form.command'} eq 'set') && ($env{'form.url'})
-	     && (!$env{'form.dis'})) || ($env{'form.symb'})) {
-	    &assessparms($r);
+         && (!$env{'form.dis'})) || ($env{'form.symb'})) {
+        &assessparms($r);
         } elsif (! exists($env{'form.action'})) {
             &print_main_menu($r,$parm_permission);
         } elsif ($env{'form.action'} eq 'setoverview') {
-	    &overview($r);
-	} elsif ($env{'form.action'} eq 'addmetadata') {
-	    &addmetafield($r);
-	} elsif ($env{'form.action'} eq 'ordermetadata') {
-	    &order_meta_fields($r);
+        &overview($r);
+    } elsif ($env{'form.action'} eq 'addmetadata') {
+        &addmetafield($r);
+    } elsif ($env{'form.action'} eq 'ordermetadata') {
+        &order_meta_fields($r);
         } elsif ($env{'form.action'} eq 'setrestrictmeta') {
-	    &setrestrictmeta($r);
+        &setrestrictmeta($r);
         } elsif ($env{'form.action'} eq 'newoverview') {
-	    &newoverview($r);
+        &newoverview($r);
         } elsif ($env{'form.action'} eq 'setdefaults') {
-	    &defaultsetter($r);
-	} elsif ($env{'form.action'} eq 'settable') {
-	    &assessparms($r);
+        &defaultsetter($r);
+    } elsif ($env{'form.action'} eq 'settable') {
+        &assessparms($r);
         } elsif ($env{'form.action'} eq 'parameterchangelog') {
-	    &parm_change_log($r);
+        &parm_change_log($r);
         } elsif ($env{'form.action'} eq 'cleanparameters') {
-	    &clean_parameters($r);
+        &clean_parameters($r);
         } elsif ($env{'form.action'} eq 'dateshift1') {
             &date_shift_one($r);
         } elsif ($env{'form.action'} eq 'dateshift2') {
             &date_shift_two($r);
-	} elsif ($env{'form.action'} eq 'categorizecourse') {
+    } elsif ($env{'form.action'} eq 'categorizecourse') {
             &assign_course_categories($r);
         }
     } else {
 # ----------------------------- Not in a course, or not allowed to modify parms
-	if ($exists) {
-	    $env{'user.error.msg'}=
-		"/adm/parmset:opa:0:0:Cannot modify assessment parameters";
-	} else {
-	    $env{'user.error.msg'}=
-		"/adm/parmset::0:1:Course environment gone, reinitialize the course";
-	}
-	return HTTP_NOT_ACCEPTABLE;
+    if ($exists) {
+        $env{'user.error.msg'}=
+        "/adm/parmset:opa:0:0:Cannot modify assessment parameters";
+    } else {
+        $env{'user.error.msg'}=
+        "/adm/parmset::0:1:Course environment gone, reinitialize the course";
+    }
+    return HTTP_NOT_ACCEPTABLE;
     }
     &reset_caches();
 

--amueller1256321784--