[LON-CAPA-cvs] cvs: rat / lonratsrv.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 26 Sep 2005 19:47:54 -0000


albertel		Mon Sep 26 15:47:54 2005 EDT

  Modified files:              
    /rat	lonratsrv.pm 
  Log:
  - ugh some 5 year-old bugginess
  
  
Index: rat/lonratsrv.pm
diff -u rat/lonratsrv.pm:1.32 rat/lonratsrv.pm:1.33
--- rat/lonratsrv.pm:1.32	Mon Jun 13 16:23:53 2005
+++ rat/lonratsrv.pm	Mon Sep 26 15:47:52 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Server for RAT Maps
 #
-# $Id: lonratsrv.pm,v 1.32 2005/06/13 20:23:53 albertel Exp $
+# $Id: lonratsrv.pm,v 1.33 2005/09/26 19:47:52 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -92,7 +92,7 @@
                 } elsif ($token->[1] eq 'resource') {
 # -------------------------------------------------------------------- Resource
                     $outstr.='<&>objcont';
-                    if ($token->[2]->{'id'}) {
+                    if (defined($token->[2]->{'id'})) {
 			$outstr.='<:>'.$token->[2]->{'id'};
                         if ($obj[$token->[2]->{'id'}]==1) {
                            $errtext.='Error: multiple use of ID '.
@@ -113,7 +113,7 @@
                     } else {
                         $outstr.='false:';
                     }
-                    if ($token->[2]->{'type'}) {
+                    if (defined($token->[2]->{'type'})) {
 			$outstr.=$token->[2]->{'type'}.':';
                     }  else {
                         $outstr.='normal:';
@@ -126,7 +126,7 @@
                 } elsif ($token->[1] eq 'condition') {
 # ------------------------------------------------------------------- Condition
                     $outstr.='<&>objcont';
-                    if ($token->[2]->{'id'}) {
+                    if (defined($token->[2]->{'id'})) {
 			$outstr.='<:>'.$token->[2]->{'id'};
                         if ($obj[$token->[2]->{'id'}]==1) {
                            $errtext.='Error: multiple use of ID '.
@@ -141,7 +141,7 @@
                     }
                     $outstr.='<:>';
                     $outstr.=qtunescape($token->[2]->{'value'}).':';
-                    if ($token->[2]->{'type'}) {
+                    if (defined($token->[2]->{'type'})) {
 			$outstr.=$token->[2]->{'type'}.':';
                     } else {
                         $outstr.='normal:';
@@ -151,7 +151,7 @@
 # ----------------------------------------------------------------------- Links
                     $outstr.='<&>objlinks';
 
-                        if ($token->[2]->{'index'}) {
+                        if (defined($token->[2]->{'index'})) {
 			   if ($links[$token->[2]->{'index'}]) {
                                $errtext.='Error: multiple use of link index '.
 			       $token->[2]->{'index'}.'. ';
@@ -167,7 +167,7 @@
 		    
                     $outstr.='<:>'.$token->[2]->{'from'}.
                              ':'.$token->[2]->{'to'};
-                    if ($token->[2]->{'condition'}) {
+                    if (defined($token->[2]->{'condition'})) {
 			$outstr.=':'.$token->[2]->{'condition'};
                     } else {
  			$outstr.=':0';