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

bisitz bisitz@source.lon-capa.org
Tue, 12 May 2009 10:54:11 -0000


This is a MIME encoded message

--bisitz1242125651
Content-Type: text/plain

bisitz		Tue May 12 10:54:11 2009 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  Tidy up script code: removed unneeded trailing blanks and tabs
  
  
--bisitz1242125651
Content-Type: text/plain
Content-Disposition: attachment; filename="bisitz-20090512105411.txt"

Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.445 loncom/interface/lonparmset.pm:1.446
--- loncom/interface/lonparmset.pm:1.445	Fri May  8 22:47:01 2009
+++ loncom/interface/lonparmset.pm	Tue May 12 10:54:11 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.445 2009/05/08 22:47:01 neumanie Exp $
+# $Id: lonparmset.pm,v 1.446 2009/05/12 10:54:11 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -366,7 +366,7 @@
     my $result='';
     my @outpar=();
 # ----------------------------------------------------- Cascading lookup scheme
-    my $map=(&Apache::lonnet::decode_symb($symb))[0];    
+    my $map=(&Apache::lonnet::decode_symb($symb))[0];
     $map = &Apache::lonnet::deversion($map);
 
     my $symbparm=$symb.'.'.$what;
@@ -468,7 +468,7 @@
 
 # --- Caches local to lonparmset
 
-    
+
 sub reset_caches {
     &resetparmhash();
     &resetsymbcache();
@@ -482,7 +482,7 @@
 	undef($parmhashid);
 	undef(%parmhash);
     }
-    
+
     sub cacheparmhash {
 	if ($parmhashid eq  $env{'request.course.fn'}) { return; }
 	my %parmhashfile;
@@ -493,7 +493,7 @@
 	    $parmhashid=$env{'request.course.fn'};
 	}
     }
- 
+
     sub parmhash {
 	my ($id) = @_;
 	&cacheparmhash();
@@ -501,14 +501,14 @@
     }
  }
 
-{   
+{
     my $symbsid;
     my %symbs;
     sub resetsymbcache {
 	undef($symbsid);
 	undef(%symbs);
     }
-    
+
     sub symbcache {
 	my $id=shift;
 	if ($symbsid ne $env{'request.course.id'}) {
@@ -529,14 +529,14 @@
     }
  }
 
-{   
+{
     my $rulesid;
     my %rules;
     sub resetrulescache {
 	undef($rulesid);
 	undef(%rules);
     }
-    
+
     sub rulescache {
 	my $id=shift;
 	if ($rulesid ne $env{'request.course.id'}
@@ -683,7 +683,7 @@
     my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup)=@_;
 # ---------------------------------------------------------- Construct prefixes
     $spnam=~s/\_([^\_]+)$/\.$1/;
-    my $map=(&Apache::lonnet::decode_symb($symb))[0];    
+    my $map=(&Apache::lonnet::decode_symb($symb))[0];
     $map = &Apache::lonnet::deversion($map);
 
     my $symbparm=$symb.'.'.$spnam;
@@ -696,11 +696,11 @@
     my $seclevel=$env{'request.course.id'}.'.['.$csec.'].'.$spnam;
     my $seclevelr=$env{'request.course.id'}.'.['.$csec.'].'.$symbparm;
     my $seclevelm=$env{'request.course.id'}.'.['.$csec.'].'.$mapparm;
-    
+
     my $courselevel=$env{'request.course.id'}.'.'.$spnam;
     my $courselevelr=$env{'request.course.id'}.'.'.$symbparm;
     my $courselevelm=$env{'request.course.id'}.'.'.$mapparm;
-    
+
     my $storeunder='';
     if (($snum==14) || ($snum==3)) { $storeunder=$courselevel; }
     if (($snum==13) || ($snum==2)) { $storeunder=$courselevelm; }
@@ -712,7 +712,7 @@
     if ($snum==5) { $storeunder=$grplevelm; }
     if ($snum==4) { $storeunder=$grplevelr; }
 
-    
+
     my $delete;
     if ($nval eq '') { $delete=1;}
     my %storecontent = ($storeunder         => $nval,
@@ -769,7 +769,7 @@
 	}
 	&Apache::lonnet::devalidateuserresdata($uname,$udom);
     }
-    
+
     if ($reply=~/^error\:(.*)/) {
 	return "<span class=\"LC_error\">Write Error: $1</span>";
     }
@@ -926,11 +926,11 @@
 	   text=>"Table Mode",
 	   help => 'Course_Setting_Parameters'});
     }
-    my $start_page = 
+    my $start_page =
 	&Apache::loncommon::start_page('Set/Modify Course Parameters',
 				       &page_js(),
 				       {'add_entries' => \%loaditems,});
-    my $breadcrumbs = 
+    my $breadcrumbs =
 	&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode');
     $r->print(<<ENDHEAD);
 $start_page
@@ -962,7 +962,7 @@
 # cascade down manually
     my $cascadetype=$$defaulttype{$which};
     for (my $i=14;$i>0;$i--) {
-	 if ($typeoutpar[$i]) { 
+	 if ($typeoutpar[$i]) {
             $cascadetype=$typeoutpar[$i];
 	} else {
             $typeoutpar[$i]=$cascadetype;
@@ -981,7 +981,7 @@
 	$parm.='<span class="LC_warning"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</span>';
     }
     $r->print('<td>'.$parm.'</td>');
-   
+
     my $thismarker=$which;
     $thismarker=~s/^parameter\_//;
     my $mprefix=$rid.'&'.$thismarker.'&';
@@ -995,9 +995,9 @@
         } elsif ($cgroup) {
             &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
         } elsif ($csec) {
-            &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); 
+            &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
         } else {
-            &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); 
+            &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
         }
     } elsif ($parmlev eq 'map') {
 
@@ -1034,7 +1034,7 @@
 	&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);
