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

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 14 Jul 2003 13:10:39 -0000


matthew		Mon Jul 14 09:10:39 2003 EDT

  Modified files:              
    /loncom/interface	loncoursedata.pm 
  Log:
  Make sure get_sequence_assessment_data gives a title, even if there is none
  returned by the navmaps resource object.
  Trivial whitespace changes.
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.80 loncom/interface/loncoursedata.pm:1.81
--- loncom/interface/loncoursedata.pm:1.80	Wed Jun 25 15:25:54 2003
+++ loncom/interface/loncoursedata.pm	Mon Jul 14 09:10:39 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.80 2003/06/25 19:25:54 www Exp $
+# $Id: loncoursedata.pm,v 1.81 2003/07/14 13:10:39 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -161,6 +161,10 @@
             $title = $previous->title();
             $symb  = $previous->symb();
             $src   = $previous->src();
+            # pick up the filename if there is no title available
+            if (! defined($title) || $title eq '') {
+                ($title) = ($src=~/\/([^\/]*)$/);
+            }
             $randompick = $previous->randompick();
             my $newmap = { title    => $title,
                            src      => $src,
@@ -1371,9 +1375,9 @@
     }
     #
     $dbh->do('DROP TABLE '.$stats_table);  # May return an error
-#
-# Store in metadata
-#
+    #
+    # Store in metadata
+    #
     if ($num) {
 	my %storestats=();
 
@@ -1387,9 +1391,9 @@
 	$urlres=~/^(\w+)\/(\w+)/; 
 	&Apache::lonnet::put('nohist_resevaldata',\%storestats,$1,$2); 
     }
-#
-# Return result
-#
+    #
+    # Return result
+    #
     return { num_students => $num,
              tries        => $tries,
              max_tries    => $mod,
@@ -1399,7 +1403,7 @@
              num_solved   => $Solved,
              num_override => $solved,
              per_wrong    => $wrongpercent,
-             deg_of_diff  => $DegOfDiff }
+             deg_of_diff  => $DegOfDiff };
 }
 
 sub execute_SQL_request {