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

www lon-capa-cvs@mail.lon-capa.org
Thu, 02 Sep 2004 15:26:40 -0000


www		Thu Sep  2 11:26:40 2004 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  Bug #3387: Verify checks for multiple use of sequences or pages
  Also, deals with spaces in filenames
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.139 loncom/interface/londocs.pm:1.140
--- loncom/interface/londocs.pm:1.139	Sun Aug 29 02:35:41 2004
+++ loncom/interface/londocs.pm	Thu Sep  2 11:26:40 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.139 2004/08/29 06:35:41 albertel Exp $
+# $Id: londocs.pm,v 1.140 2004/09/02 15:26:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -874,6 +874,7 @@
 
 sub checkonthis {
     my ($r,$url,$level,$title)=@_;
+    $url=&Apache::lonnet::unescape($url);
     $alreadyseen{$url}=1;
     $r->rflush();
     if (($url) && ($url!~/^\/uploaded\//) && ($url!~/\*$/)) {
@@ -960,7 +961,15 @@
    %alreadyseen=();
    &tiehash();
    foreach (keys %hash) {
-       if (($_=~/^src\_(.+)$/) && (!$alreadyseen{$hash{$_}})) {
+       if ($hash{$_}=~/\.(page|sequence)$/) {
+	   if (($_=~/^src_/) && ($alreadyseen{&Apache::lonnet::unescape($hash{$_})})) {
+	       $r->print('<hr /><font color="red">'.
+			 &mt('The following sequence or page is included more than once in your course: ').
+			 &Apache::lonnet::unescape($hash{$_}).'</font><br />'.
+			 &mt('Note that grading records for problems included in this sequence or folder will overlap.<hr />'));
+	   }
+       }
+       if (($_=~/^src\_(.+)$/) && (!$alreadyseen{&Apache::lonnet::unescape($hash{$_})})) {
            &checkonthis($r,$hash{$_},0,$hash{'title_'.$1});
        }
    }