@@ -1046,7 +1046,7 @@
             &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
             &print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
         }
-     
+
 	if ($uname) {
             if ($othergrp) {
                 $r->print($othergrp);
@@ -1107,7 +1107,7 @@
                                                                    $courseopt);
     my $bgcolor = $defbg;
     my $grp_parm;
-    if (($coursereply) && ($cgroup ne $resultgroup)) { 
+    if (($coursereply) && ($cgroup ne $resultgroup)) {
         if ($result > 3) {
             $bgcolor = '#AAFFAA';
             $grp_parm = &valout($coursereply,$resulttype);
@@ -1221,14 +1221,14 @@
 	    }
 #
 # Put in order
-# 
+#
 	    unless ($$keyorder{$key}) {
 		$$keyorder{$key}=$keyordercnt;
 		$keyordercnt++;
 	    }
 	}
 
-	
+
 	if (!exists($$mapp{$mapid})) {
 	    $$mapp{$id}=
 		&Apache::lonnet::declutter($resource->enclosing_map_src());
@@ -1238,7 +1238,7 @@
 		$$maptitles{$mapid}=&mt('Main Course Documents');
 	    } else {
 		$$maptitles{$mapid}=
-		    &Apache::lonnet::gettitle($$mapp{$id});    
+		    &Apache::lonnet::gettitle($$mapp{$id});
 	    }
 	    $$maptitles{$$mapp{$id}}=$$maptitles{$mapid};
 	    $$symbp{$mapid}=$$mapp{$id}.'___(all)';
@@ -1296,7 +1296,7 @@
 	checkthis('contentopen','pscat');
  	checkthis('contentclose','pscat');
     }
- 
+
 
     function checkvisi() {
 	checkthis('hiddenresource','pscat');
@@ -1321,7 +1321,7 @@
 
 </script>
 ENDSCRIPT
-    $r->print();    
+    $r->print();
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View')));
     $r->print("\n".'<table id="LC_parm_overview_parm_menu"><tr>');
     my $cnt=0;
@@ -1383,8 +1383,8 @@
 }
 
 sub partmenu {
-    my ($r,$allparts,$psprt)=@_;    
-    
+    my ($r,$allparts,$psprt)=@_;
+
     $r->print('<select multiple="multiple" name="psprt" size="8">');
     $r->print('<option value="all"');
     $r->print(' selected="selected"') unless (@{$psprt});
@@ -1402,7 +1402,7 @@
 	    $r->print('>'.$$allparts{$tempkey}.'</option>');
 	}
     }
-    $r->print('</select>');    
+    $r->print('</select>');
 }
 
 sub usermenu {
@@ -1419,7 +1419,7 @@
 
     my $g_s_header='';
     my $g_s_footer='';
-    
+
     if (%sectionhash) {
         $sections=&mt('Section:').' <select name="csec"';
         if (%grouphash && $parmlev ne 'full') {
@@ -1459,7 +1459,7 @@
 }
 </script>
 |;
-    } 
+    }
 
     if (%grouphash) {
         $groups=&mt('Group:').' <select name="cgroup"';
@@ -1486,15 +1486,15 @@
     }
 
     if (%sectionhash || %grouphash) {
-        $r->print(&Apache::lonhtmlcommon::row_title(&mt('Group/Section')));       
-        $r->print($sections.$groups);        
+        $r->print(&Apache::lonhtmlcommon::row_title(&mt('Group/Section')));
+        $r->print($sections.$groups);
     }
