[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm lonnavmaps.pm lonquickgrades.pm

bowersj2 lon-capa-cvs@mail.lon-capa.org
Thu, 07 Aug 2003 14:29:43 -0000


bowersj2		Thu Aug  7 10:29:43 2003 EDT

  Modified files:              
    /loncom/interface	loncoursedata.pm lonnavmaps.pm lonquickgrades.pm 
  Log:
  Remove the requirement to pass in the nav hash and the param hash; 
  nobody ever does it and I'm pretty sure it will never be useful. (If it 
  is, it can be easily added back in as an optional parameter later; 
  meanwhile it just confuses things.)
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.81 loncom/interface/loncoursedata.pm:1.82
--- loncom/interface/loncoursedata.pm:1.81	Mon Jul 14 09:10:39 2003
+++ loncom/interface/loncoursedata.pm	Thu Aug  7 10:29:43 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.81 2003/07/14 13:10:39 matthew Exp $
+# $Id: loncoursedata.pm,v 1.82 2003/08/07 14:29:43 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,8 +104,7 @@
     my $fn=$ENV{'request.course.fn'};
     ##
     ## use navmaps
-    my $navmap = Apache::lonnavmaps::navmap->new($fn.".db",
-                                                 $fn."_parms.db",1,0);
+    my $navmap = Apache::lonnavmaps::navmap->new(1,0);
     if (!defined($navmap)) {
         return 'Can not open Coursemap';
     }
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.219 loncom/interface/lonnavmaps.pm:1.220
--- loncom/interface/lonnavmaps.pm:1.219	Tue Jul 29 01:22:56 2003
+++ loncom/interface/lonnavmaps.pm	Thu Aug  7 10:29:43 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.219 2003/07/29 05:22:56 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.220 2003/08/07 14:29:43 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -129,9 +129,7 @@
     $r->send_http_header;
 
     # Create the nav map
-    my $navmap = Apache::lonnavmaps::navmap->new(
-                        $ENV{"request.course.fn"}.".db",
-                        $ENV{"request.course.fn"}."_parms.db", 1, 1);
+    my $navmap = Apache::lonnavmaps::navmap->new(1, 1);
 
 
     if (!defined($navmap)) {
@@ -1172,9 +1170,7 @@
     if (!$ENV{'form.folderManip'} && !defined($args->{'iterator'})) {
         # Step 1: Check to see if we have a navmap
         if (!defined($navmap)) {
-            $navmap = Apache::lonnavmaps::navmap->new(
-                        $ENV{"request.course.fn"}.".db",
-                        $ENV{"request.course.fn"}."_parms.db", 1, 1);
+            $navmap = Apache::lonnavmaps::navmap->new(1, 1);
             $mustCloseNavMap = 1;
         }
         $navmap->init();
@@ -1238,9 +1234,7 @@
         
         # Step 1: Check to see if we have a navmap
         if (!defined($navmap)) {
-            $navmap = Apache::lonnavmaps::navmap->new($r, 
-                        $ENV{"request.course.fn"}.".db",
-                        $ENV{"request.course.fn"}."_parms.db", 1, 1);
+            $navmap = Apache::lonnavmaps::navmap->new(1, 1);
             $mustCloseNavMap = 1;
         }
         # Paranoia: Make sure it's ready
@@ -1646,11 +1640,10 @@
 
 =over 4
 
-=item * B<Apache::lonnavmaps::navmap-E<gt>new>(navHashFile, parmHashFile, 
+=item * B<Apache::lonnavmaps::navmap-E<gt>new>(
   genCourseAndUserOptions, genMailDiscussStatus, getUserData):
 
-Binds a new navmap object to the compiled nav map hash and parm hash
-given as filenames. genCourseAndUserOptions is a flag saying whether
+Creates a new navmap object. genCourseAndUserOptions is a flag saying whether
 the course options and user options hash should be generated. This is
 for when you are using the parameters of the resources that require
 them; see documentation in resource object
@@ -1692,8 +1685,6 @@
     my $class = ref($proto) || $proto;
     my $self = {};
 
-    $self->{NAV_HASH_FILE} = shift;
-    $self->{PARM_HASH_FILE} = shift;
     $self->{GENERATE_COURSE_USER_OPT} = shift;
     $self->{GENERATE_EMAIL_DISCUSS_STATUS} = shift;
     $self->{GET_USER_DATA} = shift;
@@ -1710,12 +1701,13 @@
 
     my %navmaphash;
     my %parmhash;
-    if (!(tie(%navmaphash, 'GDBM_File', $self->{NAV_HASH_FILE},
+    my $courseFn = $ENV{"request.course.fn"};
+    if (!(tie(%navmaphash, 'GDBM_File', "${courseFn}.db",
               &GDBM_READER(), 0640))) {
         return undef;
     }
     
-    if (!(tie(%parmhash, 'GDBM_File', $self->{PARM_HASH_FILE},
+    if (!(tie(%parmhash, 'GDBM_File', "${courseFn}_parms.db",
               &GDBM_READER(), 0640)))
     {
         untie %{$self->{PARM_HASH}};
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.22 loncom/interface/lonquickgrades.pm:1.23
--- loncom/interface/lonquickgrades.pm:1.22	Thu Jul 17 10:34:02 2003
+++ loncom/interface/lonquickgrades.pm	Thu Aug  7 10:29:43 2003
@@ -67,9 +67,7 @@
         $ENV{'course.'.$ENV{'request.course.id'}.'.grading'} eq 'standard';
 
     # Create the nav map
-    my $navmap = Apache::lonnavmaps::navmap->new(
-                        $ENV{"request.course.fn"}.".db",
-                        $ENV{"request.course.fn"}."_parms.db", 1, 0, 1);
+    my $navmap = Apache::lonnavmaps::navmap->new(1, 0, 1);
 
     if (!defined($navmap)) {
         my $requrl = $r->uri;