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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 14 Mar 2003 21:15:39 -0000


albertel		Fri Mar 14 16:15:39 2003 EDT

  Modified files:              (Branch: version_0_6)
    /loncom/interface	lonparmset.pm 
  Log:
  - backport of 1.82
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.80 loncom/interface/lonparmset.pm:1.80.2.1
--- loncom/interface/lonparmset.pm:1.80	Mon Dec  9 17:27:20 2002
+++ loncom/interface/lonparmset.pm	Fri Mar 14 16:15:39 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.80 2002/12/09 22:27:20 www Exp $
+# $Id: lonparmset.pm,v 1.80.2.1 2003/03/14 21:15:39 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -72,6 +72,8 @@
 my %typep;
 my %keyp;
 
+my %maptitles;
+
 my $uname;
 my $udom;
 my $uhome;
@@ -96,13 +98,13 @@
 11- resource default
 10- map default
 9 - General Course
-8 - Map level in course
+8 - Map or Folder level in course
 7 - resource level in course
 6 - General for section
-5 - Map level for section
+5 - Map or Folder level for section
 4 - resource level in section
 3 - General for specific student
-2 - Map level for specific student
+2 - Map or Folder level for specific student
 1 - resource level for specific student
 
 =cut
@@ -544,6 +546,7 @@
     my $defp = shift;
     my $mapp = shift;
     my $symbp = shift;
+    my $maptitles=shift;
 
     foreach (keys %$bighash) {
 	if ($_=~/^src\_(\d+)\.(\d+)$/) {
@@ -584,6 +587,9 @@
 		    &Apache::lonnet::declutter($$bighash{'map_id_'.$mapid});
                 $$mapp{$mapid}=$$mapp{$id};
 		$$allmaps{$mapid}=$$mapp{$id};
+		$$maptitles{$mapid}=
+ $$bighash{'title_'.$$bighash{'ids_'.&Apache::lonnet::clutter($$mapp{$id})}};
+		$$maptitles{$$mapp{$id}}=$$maptitles{$mapid};
 		$$symbp{$id}=$$mapp{$id}.
 			'___'.$resid.'___'.
 			    &Apache::lonnet::declutter($srcf);
@@ -751,7 +757,7 @@
     }
 
 # --------------------------------------------------------- Get all assessments
-    extractResourceInformation(\%bighash, \@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allkeys, \%allmaps, $fcat, \%defp, \%mapp, \%symbp);
+    extractResourceInformation(\%bighash, \@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allkeys, \%allmaps, $fcat, \%defp, \%mapp, \%symbp,\%maptitles);
 
     $mapp{'0.0'} = '';
     $symbp{'0.0'} = '';
@@ -910,13 +916,13 @@
 
         $r->print('</tr><tr><td><hr /></td>');
 
-        $r->print('<tr><td>Select Enclosing Map</td>');
+        $r->print('<tr><td>Select Enclosing Map or Folder</td>');
         $r->print('<td colspan="2"><select name="pschp">');
-        $r->print('<option value="all">All Maps</option>');
+        $r->print('<option value="all">All Maps or Folders</option>');
         foreach (sort {$allmaps{$a} cmp $allmaps{$b}} keys %allmaps) {
             $r->print('<option value="'.$_.'"');
             if (($pschp eq $_)) { $r->print(' selected'); }
-            $r->print('>/res/'.$allmaps{$_}.'</option>');
+            $r->print('>'.$maptitles{$_}.($allmaps{$_}!~/^uploaded/?'  ['.$allmaps{$_}.']':'').'</option>');
         }
         $r->print("</select></td></tr>\n");
     } else {
@@ -979,7 +985,7 @@
 
         $r->print('<tr><td>Sort list by</td><td>');
         $r->print('<select name="fcat">');
-        $r->print('<option value="">Enclosing Map</option>');
+        $r->print('<option value="">Enclosing Map or Folder</option>');
         foreach (sort keys %allkeys) {
             $r->print('<option value="'.$_.'"');
             if ($fcat eq $_) { $r->print(' selected'); }
@@ -1059,17 +1065,17 @@
            }
            $r->print(<<ENDTABLEHEADFOUR);
 </tr><tr><th>Assessment URL and Title</th><th>Type</th>
-<th>Enclosing Map</th><th>Part No.</th><th>Parameter Name</th>
-<th>default</th><th>from Enclosing Map</th>
-<th>general</th><th>for Enclosing Map</th><th>for Resource</th>
+<th>Enclosing Map or Folder</th><th>Part No.</th><th>Parameter Name</th>
+<th>default</th><th>from Enclosing Map or Folder</th>
+<th>general</th><th>for Enclosing Map or Folder</th><th>for Resource</th>
 ENDTABLEHEADFOUR
 
            if ($csec) {
-               $r->print('<th>general</th><th>for Enclosing Map</th><th>for Resource</th>');
+               $r->print('<th>general</th><th>for Enclosing Map or Folder</th><th>for Resource</th>');
            }
 
            if ($uname) {
-               $r->print('<th>general</th><th>for Enclosing Map</th><th>for Resource</th>');
+               $r->print('<th>general</th><th>for Enclosing Map or Folder</th><th>for Resource</th>');
            }
 
            $r->print('</tr>');
@@ -1230,10 +1236,12 @@
                 } # end loop through ids
                                  
 #---------------------------------------------------- print header information
+                my $foldermap=($maptitle=~/^uploaded/?'Folder':'Map');
+                my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':'');
                 $r->print(<<ENDMAPONE);
 <center><h4>
-<font color="red">Set Defaults for All Resources in map
-<i>$maptitle</i><br />
+<font color="red">Set Defaults for All Resources in $foldermap<br />
+<i>$showtitle</i><br />
 Specifically for
 ENDMAPONE
                 if ($uname) {