-    
-    $r->print(&Apache::lonhtmlcommon::row_title(&mt('User')));             
+
+    $r->print(&Apache::lonhtmlcommon::row_title(&mt('User')));
     $r->print(&mt('For User [_1] or Student/Employee ID [_2] at Domain [_3]'
                  ,'<input type="text" value="'.$uname.'" size="12" name="uname" />'
                  ,'<input type="text" value="'.$id.'" size="12" name="id" /> '
-                 ,$chooseopt));  
+                 ,$chooseopt));
 }
 
 sub displaymenu {
@@ -1503,7 +1503,7 @@
     $r->print('<h2 class="LC_hcell">Step 2</h2>');
     $r->print('<div class="LC_BoxPadding">' );
     $r->print(&Apache::lonhtmlcommon::start_pick_box());
-    
+
     &parmmenu($r,$allparms,$pscat,$keyorder);
    $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));
     &partmenu($r,$allparts,$psprt);
@@ -1512,8 +1512,8 @@
 }
 
 sub mapmenu {
-    my ($r,$allmaps,$pschp,$maptitles)=@_; 
-   
+    my ($r,$allmaps,$pschp,$maptitles)=@_;
+
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder')));
     $r->print('<select name="pschp">');
     $r->print('<option value="all">'.&mt('All Maps or Folders').'</option>');
@@ -1523,22 +1523,22 @@
 	$r->print('>'.$$maptitles{$_}.($$allmaps{$_}!~/^uploaded/?' ['.$$allmaps{$_}.']':'').'</option>');
     }
     $r->print("</select>");
-   
+
 }
 
 sub levelmenu {
-    my ($r,$alllevs,$parmlev)=@_;    
-    
+    my ($r,$alllevs,$parmlev)=@_;
+
     $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(' selected="selected"');
 	}
 	$r->print('>'.&mt($_).'</option>');
     }
-    $r->print("</select>");    
+    $r->print("</select>");
 }
 
 
@@ -1674,7 +1674,7 @@
     my $csec;
     my $cgroup;
     my @usersgroups = ();
- 
+
     my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'};
 
     $alllevs{'Resource Level'}='full';
@@ -1711,7 +1711,7 @@
 
     my $pssymb='';
     my $parmlev='';
- 
+
     unless ($env{'form.parmlev'}) {
         $parmlev = 'map';
     } else {
@@ -1762,7 +1762,7 @@
         } 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' ".
@@ -1792,7 +1792,7 @@
     unless ($cgroup) { $cgroup=''; }
 
 # --------------------------------------------------------- Get all assessments
-    &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, 
+    &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps,
 				\%mapp, \%symbp,\%maptitles,\%uris,
 				\%keyorder);
 
@@ -1848,7 +1848,7 @@
     }
 #----------------------------------------------- if all selected, fill in array
     if ($pscat[0] eq "all") {@pscat = (keys %allparms);}
-    if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries') }; 
+    if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries') };
     if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);}
 # ------------------------------------------------------------------ Start page
 
@@ -1860,21 +1860,21 @@
 		  &HTML::Entities::encode($env{'form.recent_'.$_},'"&<>').
 		  '" name="recent_'.$_.'" />');
     }
-                        
+
     if (!$pssymb) {
-	
+
         $r->print('<div class="LC_ContentBoxSpecial">');
         $r->print('<h2 class="LC_hcell">Step 1</h2>');
         $r->print('<div class="LC_BoxPadding">' );
         $r->print(&Apache::lonhtmlcommon::start_pick_box());
-       
+
         &levelmenu($r,\%alllevs,$parmlev);
-       
-	if ($parmlev ne 'general') {           
-	    &mapmenu($r,\%allmaps,$pschp,\%maptitles);	    
+
+	if ($parmlev ne 'general') {
+	    &mapmenu($r,\%allmaps,$pschp,\%maptitles);
 	}
-           
-        $r->print(&Apache::lonhtmlcommon::end_pick_box());        
+
+        $r->print(&Apache::lonhtmlcommon::end_pick_box());
         $r->print('</div></div>');
 
 	&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder);
@@ -1891,7 +1891,7 @@
     $r->print('<div class="LC_BoxPadding">' );
     $r->print(&Apache::lonhtmlcommon::start_pick_box());
     &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups);
-   
+
     $r->print(&Apache::lonhtmlcommon::end_pick_box());
     $r->print('</div></div>');
 
@@ -1918,8 +1918,8 @@
            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>');
@@ -1995,7 +1995,7 @@
                 my $rid=$_;
                 my ($inmapid)=($rid=~/\.(\d+)$/);
 
