public static function get_scorm_scoes($scormid, $organization = '') {
        global $DB;

        $params = self::validate_parameters(self::get_scorm_scoes_parameters(),
                                            array('scormid' => $scormid, 'organization' => $organization));

        $scoes = array();
        $warnings = array();

        $scorm = $DB->get_record('scorm', array('id' => $params['scormid']), '*', MUST_EXIST);
        $cm = get_coursemodule_from_instance('scorm', $scorm->id);

        $context = context_module::instance($cm->id);
        self::validate_context($context);

        // Check settings / permissions to view the SCORM.
        scorm_require_available($scorm, true, $context);

        if (!$scoes = scorm_get_scoes($scorm->id, $params['organization'])) {
            // Function scorm_get_scoes return false, not an empty array.
            $scoes = array();
        } else {
            $scoreturnstructure = self::get_scorm_scoes_returns();
            foreach ($scoes as $sco) {
                $extradata = array();
                foreach ($sco as $element => $value) {
                    // Check if the element is extra data (not a basic SCO element).
                    if (!isset($scoreturnstructure->keys['scoes']->content->keys[$element])) {
                        $extradata[] = array(
                            'element' => $element,
                            'value' => $value
                        );
                    }
                }
                $sco->extradata = $extradata;
            }
        }

        $result = array();
        $result['scoes'] = $scoes;
        $result['warnings'] = $warnings;
        return $result;
    }
public static function get_scorm_scoes($scormid, $organization = '') {
        global $DB;

        $params = self::validate_parameters(self::get_scorm_scoes_parameters(),
                                            array('scormid' => $scormid, 'organization' => $organization));

        $scoes = array();
        $warnings = array();

        $scorm = $DB->get_record('scorm', array('id' => $params['scormid']), '*', MUST_EXIST);
        $cm = get_coursemodule_from_instance('scorm', $scorm->id);

        $context = context_module::instance($cm->id);
        self::validate_context($context);

        // Check settings / permissions to view the SCORM.
        scorm_require_available($scorm, true, $context);

        if (!$scoes = scorm_get_scoes($scorm->id, $params['organization'])) {
            // Function scorm_get_scoes return false, not an empty array.
            $scoes = array();
        } else {
            $scoreturnstructure = self::get_scorm_scoes_returns();
            foreach ($scoes as $sco) {
                $extradata = array();
                foreach ($sco as $element => $value) {
                    // Check if the element is extra data (not a basic SCO element).
                    if (!isset($scoreturnstructure->keys['scoes']->content->keys[$element])) {
                        $extradata[] = array(
                            'element' => $element,
                            'value' => $value
                        );
                    }
                }
                $sco->extradata = $extradata;
            }
        }

        $result = array();
        $result['scoes'] = $scoes;
        $result['warnings'] = $warnings;
        return $result;
    }
public static function get_scorm_scoes ( $ scormid , $ organization = '' ) { global $ DB ; $ params = self :: validate_parameters ( self :: get_scorm_scoes_parameters ( ) , array ( 'scormid' => $ scormid , 'organization' => $ organization ) ) ; $ scoes = array ( ) ; $ warnings = array ( ) ; $ scorm = $ DB -> get_record ( 'scorm' , array ( 'id' => $ params [ 'scormid' ] ) , '*' , MUST_EXIST ) ; $ cm = get_coursemodule_from_instance ( 'scorm' , $ scorm -> id ) ; $ context = context_module :: instance ( $ cm -> id ) ; self :: validate_context ( $ context ) ; // Check settings / permissions to view the SCORM. scorm_require_available ( $ scorm , true , $ context ) ; if ( ! $ scoes = scorm_get_scoes ( $ scorm -> id , $ params [ 'organization' ] ) ) { // Function scorm_get_scoes return false, not an empty array. $ scoes = array ( ) ; } else { $ scoreturnstructure = self :: get_scorm_scoes_returns ( ) ; foreach ( $ scoes as $ sco ) { $ extradata = array ( ) ; foreach ( $ sco as $ element => $ value ) { // Check if the element is extra data (not a basic SCO element). if ( ! isset ( $ scoreturnstructure -> keys [ 'scoes' ] -> content -> keys [ $ element ] ) ) { $ extradata [ ] = array ( 'element' => $ element , 'value' => $ value ) ; } } $ sco -> extradata = $ extradata ; } } $ result = array ( ) ; $ result [ 'scoes' ] = $ scoes ; $ result [ 'warnings' ] = $ warnings ; return $ result ; }
Returns a list containing all the scoes data related to the given scorm id

@param int $scormid the scorm id
@param string $organization the organization id
@return array warnings and the scoes data
@since Moodle 3.0
Returns a list containing all the scoes data related to the given scorm id