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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 14 Feb 2006 15:58:48 -0000


albertel		Tue Feb 14 10:58:48 2006 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  - add ability to check if something is a .task
  - Make the Task part also look like a Task response
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.359 loncom/interface/lonnavmaps.pm:1.360
--- loncom/interface/lonnavmaps.pm:1.359	Fri Feb 10 17:33:45 2006
+++ loncom/interface/lonnavmaps.pm	Tue Feb 14 10:58:47 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.359 2006/02/10 22:33:45 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.360 2006/02/14 15:58:47 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3760,6 +3760,11 @@
     }
     return 0;
 }
+sub is_task {
+    my $self=shift;
+    my $src = $self->src();
+    return ($src =~ /\.(task)$/)
+}
 
 sub is_empty_sequence {
     my $self=shift;
@@ -4273,7 +4278,8 @@
         # where the part names begin and end, and even then, it is possible
         # to construct ambiguous situations.
         foreach (split /,/, $metadata) {
-            if ($_ =~ /^([a-zA-Z]+)response_(.*)/) {
+            if ($_ =~ /^([a-zA-Z]+)response_(.*)/
+		|| $_ =~ /^(Task)_(.*)/) {
                 my $responseType = $1;
                 my $partStuff = $2;
                 my $partIdSoFar = '';