-                if ((!$pssymb && 
+                if ((!$pssymb &&
 		     (($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid})))
 		    ||
 		    ($pssymb && $pssymb eq $symbp{$rid})) {
@@ -2100,7 +2100,7 @@
             my %maplist;
 
             if ($pschp eq 'all') {
-                %maplist = %allmaps; 
+                %maplist = %allmaps;
             } else {
                 %maplist = ($pschp => $mapp{$pschp});
             }
@@ -2120,11 +2120,11 @@
                 my $map = 0;
 
 #		$r->print("Catmarker: @catmarker<br />\n");
-               
+
                 foreach (@ids) {
                   ($map)=(/([\d]*?)\./);
                   my $rid = $_;
-        
+
 #                  $r->print("$mapid:$map:   $rid <br /> \n");
 
                   if ($map eq $mapid) {
@@ -2142,7 +2142,7 @@
                       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');
@@ -2165,7 +2165,7 @@
                     } # end loop through keys
                   }
                 } # end loop through ids
-                                 
+
 #---------------------------------------------------- print header information
                 my $foldermap=&mt($maptitle=~/^uploaded/?'Folder':'Map');
                 my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':'');
@@ -2228,10 +2228,10 @@
             my %display = ();
             my %type = ();
             my %default = ();
-               
+
             foreach (@ids) {
                 my $rid = $_;
-        
+
                 my $uri=&Apache::lonnet::declutter($uris{$rid});
 
 #--------------------------------------------------------------------
@@ -2266,7 +2266,7 @@
                   }
                 } # end loop through keys
             } # end loop through ids
-                                 
+
 #---------------------------------------------------- print header information
 	    my $setdef=&mt("Set Defaults for All Resources in Course");
             $r->print(<<ENDMAPONE);
@@ -2280,7 +2280,7 @@
             } else {
                 $r->print("<i><font color=\"red\"> ".&mt("ALL")."</i> ".&mt("USERS")."</font> \n");
             }
-            
+
             if ($csec) {$r->print(&mt("Section")."<font color=\"red\"> <i>$csec</i></font>\n")};
             if ($cgroup) {$r->print(&mt("Group")."<font color=\"red\"> <i>$cgroup</i></font>\n")};
             $r->print("</h4>\n");
@@ -2316,7 +2316,7 @@
 
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=crsenv',
 	text=>"Course Environment"});
-    my $breadcrumbs = 
+    my $breadcrumbs =
 	&Apache::lonhtmlcommon::breadcrumbs('Edit Course Environment');
     my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
