]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/scripts/public_html/common.php
Improved rendering of conjectures
[helm.git] / helm / matita / scripts / public_html / common.php
index 10aeb8d823a025758c0a51dc349917c1fb48be84..f2a9be030ea5e26c36788fa13b2bbbd8c9945baa 100644 (file)
@@ -5,7 +5,7 @@ function query($q) {
   mysql_select_db("matita");
   if (preg_match("/TIME_TO_SEC/",$q)) {
     $group_by = true;
-    $q = preg_replace("/group by mark/","",$q);
+    $q = preg_replace("/group by bench.mark/","",$q);
     $q = preg_replace("/SEC_TO_TIME\(SUM\(TIME_TO_SEC\(([^)]+)\)\)\)/","$1",$q);
   }
   $rc = mysql_query($q,$db);
@@ -27,9 +27,9 @@ function query($q) {
 
 function time_2_cents($t) {
   $matches = array();
-  $rex = "/^(\d+)m(\d{2})\.(\d{2})s$/";
+  $rex = "/^(\d+)m(\d\d?)\.(\d{2})s$/";
   $m = preg_match($rex,$t,$matches);
-  if ( $m == 0 ) exit 1;
+  if ( $m == 0 ) exit(1);
   $t_minutes = $matches[1];
   $t_secs = $matches[2];
   $t_cents = $matches[3];
@@ -39,7 +39,7 @@ function time_2_cents($t) {
 function sum_time($t1, $t2) {
   $matches1 = array();
   $matches2 = array();
-  $rex = "/^(\d+)m(\d{2})\.(\d{2})s$/";
+  $rex = "/^(\d+)m(\d\d?)\.(\d{2})s$/";
   $m1 = preg_match($rex,$t1,$matches1);
   $m2 = preg_match($rex,$t2,$matches2);
   if ($m1 != 0 && $m2 != 0) {