public function get_paths() {

        $paths = array(
            new convert_path('question_categories', '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES'),
            new convert_path(
                'question_category', '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY',
                array(
                    'newfields' => array(
                        'infoformat' => 0
                    )
                )),
            new convert_path('question_category_context', '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/CONTEXT'),
            new convert_path('questions', '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/QUESTIONS'),
            // the question element must be grouped so we can re-dispatch it to the qtype handler as a whole
            new convert_path('question', '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/QUESTIONS/QUESTION', array(), true),
        );

        // annotate all question subpaths required by the qtypes subplugins
        $subpaths = array();
        foreach ($this->get_qtype_handler('*') as $qtypehandler) {
            foreach ($qtypehandler->get_question_subpaths() as $subpath) {
                $subpaths[$subpath] = true;
            }
        }
        foreach (array_keys($subpaths) as $subpath) {
            $name = 'subquestion_'.strtolower(str_replace('/', '_', $subpath));
            $path = '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/QUESTIONS/QUESTION/'.$subpath;
            $paths[] = new convert_path($name, $path);
        }

        return $paths;
    }
public function get_paths() {

        $paths = array(
            new convert_path('question_categories', '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES'),
            new convert_path(
                'question_category', '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY',
                array(
                    'newfields' => array(
                        'infoformat' => 0
                    )
                )),
            new convert_path('question_category_context', '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/CONTEXT'),
            new convert_path('questions', '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/QUESTIONS'),
            // the question element must be grouped so we can re-dispatch it to the qtype handler as a whole
            new convert_path('question', '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/QUESTIONS/QUESTION', array(), true),
        );

        // annotate all question subpaths required by the qtypes subplugins
        $subpaths = array();
        foreach ($this->get_qtype_handler('*') as $qtypehandler) {
            foreach ($qtypehandler->get_question_subpaths() as $subpath) {
                $subpaths[$subpath] = true;
            }
        }
        foreach (array_keys($subpaths) as $subpath) {
            $name = 'subquestion_'.strtolower(str_replace('/', '_', $subpath));
            $path = '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/QUESTIONS/QUESTION/'.$subpath;
            $paths[] = new convert_path($name, $path);
        }

        return $paths;
    }
public function get_paths ( ) { $ paths = array ( new convert_path ( 'question_categories' , '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES' ) , new convert_path ( 'question_category' , '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY' , array ( 'newfields' => array ( 'infoformat' => 0 ) ) ) , new convert_path ( 'question_category_context' , '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/CONTEXT' ) , new convert_path ( 'questions' , '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/QUESTIONS' ) , // the question element must be grouped so we can re-dispatch it to the qtype handler as a whole new convert_path ( 'question' , '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/QUESTIONS/QUESTION' , array ( ) , true ) , ) ; // annotate all question subpaths required by the qtypes subplugins $ subpaths = array ( ) ; foreach ( $ this -> get_qtype_handler ( '*' ) as $ qtypehandler ) { foreach ( $ qtypehandler -> get_question_subpaths ( ) as $ subpath ) { $ subpaths [ $ subpath ] = true ; } } foreach ( array_keys ( $ subpaths ) as $ subpath ) { $ name = 'subquestion_' . strtolower ( str_replace ( '/' , '_' , $ subpath ) ) ; $ path = '/MOODLE_BACKUP/COURSE/QUESTION_CATEGORIES/QUESTION_CATEGORY/QUESTIONS/QUESTION/' . $ subpath ; $ paths [ ] = new convert_path ( $ name , $ path ) ; } return $ paths ; }
Registers path that are not qtype-specific
Registers path that are not qtype - specific