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

www lon-capa-cvs@mail.lon-capa.org
Sun, 19 Jan 2003 11:55:14 -0000


www		Sun Jan 19 06:55:14 2003 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  Bugs #1134, #1135
  Shows "folder or map level" in description items
  Shows title of map or folder in dropdown menu
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.81 loncom/interface/lonparmset.pm:1.82
--- loncom/interface/lonparmset.pm:1.81	Mon Dec 30 09:10:58 2002
+++ loncom/interface/lonparmset.pm	Sun Jan 19 06:55:14 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.81 2002/12/30 14:10:58 www Exp $
+# $Id: lonparmset.pm,v 1.82 2003/01/19 11:55:14 www 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
@@ -549,6 +551,7 @@
     my $defp = shift;
     my $mapp = shift;
     my $symbp = shift;
+    my $maptitles=shift;
 
     foreach (keys %$bighash) {
 	if ($_=~/^src\_(\d+)\.(\d+)$/) {
@@ -589,6 +592,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);
@@ -756,7 +762,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'} = '';
@@ -915,13 +921,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 {
@@ -984,7 +990,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'); }
@@ -1064,17 +1070,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>');
@@ -1235,10 +1241,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) {