public function process()
    {
        $expr = $this->getExpression();
        $state = $this->getState();
        $identifier=  $expr->getIdentifier();

        $var = $state->getVariable($identifier);

        if (is_null($var)) {
            return null;
        } elseif ($var instanceof ResponseVariable) {
            return $var->getCorrectResponse();
        } else {
            $msg = "The variable with identifier '${identifier}' is not a ResponseVariable object.";
            throw new ExpressionProcessingException($msg, $this, ExpressionProcessingException::WRONG_VARIABLE_TYPE);
        }
    }
public function process()
    {
        $expr = $this->getExpression();
        $state = $this->getState();
        $identifier=  $expr->getIdentifier();

        $var = $state->getVariable($identifier);

        if (is_null($var)) {
            return null;
        } elseif ($var instanceof ResponseVariable) {
            return $var->getCorrectResponse();
        } else {
            $msg = "The variable with identifier '${identifier}' is not a ResponseVariable object.";
            throw new ExpressionProcessingException($msg, $this, ExpressionProcessingException::WRONG_VARIABLE_TYPE);
        }
    }
public function process ( ) { $ expr = $ this -> getExpression ( ) ; $ state = $ this -> getState ( ) ; $ identifier = $ expr -> getIdentifier ( ) ; $ var = $ state -> getVariable ( $ identifier ) ; if ( is_null ( $ var ) ) { return null ; } elseif ( $ var instanceof ResponseVariable ) { return $ var -> getCorrectResponse ( ) ; } else { $ msg = "The variable with identifier '${identifier}' is not a ResponseVariable object." ; throw new ExpressionProcessingException ( $ msg , $ this , ExpressionProcessingException :: WRONG_VARIABLE_TYPE ) ; } }
Returns the related correstResponse as a QTI Runtime compliant value.

* If no variable can be matched, null is returned.
* If the target variable has no correctResponse, null is returned.

An ExpressionProcessingException is thrown if:

* The targeted variable is not a ResponseVariable.

@return mixed A QTI Runtime compliant value or null.
@throws \qtism\runtime\expressions\ExpressionProcessingException
Returns the related correstResponse as a QTI Runtime compliant value .