@@ -2335,7 +2335,7 @@
         }
         if ($name =~ /^rolenames_([^_]+)$/) {
             $name = $1.'.plaintext';
-            my $standardtitle = 
+            my $standardtitle =
                 &Apache::lonnet::plaintext($1,$crstype,$env{'request.course.id'},1);
             my %adv_roles =
                 &Apache::lonnet::get_course_adv_roles($env{'request.course.id'},1);
@@ -2367,15 +2367,15 @@
         if ($name =~ /^spreadsheet_default_(classcalc|
                                             studentcalc|
                                             assesscalc)$/x) {
-            my $sheettype = $1; 
+            my $sheettype = $1;
             if ($sheettype eq 'classcalc') {
                 # no need to do anything since viewing the sheet will
-                # cause it to be updated. 
+                # cause it to be updated.
             } elsif ($sheettype eq 'studentcalc') {
                 # expire all the student spreadsheets
                 &Apache::lonnet::expirespread('','','studentcalc');
             } else {
-                # expire all the assessment spreadsheets 
+                # expire all the assessment spreadsheets
                 #    this includes non-default spreadsheets, but better to
                 #    be safe than sorry.
                 &Apache::lonnet::expirespread('','','assesscalc');
@@ -2448,7 +2448,7 @@
                     &change_clone($value,\@oldcloner);
                 }
                 # Update environment and nohist_courseids.db
-                if (($name eq 'description') || ($name eq 'cloners') || 
+                if (($name eq 'description') || ($name eq 'cloners') ||
                     ($name eq 'hidefromcat') || ($name eq 'categories')) {
                     if ($chome eq '') {
                         %crsinfo =
@@ -2460,7 +2460,7 @@
                 if ($name eq 'description' && defined($value)) {
                     &Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.description' => $value});
                     if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') {
-                        $crsinfo{$env{'request.course.id'}}{'description'} = $value; 
+                        $crsinfo{$env{'request.course.id'}}{'description'} = $value;
                         my $putresult =
                             &Apache::lonnet::courseidput($dom,\%crsinfo,
                                                          $chome,'notime');
@@ -2580,7 +2580,7 @@
                                  .'('.&mt('[_1]: student, [_2]: TA, [_3]: instructor','"<tt>st</tt>"','"<tt>ta</tt>"','"<tt>in</tt>"').')<br />'
                                  .'("<tt>'.&mt('role,role,...').'</tt>") '
 	                         .Apache::loncommon::help_open_topic("Course_Disable_Discussion"),
-             'plc.users.denied' => 
+             'plc.users.denied' =>
                           '<b>'.&mt('Disallow chat room use for Users').'</b><br />'.
                                   '("<tt>'.&mt('user:domain,user:domain,...').'</tt>")',
 
@@ -2588,20 +2588,20 @@
                                  .'('.&mt('[_1]: student, [_2]: TA, [_3]: instructor','"<tt>st</tt>"','"<tt>ta</tt>"','"<tt>in</tt>"')
                                  .'("<tt>'.&mt('role,role,...').'</tt>") '
                                  .Apache::loncommon::help_open_topic("Course_Disable_Discussion"),
-             'pch.users.denied' => 
+             'pch.users.denied' =>
                           '<b>'.&mt('Disallow Resource Discussion for Users').'</b><br />'.
                                  '("<tt>'.&mt('user:domain,user:domain,...').'</tt>")',
-             'spreadsheet_default_classcalc' 
+             'spreadsheet_default_classcalc'
                  => '<b>'.&mt('Default Course Spreadsheet').'</b> '.
                     '<a href="javascript:openbrowser'.
                     "('envform','spreadsheet_default_classcalc'".
                     ",'spreadsheet')\">$SelectSpreadsheetFile</a><br />",
-             'spreadsheet_default_studentcalc' 
+             'spreadsheet_default_studentcalc'
                  => '<b>'.&mt('Default Student Spreadsheet').'</b><br />'.
                     '<a href="javascript:openbrowser'.
                     "('envform','spreadsheet_default_calc'".
                     ",'spreadsheet')\">$SelectSpreadsheetFile</a><br />",
-             'spreadsheet_default_assesscalc' 
+             'spreadsheet_default_assesscalc'
                  => '<b>'.&mt('Default Assessment Spreadsheet').'</b> '.
                     '<a href="javascript:openbrowser'.
                     "('envform','spreadsheet_default_assesscalc'".
@@ -2629,10 +2629,10 @@
              'problem_stream_switch'
                  => '<b>'.&mt('Allow problems to be split over pages').'</b><br />'.
                     ' ('.&mt('[_1] if allowed, anything else if not','"<tt>yes</tt>"').')',
-             'default_paper_size' 
+             'default_paper_size'
                  => '<b>'.&mt('Default paper type').'</b><br />'.
-                    ' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'. 
-                    ' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. 
+                    ' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'.
+                    ' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'.
                     ' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])',
 	     'print_header_format'
 	         => ' <b>'.&mt('Print header format').'</b><br />'
@@ -2673,7 +2673,7 @@
              'categories'
                  => '<b>'.&mt('Categorize course').'</b> <a href="javascript:catsbrowser()">'.
                     &mt('Display Categories').'</a>',
-             'datelocale' 
+             'datelocale'
                  => '<b>'.&mt('Locale used for course calendar').'</b>',
              'rolenames'
                  => '<b>'.&mt('Replacement titles for standard course roles').'</b><br />'.
@@ -2755,7 +2755,7 @@
                         $catdisplay .= &unescape($name).'&';
                     }
                     $catdisplay =~ s/\&$//;
-                } 
+                }
                 $output .= '<td>'.
                            '<input type="hidden" name="categories_value" value="'.
                            $values{'categories'}.'" />'.
@@ -2915,7 +2915,7 @@
              .'<h2 class="LC_hcell">'.&mt('Course Parameter Overview').'</h2>'
              .'<ul>';
 foreach my $catkey (@Display_Order) {
-    if (!@{$parm_cat_parms{$catkey}}) { next; } # Only display non-empty categories 
+    if (!@{$parm_cat_parms{$catkey}}) { next; } # Only display non-empty categories
     $output_SB .= '<li>'
                  .'<a href="#parmlist_'.$catkey.'">'
                  .$parm_cat_names{$catkey}
@@ -2935,7 +2935,7 @@
 $output_SB .= '<h2>'.&mt('Course Parameters').'</h2>';
 
 foreach my $catkey (@Display_Order) {
-    if (!@{$parm_cat_parms{$catkey}}) { next; } # Only display non-empty categories 
+    if (!@{$parm_cat_parms{$catkey}}) { next; } # Only display non-empty categories
     $output_SB .= &Apache::loncommon::start_data_table();
     $output_SB .= &Apache::loncommon::start_data_table_empty_row()
                  .'<td colspan="3">'
@@ -2996,15 +2996,15 @@
     } else {
         catswin.focus();
     }
-} 
+}
 ENDSCRIPT
     }
     $jscript = '<script type="text/javascript" language="Javascript">'."\n".
                $browse_js."\n".$categorize_js."\n".'</script>';
-    my $start_page = 
+    my $start_page =
 	&Apache::loncommon::start_page('Set Course Environment',
 				       $jscript);
-    my $end_page = 
+    my $end_page =
 	&Apache::loncommon::end_page();
     $r->print(<<ENDENV);
 $start_page
@@ -3042,7 +3042,7 @@
     if (ref($domconf{'coursecategories'}) eq 'HASH') {
         $cathash = $domconf{'coursecategories'}{'cats'};
         if (ref($cathash) eq 'HASH') {
-            $hascats = 1;   
+            $hascats = 1;
         }
     }
     my $catwin_js;
@@ -3084,7 +3084,7 @@
 </script>
 ENDSCRIPT
     } else {
-        my $onload; 
+        my $onload;
     }
     my $start_page =
         &Apache::loncommon::start_page('Course Categories',$catwin_js,
@@ -3191,7 +3191,7 @@
 		    $typeof=$env{'form.typeof_'.$thiskey};
 		    $text = &mt('Saved modified date for');
 		}
