--- rat/lonratsrv.pm 2005/06/13 20:23:53 1.32 +++ rat/lonratsrv.pm 2005/09/26 19:47:52 1.33 @@ -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 @@ sub loadmap { } 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 @@ sub loadmap { } else { $outstr.='false:'; } - if ($token->[2]->{'type'}) { + if (defined($token->[2]->{'type'})) { $outstr.=$token->[2]->{'type'}.':'; } else { $outstr.='normal:'; @@ -126,7 +126,7 @@ sub loadmap { } 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 @@ sub loadmap { } $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 @@ sub loadmap { # ----------------------------------------------------------------------- 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 @@ sub loadmap { $outstr.='<:>'.$token->[2]->{'from'}. ':'.$token->[2]->{'to'}; - if ($token->[2]->{'condition'}) { + if (defined($token->[2]->{'condition'})) { $outstr.=':'.$token->[2]->{'condition'}; } else { $outstr.=':0';