I believe there is a bug in the scoring engine...

this
if $iOutput=$iResult and vartype($iOutput)=3
should be
if $iOutput=$sResult and vartype($sResult)=3