-		if (defined($data) and $$olddata{$thiskey} ne $data) { 
+		if (defined($data) and $$olddata{$thiskey} ne $data) {
 		    if ($tuname) {
 			if (&Apache::lonnet::put('resourcedata',{$tkey=>$data,
 								 $tkey.'.type' => $typeof},
@@ -3206,8 +3206,8 @@
 			&Apache::lonnet::devalidateuserresdata($tuname,$tudom);
 		    } else {
 			$newdata{$thiskey}=$data;
- 			$newdata{$thiskey.'.type'}=$typeof; 
-                   } 
+ 			$newdata{$thiskey.'.type'}=$typeof;
+                   }
 		}
 	    } elsif ($cmd eq 'del') {
 		if ($tuname) {
@@ -3261,7 +3261,7 @@
     my ($key,$listdata) = @_;
     # split into student/section affected, and
     # the realm (folder/resource part and parameter
-    my ($student,$realm) = 
+    my ($student,$realm) =
 	($key=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)$/);
     # if course wide student would be undefined
     if (!defined($student)) {
@@ -3302,13 +3302,13 @@
 	if ($sortorder eq 'realmstudent') {
             if ($ares     ne $bres    ) {
 		$result = ($ares     cmp $bres);
-            } elsif ($astudent ne $bstudent) { 
+            } elsif ($astudent ne $bstudent) {
 		$result = ($astudent cmp $bstudent);
 	    } elsif ($apart    ne $bpart   ) {
 		$result = ($apart    cmp $bpart);
 	    }
 	} else {
-	    if      ($astudent ne $bstudent) { 
+	    if      ($astudent ne $bstudent) {
 		$result = ($astudent cmp $bstudent);
 	    } elsif ($ares     ne $bres    ) {
 		$result = ($ares     cmp $bres);
@@ -3316,7 +3316,7 @@
 		$result = ($apart    cmp $bpart);
 	    }
 	}
-	    
+
 	if (!$result) {
             if (defined($aparm) && defined($bparm)) {
 		$result = ($aparm <=> $bparm);
@@ -3466,7 +3466,7 @@
     return '<input type="text" name="set_'.$thiskey.'" value="'.$showval.'" />';
 }
 
-my %strings = 
+my %strings =
     (
      'string_yesno'
              => [[ 'yes', 'Yes' ],
@@ -3481,7 +3481,7 @@
 
 sub string_selector {
     my ($thistype, $thiskey, $showval) = @_;
-    
+
     if (!exists($strings{$thistype})) {
 	return &default_selector($thiskey,$showval);
     }
@@ -3574,7 +3574,7 @@
     my @psprt=&Apache::loncommon::get_env_multiple('form.psprt');
     if (!@psprt) { $psprt[0]='0'; }
 
-    my @selected_sections = 
+    my @selected_sections =
 	&Apache::loncommon::get_env_multiple('form.Section');
     @selected_sections = ('all') if (! @selected_sections);
     foreach my $sec (@selected_sections) {
@@ -3587,14 +3587,14 @@
 
     my $pssymb='';
     my $parmlev='';
- 
+
     unless ($env{'form.parmlev'}) {
         $parmlev = 'map';
     } else {
         $parmlev = $env{'form.parmlev'};
     }
 
-    &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, 
+    &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps,
 				\%mapp, \%symbp,\%maptitles,\%uris,
 				\%keyorder,\%defkeytype);
 
@@ -3618,15 +3618,15 @@
     $r->print(&Apache::lonhtmlcommon::end_pick_box());
     $r->print('</div></div>');
     #$r->print('</td></tr></table>');
-    
+
     #$r->print('<table id="LC_parm_overview_controls">
     #           <tr><td class="LC_parm_overview_parm_selectors">');
     $r->print('<div class="LC_ContentBoxSpecial">');
     $r->print('<div class="LC_BoxPadding">' );
-    $r->print(&Apache::lonhtmlcommon::start_pick_box());  
+    $r->print(&Apache::lonhtmlcommon::start_pick_box());
     &parmmenu($r,\%allparms,\@pscat,\%keyorder);
 
-    $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));    
+    $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));
     #$r->print('</td><td class="LC_parm_overview_restrictions">'.
      $r->print('<table>'.
               '<tr><th>'.&mt('Parts').'</th><th>'.&mt('Section(s)').
@@ -3647,9 +3647,9 @@
     unless ($sortorder) { $sortorder='realmstudent'; }
     &sortmenu($r,$sortorder);
     $r->print('</div></div>');
-   
+
     $r->print('<p><input type="submit" name="dis" value="'.&mt('Display').'" /></p>');
-    
+
 # Build the list data hash from the specified parms
 
     my $listdata;
@@ -3791,11 +3791,11 @@
 	    $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 = 
+		$display_value =
 		    &Apache::lonlocal::locallocaltime($display_value);
 	    }
 	    $r->print(&mt('Parameter: "[_1]" with value: "[_2]"',
@@ -3824,7 +3824,7 @@
 	    }
 	    $r->print(' <br />&nbsp;&nbsp;&nbsp;'.&mt('Part: [_1]',$data{'parameter_part'}));
 	    $r->print('</td></tr>');
-	
+
 	}
     }
     $r->print(&Apache::loncommon::end_data_table().'<p>'.
@@ -3914,7 +3914,7 @@
 	my ($map,$resid,$url) = &Apache::lonnet::decode_symb($data{'realm'});
 	$data{'realm_exists'} = &Apache::lonnet::symbverify($data{'realm'},$url);
     }
-    
+
     $data{'parameter_part'} = $part;
     $data{'parameter_name'} = $name;
 
@@ -3954,7 +3954,7 @@
                         $disallowed{'format'} .= $currclone.',';
                     }
                 } elsif ($currclone !~/^($match_username)\:($match_domain)$/) {
-                    $disallowed{'format'} .= $currclone.','; 
+                    $disallowed{'format'} .= $currclone.',';
                 } else {
                     if (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') {
                         $disallowed{'newuser'} .= $currclone.',';
@@ -3983,7 +3983,7 @@
     my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
     my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $clone_crs = $cnum.':'.$cdom;
-    
+
     if ($cnum && $cdom) {
         my @allowclone;
         &extract_cloners($clonelist,\@allowclone);
@@ -4095,7 +4095,7 @@
 		    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',
@@ -4127,7 +4127,7 @@
 		    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,
@@ -4244,7 +4244,7 @@
         }
 	my $ordered_fields = join ",", @neworder;
         my $put_result = &Apache::lonnet::put('environment',
-                           {'metadata.addedorder'=>$ordered_fields},$dom,$crs); 	
+                           {'metadata.addedorder'=>$ordered_fields},$dom,$crs);
 	&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.metadata.addedorder' => $ordered_fields});
     }
     my $fields = &get_added_meta_fieldnames($env{'request.course.id'});
@@ -4257,8 +4257,8 @@
             $ordered_fields = join ",", @fields_in_order;
         }
         my $put_result = &Apache::lonnet::put('environment',
-                            {'metadata.addedorder'=>$ordered_fields},$dom,$crs); 
-    } 
+                            {'metadata.addedorder'=>$ordered_fields},$dom,$crs);
+    }
     $r->print('<table>');
     my $num_fields = scalar(@fields_in_order);
     foreach my $key (@fields_in_order) {
@@ -4309,7 +4309,7 @@
             $options =~ s/,,/,/;
             my $put_result = &Apache::lonnet::put('environment',
                                         {'metadata.'.$meta_field.'.options'=>$options},$dom,$crs);
-                                        
+
             $r->print('Undeleted Metadata Field <strong>'.$env{'course.'.$env{'request.course.id'}.'.metadata.'.$meta_field.'.added'}."</strong> with result ".$put_result.'<br />');
         }
         $r->print(&continue());
