[LON-CAPA-cvs] cvs: loncom /homework default_homework.lcpm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 11 Oct 2004 16:31:35 -0000


albertel		Mon Oct 11 12:31:35 2004 EDT

  Modified files:              
    /loncom/homework	default_homework.lcpm 
  Log:
   adding support for &frac12 (BUG#3532) (Buy Guy Ash.)
  
  
Index: loncom/homework/default_homework.lcpm
diff -u loncom/homework/default_homework.lcpm:1.89 loncom/homework/default_homework.lcpm:1.90
--- loncom/homework/default_homework.lcpm:1.89	Tue Oct  5 16:30:17 2004
+++ loncom/homework/default_homework.lcpm	Mon Oct 11 12:31:34 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run()
 #
-# $Id: default_homework.lcpm,v 1.89 2004/10/05 20:30:17 albertel Exp $
+# $Id: default_homework.lcpm,v 1.90 2004/10/11 16:31:34 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -514,8 +514,8 @@
 	    }
 	    next;
 	}
-	$token =~ /^\s*(\d*)(.*)/;
-	$formula .= $1 if ($1 > 1);  # stoichiometric coefficient
+	$token =~ /^\s*(\d*(?:&frac\d\d)?)(.*)/;
+        $formula .= $1 if ($1 ne '1');  # stoichiometric coefficient
 	
 	my $molecule = $2;
 	# subscripts