protected function define_definition_plugin_structure() {

        // Append data only if the grand-parent element has 'method' set to 'rubric'
        $plugin = $this->get_plugin_element(null, '../../method', 'rubric');

        // Create a visible container for our data
        $pluginwrapper = new backup_nested_element($this->get_recommended_name());

        // Connect our visible container to the parent
        $plugin->add_child($pluginwrapper);

        // Define our elements

        $criteria = new backup_nested_element('criteria');

        $criterion = new backup_nested_element('criterion', array('id'), array(
            'sortorder', 'description', 'descriptionformat'));

        $levels = new backup_nested_element('levels');

        $level = new backup_nested_element('level', array('id'), array(
            'score', 'definition', 'definitionformat'));

        // Build elements hierarchy

        $pluginwrapper->add_child($criteria);
        $criteria->add_child($criterion);
        $criterion->add_child($levels);
        $levels->add_child($level);

        // Set sources to populate the data

        $criterion->set_source_table('gradingform_rubric_criteria',
                array('definitionid' => backup::VAR_PARENTID));

        $level->set_source_table('gradingform_rubric_levels',
                array('criterionid' => backup::VAR_PARENTID));

        // no need to annotate ids or files yet (one day when criterion definition supports
        // embedded files, they must be annotated here)

        return $plugin;
    }
protected function define_definition_plugin_structure() {

        // Append data only if the grand-parent element has 'method' set to 'rubric'
        $plugin = $this->get_plugin_element(null, '../../method', 'rubric');

        // Create a visible container for our data
        $pluginwrapper = new backup_nested_element($this->get_recommended_name());

        // Connect our visible container to the parent
        $plugin->add_child($pluginwrapper);

        // Define our elements

        $criteria = new backup_nested_element('criteria');

        $criterion = new backup_nested_element('criterion', array('id'), array(
            'sortorder', 'description', 'descriptionformat'));

        $levels = new backup_nested_element('levels');

        $level = new backup_nested_element('level', array('id'), array(
            'score', 'definition', 'definitionformat'));

        // Build elements hierarchy

        $pluginwrapper->add_child($criteria);
        $criteria->add_child($criterion);
        $criterion->add_child($levels);
        $levels->add_child($level);

        // Set sources to populate the data

        $criterion->set_source_table('gradingform_rubric_criteria',
                array('definitionid' => backup::VAR_PARENTID));

        $level->set_source_table('gradingform_rubric_levels',
                array('criterionid' => backup::VAR_PARENTID));

        // no need to annotate ids or files yet (one day when criterion definition supports
        // embedded files, they must be annotated here)

        return $plugin;
    }
protected function define_definition_plugin_structure ( ) { // Append data only if the grand-parent element has 'method' set to 'rubric' $ plugin = $ this -> get_plugin_element ( null , '../../method' , 'rubric' ) ; // Create a visible container for our data $ pluginwrapper = new backup_nested_element ( $ this -> get_recommended_name ( ) ) ; // Connect our visible container to the parent $ plugin -> add_child ( $ pluginwrapper ) ; // Define our elements $ criteria = new backup_nested_element ( 'criteria' ) ; $ criterion = new backup_nested_element ( 'criterion' , array ( 'id' ) , array ( 'sortorder' , 'description' , 'descriptionformat' ) ) ; $ levels = new backup_nested_element ( 'levels' ) ; $ level = new backup_nested_element ( 'level' , array ( 'id' ) , array ( 'score' , 'definition' , 'definitionformat' ) ) ; // Build elements hierarchy $ pluginwrapper -> add_child ( $ criteria ) ; $ criteria -> add_child ( $ criterion ) ; $ criterion -> add_child ( $ levels ) ; $ levels -> add_child ( $ level ) ; // Set sources to populate the data $ criterion -> set_source_table ( 'gradingform_rubric_criteria' , array ( 'definitionid' => backup :: VAR_PARENTID ) ) ; $ level -> set_source_table ( 'gradingform_rubric_levels' , array ( 'criterionid' => backup :: VAR_PARENTID ) ) ; // no need to annotate ids or files yet (one day when criterion definition supports // embedded files, they must be annotated here) return $ plugin ; }
Declares rubric structures to append to the grading form definition
Declares rubric structures to append to the grading form definition