[LON-CAPA-cvs] cvs: modules /jerf/tests Utils.pm

bowersj2 lon-capa-cvs@mail.lon-capa.org
Thu, 17 Jul 2003 20:32:19 -0000


bowersj2		Thu Jul 17 16:32:19 2003 EDT

  Modified files:              
    /modules/jerf/tests	Utils.pm 
  Log:
  Courses can now have top-level maps specified.
  
  
Index: modules/jerf/tests/Utils.pm
diff -u modules/jerf/tests/Utils.pm:1.11 modules/jerf/tests/Utils.pm:1.12
--- modules/jerf/tests/Utils.pm:1.11	Fri Jul 11 12:31:21 2003
+++ modules/jerf/tests/Utils.pm	Thu Jul 17 16:32:19 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # testing utilities
 #
-# $Id: Utils.pm,v 1.11 2003/07/11 16:31:21 bowersj2 Exp $
+# $Id: Utils.pm,v 1.12 2003/07/17 20:32:19 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -421,7 +421,10 @@
 =item * I<copyResource>($source): Copies the given resource into the
     "test" directory of the authoring space. The "source" is the name
     of a file living in the "data" directory of this testing
-    harness. This takes care of translating maps as needed.
+    harness. This takes care of translating maps as needed. Note no
+    dependency checking is done, and I don't know what LON-CAPA does
+    if you publish a sequence that you've forced to reference
+    unpublished files.
 
 =cut
 
@@ -551,11 +554,13 @@
 
 =over 4
 
-=item * I<new>($r, $courseTitle, $courseMap, $courseCoordinator): $r should 
+=item * I<new>($r, $courseTitle, $courseMap, $courseCoordinator, $paramHash): $r should 
     be a request after a domain coordinator has logged in. $courseTitle should be
     the title of the course. $courseMap is the url of the top-level map (optional).
     $courseCoordinator is the account of the course coordinator. The domain
-    and home server will be pulled from the current test environment.
+    and home server will be pulled from the current test
+    environment. $paramHash can be used to override the form elements
+    directly.
 
 =back
 
@@ -575,6 +580,7 @@
     if (!defined($self->{courseMap})) { $self->{courseMap} = ''; }
     $self->{courseCoordinator} = shift;
     $self->{domain} = $Data::testDomain;
+    my $paramHash = shift;
 
     my $postcontent = {};
 
@@ -591,6 +597,11 @@
     $postcontent->{expireown} = '1';
     $postcontent->{submit} = 'Open Course';
     $postcontent->{phase} = 'two';
+    $postcontent->{topmap} = $self->{courseMap};
+
+    for (keys %$paramHash) {
+	$postcontent->{$_} = $paramHash->{$_};
+    }
 
     # Create a request object to handle the course creation.
     my $r = ApacheRequest->new({env => $self->{request}->{env},