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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 16 Feb 2006 19:38:28 -0000


albertel		Thu Feb 16 14:38:28 2006 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  - practice problems don't really count as problems
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.360 loncom/interface/lonnavmaps.pm:1.361
--- loncom/interface/lonnavmaps.pm:1.360	Tue Feb 14 10:58:47 2006
+++ loncom/interface/lonnavmaps.pm	Thu Feb 16 14:38:27 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.360 2006/02/14 15:58:47 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.361 2006/02/16 19:38:27 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3730,10 +3730,21 @@
     return $self->navHash("is_map_", 1) && 
 	$self->navHash("map_type_" . $self->map_pc()) eq 'page';
 }
+sub is_practice {
+    my $self=shift;
+    my ($part) = @_;
+    if ($self->parmval('type',$part) eq 'practice') {
+        return 1;
+    }
+    return 0;
+}
 sub is_problem {
     my $self=shift;
     my $src = $self->src();
-    return ($src =~ /\.(problem|exam|quiz|assess|survey|form|library|task)$/)
+    if ($src =~ /\.(problem|exam|quiz|assess|survey|form|library|task)$/) {
+	return !($self->is_practice());
+    }
+    return 0;
 }
 sub contains_problem {
     my $self=shift;