<?php
        private function _ProcessSubQRelevance($eqn,$questionNum=NULL,$rowdivid=NULL, $type=NULL, $qtype=NULL, $sgqa=NULL)
        {
            // These will be called in the order that questions are supposed to be asked
            if (!isset($eqn) || trim($eqn=='') || trim($eqn)=='1')
            {
                return true;
            }
            $questionSeq = -1;
            $groupSeq = -1;
            if (!is_null($questionNum)) {
                $questionSeq = isset($this->questionId2questionSeq[$questionNum]) ? $this->questionId2questionSeq[$questionNum] : -1;
                $groupSeq = isset($this->questionId2groupSeq[$questionNum]) ? $this->questionId2groupSeq[$questionNum] : -1;
            }

            $stringToParse = htmlspecialchars_decode($eqn,ENT_QUOTES);
            $result = $this->em->ProcessBooleanExpression($stringToParse,$groupSeq, $questionSeq);
            $hasErrors = $this->em->HasErrors();
            $prettyPrint = '';
            if (($this->debugLevel & LEM_PRETTY_PRINT_ALL_SYNTAX) == LEM_PRETTY_PRINT_ALL_SYNTAX) {
                $prettyPrint= $this->em->GetPrettyPrintString();
            }

            if (!is_null($questionNum)) {
                $jsVars = $this->em->GetJSVarsUsed();
                if(count ($jsVars)){
                    $relevanceVars = implode('|',$this->em->GetJSVarsUsed());
                    $relevanceJS = $this->em->GetJavaScriptEquivalentOfExpression();
                    if (!isset($this->subQrelInfo[$questionNum])) {
                        $this->subQrelInfo[$questionNum] = array();
                    }
                    $this->subQrelInfo[$questionNum][$rowdivid] = array(
                    'qid' => $questionNum,
                    'eqn' => $eqn,
                    'prettyPrintEqn' => $prettyPrint,
                    'result' => $result,
                    'numJsVars' => count($jsVars),
                    'relevancejs' => $relevanceJS,
                    'relevanceVars' => $relevanceVars,
                    'rowdivid' => $rowdivid,
                    'type'=>$type,
                    'qtype'=>$qtype,
                    'sgqa'=>$sgqa,
                    'hasErrors'=>$hasErrors,
                    );
                }
                else
                {
                    $this->subQrelInfo[$questionNum][$rowdivid] = false;
                }
            }
            return $result;
        }