@@ -4368,13 +4368,13 @@
                     $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,';
             	    }
@@ -4420,7 +4420,7 @@
         $output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag, $row_alt);
     }
     $output .= &Apache::loncommon::end_data_table();
-    $r->print(<<ENDenv);       
+    $r->print(<<ENDenv);
         <form method="post" action="/adm/parmset?action=setrestrictmeta" name="form">
         $output
         $buttons
@@ -4466,7 +4466,7 @@
 
     &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setdefaults',
     	text=>"Set Defaults"});
-    my $start_page = 
+    my $start_page =
 	&Apache::loncommon::start_page('Parameter Setting Default Actions');
     my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults');
     $r->print(<<ENDDEFHEAD);
@@ -4490,7 +4490,7 @@
     my %keyorder=&standardkeyorder();
     my %defkeytype=();
 
-    &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, 
+    &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps,
 				\%mapp, \%symbp,\%maptitles,\%uris,
 				\%keyorder,\%defkeytype);
     if ($env{'form.storerules'}) {
@@ -4553,7 +4553,7 @@
 	    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.'));
@@ -4647,7 +4647,7 @@
 	$issection='';
     }
     my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>';
-    my $realmdescription=&mt('all resources'); 
+    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);
@@ -4678,7 +4678,7 @@
     close($config);
     $standard_parms{'int_pos'}      = 'Positive Integer';
     $standard_parms{'int_zero_pos'} = 'Positive Integer or Zero';
