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

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 11 Dec 2003 22:18:04 -0000


matthew		Thu Dec 11 17:18:04 2003 EDT

  Modified files:              
    /loncom/interface	loncoursedata.pm 
  Log:
  get_sequence_assessment_data: make sure we have a title for the resource
  by using the filename if the title is not set.
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.109 loncom/interface/loncoursedata.pm:1.110
--- loncom/interface/loncoursedata.pm:1.109	Tue Dec  9 16:14:23 2003
+++ loncom/interface/loncoursedata.pm	Thu Dec 11 17:18:04 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.109 2003/12/09 21:14:23 matthew Exp $
+# $Id: loncoursedata.pm,v 1.110 2003/12/11 22:18:04 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -188,6 +188,10 @@
         $title =~ s/\:/\&\#058;/g;
         $symb  = $curRes->symb();
         $src   = $curRes->src();
+        # Grab the filename if there is not title available
+        if (! defined($title) || $title eq '') {
+            ($title) = ($src=~ m:/([^/]*)$:);
+        }
         my $parts = $curRes->parts();
         my %partdata;
         foreach my $part (@$parts) {