public static function getFeedbacks(tao_models_classes_service_StorageDirectory $directory, AssessmentItemSession $itemSession) {
        
        $returnValue = array();
        
        $feedbackClasses = array('modalFeedback', 'feedbackInline', 'feedbackBlock');
        $elements = self::getContentVariableElements($directory);
        
        $outcomes = array();
        foreach ($elements as $data) {
            if (empty($data['qtiClass']) === false && in_array($data['qtiClass'], $feedbackClasses)) {
        
                $feedbackIdentifier = $data['attributes']['identifier'];
                $outcomeIdentifier = $data['attributes']['outcomeIdentifier'];
        
                if (!isset($outcomes[$outcomeIdentifier])) {
                    $outcomes[$outcomeIdentifier] = array();
                }
        
                $outcomes[$outcomeIdentifier][$feedbackIdentifier] = $data;
            }
        }
        
        foreach ($itemSession->getAllVariables() as $var) {
        
            $identifier = $var->getIdentifier();
        
            if (isset($outcomes[$identifier])) {
        
                $feedbacks = $outcomes[$identifier];
                $feedbackIds = QtiRunner::getVariableValues($var);
        
                foreach($feedbackIds as $feedbackId) {
        
                    if (isset($feedbacks[$feedbackId])) {
                        $data = $feedbacks[$feedbackId];
                        $returnValue[$data['serial']] = $data;
                    }
                }
        
            }
        }
        
        return $returnValue;
    }
public static function getFeedbacks(tao_models_classes_service_StorageDirectory $directory, AssessmentItemSession $itemSession) {
        
        $returnValue = array();
        
        $feedbackClasses = array('modalFeedback', 'feedbackInline', 'feedbackBlock');
        $elements = self::getContentVariableElements($directory);
        
        $outcomes = array();
        foreach ($elements as $data) {
            if (empty($data['qtiClass']) === false && in_array($data['qtiClass'], $feedbackClasses)) {
        
                $feedbackIdentifier = $data['attributes']['identifier'];
                $outcomeIdentifier = $data['attributes']['outcomeIdentifier'];
        
                if (!isset($outcomes[$outcomeIdentifier])) {
                    $outcomes[$outcomeIdentifier] = array();
                }
        
                $outcomes[$outcomeIdentifier][$feedbackIdentifier] = $data;
            }
        }
        
        foreach ($itemSession->getAllVariables() as $var) {
        
            $identifier = $var->getIdentifier();
        
            if (isset($outcomes[$identifier])) {
        
                $feedbacks = $outcomes[$identifier];
                $feedbackIds = QtiRunner::getVariableValues($var);
        
                foreach($feedbackIds as $feedbackId) {
        
                    if (isset($feedbacks[$feedbackId])) {
                        $data = $feedbacks[$feedbackId];
                        $returnValue[$data['serial']] = $data;
                    }
                }
        
            }
        }
        
        return $returnValue;
    }
public static function getFeedbacks ( tao_models_classes_service_StorageDirectory $ directory , AssessmentItemSession $ itemSession ) { $ returnValue = array ( ) ; $ feedbackClasses = array ( 'modalFeedback' , 'feedbackInline' , 'feedbackBlock' ) ; $ elements = self :: getContentVariableElements ( $ directory ) ; $ outcomes = array ( ) ; foreach ( $ elements as $ data ) { if ( empty ( $ data [ 'qtiClass' ] ) === false && in_array ( $ data [ 'qtiClass' ] , $ feedbackClasses ) ) { $ feedbackIdentifier = $ data [ 'attributes' ] [ 'identifier' ] ; $ outcomeIdentifier = $ data [ 'attributes' ] [ 'outcomeIdentifier' ] ; if ( ! isset ( $ outcomes [ $ outcomeIdentifier ] ) ) { $ outcomes [ $ outcomeIdentifier ] = array ( ) ; } $ outcomes [ $ outcomeIdentifier ] [ $ feedbackIdentifier ] = $ data ; } } foreach ( $ itemSession -> getAllVariables ( ) as $ var ) { $ identifier = $ var -> getIdentifier ( ) ; if ( isset ( $ outcomes [ $ identifier ] ) ) { $ feedbacks = $ outcomes [ $ identifier ] ; $ feedbackIds = QtiRunner :: getVariableValues ( $ var ) ; foreach ( $ feedbackIds as $ feedbackId ) { if ( isset ( $ feedbacks [ $ feedbackId ] ) ) { $ data = $ feedbacks [ $ feedbackId ] ; $ returnValue [ $ data [ 'serial' ] ] = $ data ; } } } } return $ returnValue ; }
Get the feedback to be displayed on an AssessmentItemSession

@param tao_models_classes_service_StorageDirectory $directory
@param \qtism\runtime\tests\AssessmentItemSession $itemSession
@return array
Get the feedback to be displayed on an AssessmentItemSession