-    %standard_parms=&Apache::lonlocal::texthash(%standard_parms);	
+    %standard_parms=&Apache::lonlocal::texthash(%standard_parms);
 }
 
 sub standard_parameter_names {
@@ -4687,9 +4687,9 @@
 	&load_parameter_names();
     }
     if ($standard_parms{$name}) {
-	return $standard_parms{$name}; 
-    } else { 
-	return $name; 
+	return $standard_parms{$name};
+    } else {
+	return $name;
     }
 }
 
@@ -4710,7 +4710,7 @@
 
     $r->print('<form action="/adm/parmset?action=parameterchangelog"
                      method="post" name="parameterlog">');
-    
+
     my %saveable_parameters = ('show' => 'scalar',);
     &Apache::loncommon::store_course_settings('parameter_log',
                                               \%saveable_parameters);
@@ -4738,7 +4738,7 @@
 	}
 	if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); }
     }
-    foreach my $id (sort 
+    foreach my $id (sort
 		    {
 			if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) {
 			    return $parmlog{$b}{'exe_time'} <=>$parmlog{$a}{'exe_time'}
@@ -4751,15 +4751,15 @@
 	my $count = 0;
 	my $time =
 	    &Apache::lonlocal::locallocaltime($parmlog{$id}{'exe_time'});
-	my $plainname = 
+	my $plainname =
 	    &Apache::loncommon::plainname($parmlog{$id}{'exe_uname'},
 					  $parmlog{$id}{'exe_udom'});
-	my $about_me_link = 
+	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'}) 
+	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'),
@@ -4782,8 +4782,8 @@
 		}
 	    }
 	    if ($typeflag) {
-		$istype{$parmname}=$value; 
-		if (!$env{'form.includetypes'}) { next; } 
+		$istype{$parmname}=$value;
+		if (!$env{'form.includetypes'}) { next; }
 	    }
 	    $count++;
 	    if ($makenewrow) {
@@ -4821,12 +4821,12 @@
                 my $description=&mt('Changed [_1] for [_2] to [_3]',&standard_parameter_names($parmname),$realmdescription,
 				    (&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value));
 		if (($uname) && ($udom)) {
-		    $output .= 
+		    $output .=
 			&Apache::loncommon::messagewrapper('Notify User',
 							   $uname,$udom,$title,
 							   $description);
 		} else {
-		    $output .= 
+		    $output .=
 			&Apache::lonrss::course_blog_link($id,$title,
 							  $description);
 		}
@@ -4837,7 +4837,7 @@
 	    my $wholeentry=$about_me_link.':'.
 		$parmlog{$id}{'exe_uname'}.':'.$parmlog{$id}{'exe_udom'}.':'.
 		$output;
-	    if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; }        
+	    if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; }
 	}
         if ($count) {
 	    $r->print($row_start.'<td rowspan="'.$count.'">'.$time.'</td>
@@ -4847,7 +4847,7 @@
 		  $send_msg_link.'</td>'.$output);
 	    $shown++;
 	}
-	if (!($env{'form.show'} eq &mt('all') 
+	if (!($env{'form.show'} eq &mt('all')
 	      || $shown<=$env{'form.show'})) { last; }
     }
     $r->print(&Apache::loncommon::end_data_table());
@@ -4993,7 +4993,7 @@
         } elsif (! exists($env{'form.action'})) {
             &print_main_menu($r,$parm_permission);
         } elsif ($env{'form.action'} eq 'crsenv') {
-            &crsenv($r); 
+            &crsenv($r);
         } elsif ($env{'form.action'} eq 'setoverview') {
 	    &overview($r);
 	} elsif ($env{'form.action'} eq 'addmetadata') {
@@ -5018,7 +5018,7 @@
             &date_shift_two($r);
 	} elsif ($env{'form.action'} eq 'categorizecourse') {
             &assign_course_categories($r);
-        } 
+        }
     } else {
 # ----------------------------- Not in a course, or not allowed to modify parms
 	if ($exists) {

--bisitz1242125651--