[LON-CAPA-cvs] cvs: rat / lonratedt.pm lonsequence.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 07 Apr 2003 20:47:06 -0000


www		Mon Apr  7 16:47:06 2003 EDT

  Modified files:              
    /rat	lonratedt.pm lonsequence.pm 
  Log:
  Bug #1354 - show warning if it was not possible to show map in linear order.
  
  
Index: rat/lonratedt.pm
diff -u rat/lonratedt.pm:1.43 rat/lonratedt.pm:1.44
--- rat/lonratedt.pm:1.43	Wed Jan 22 12:25:03 2003
+++ rat/lonratedt.pm	Mon Apr  7 16:47:06 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Edit Handler for RAT Maps
 #
-# $Id: lonratedt.pm,v 1.43 2003/01/22 17:25:03 www Exp $
+# $Id: lonratedt.pm,v 1.44 2003/04/07 20:47:06 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -913,6 +913,9 @@
     }
     my $idx=0;
     $r->print('<h1>'.$url.'</h1>');
+    if ($adv) {
+	$r->print('<p><b><font color="red">Map contents are not shown in order.</font></b></p><br />');
+    }
     foreach (&attemptread(&Apache::lonnet::filelocation('',$url))) {
 	if (defined($_)) {
             $idx++;
Index: rat/lonsequence.pm
diff -u rat/lonsequence.pm:1.14 rat/lonsequence.pm:1.15
--- rat/lonsequence.pm:1.14	Fri Aug 30 20:43:13 2002
+++ rat/lonsequence.pm	Mon Apr  7 16:47:06 2003
@@ -2,7 +2,7 @@
 #
 # Sequence Handler
 #
-# $Id: lonsequence.pm,v 1.14 2002/08/31 00:43:13 www Exp $
+# $Id: lonsequence.pm,v 1.15 2003/04/07 20:47:06 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -62,6 +62,16 @@
     }
 }
 
+sub mapread {
+    my $fn=shift;
+    &Apache::lonnet::repcopy($fn);
+    if (-e $fn) {
+	return &Apache::lonratedt::mapread($fn,'');
+    } else {
+        return ();
+    }
+}
+
 # ---------------------------------------------------------------- View Handler
 
 sub viewmap {
@@ -152,6 +162,10 @@
         }
     }
 # ----------------------------- successtied is now '1' if in working selectmode
+    my ($errtext,$fatal)=&mapread(&Apache::lonnet::filelocation('',$url),'');
+    if ($fatal==1) {
+       $r->print('<p><b><font color="red">Map contents are not shown in order.</font></b></p><br />');
+    }
     my $idx=0;
     foreach (&attemptread(&Apache::lonnet::filelocation('',$url))) {
 	if (defined($_)) {