original_string: protected function convert_legacy_criterion_elements() {
  
          $this->write_xml('workshopform_rubric_config', array('layout' => 'list'));
  
          $firstelement = reset($this->elements);
          if ($firstelement === false) {
              // no elements defined in moodle.xml
              return;
          }
  
          // write the xml describing the artificial single rubric item
          $this->xmlwriter->begin_tag('workshopform_rubric_dimension', array('id' => $firstelement['id']));
          $this->xmlwriter->full_tag('sort', 1);
          $this->xmlwriter->full_tag('description', trim(get_string('dimensionnumber', 'workshopform_rubric', '')));
          $this->xmlwriter->full_tag('descriptionformat', FORMAT_HTML);
  
          foreach ($this->elements as $element) {
              $this->write_xml('workshopform_rubric_level', array(
                  'id'               => $element['id'],
                  'grade'            => $element['maxscore'],
                  'definition'       => $element['description'],
                  'definitionformat' => FORMAT_HTML
              ), array('/workshopform_rubric_level/id'));
          }
  
          $this->xmlwriter->end_tag('workshopform_rubric_dimension');
      }
code: protected function convert_legacy_criterion_elements() {
  
          $this->write_xml('workshopform_rubric_config', array('layout' => 'list'));
  
          $firstelement = reset($this->elements);
          if ($firstelement === false) {
              // no elements defined in moodle.xml
              return;
          }
  
          // write the xml describing the artificial single rubric item
          $this->xmlwriter->begin_tag('workshopform_rubric_dimension', array('id' => $firstelement['id']));
          $this->xmlwriter->full_tag('sort', 1);
          $this->xmlwriter->full_tag('description', trim(get_string('dimensionnumber', 'workshopform_rubric', '')));
          $this->xmlwriter->full_tag('descriptionformat', FORMAT_HTML);
  
          foreach ($this->elements as $element) {
              $this->write_xml('workshopform_rubric_level', array(
                  'id'               => $element['id'],
                  'grade'            => $element['maxscore'],
                  'definition'       => $element['description'],
                  'definitionformat' => FORMAT_HTML
              ), array('/workshopform_rubric_level/id'));
          }
  
          $this->xmlwriter->end_tag('workshopform_rubric_dimension');
      }
code_tokens: protected function convert_legacy_criterion_elements ( ) { $ this -> write_xml ( 'workshopform_rubric_config' , array ( 'layout' => 'list' ) ) ; $ firstelement = reset ( $ this -> elements ) ; if ( $ firstelement === false ) { // no elements defined in moodle.xml return ; } // write the xml describing the artificial single rubric item $ this -> xmlwriter -> begin_tag ( 'workshopform_rubric_dimension' , array ( 'id' => $ firstelement [ 'id' ] ) ) ; $ this -> xmlwriter -> full_tag ( 'sort' , 1 ) ; $ this -> xmlwriter -> full_tag ( 'description' , trim ( get_string ( 'dimensionnumber' , 'workshopform_rubric' , '' ) ) ) ; $ this -> xmlwriter -> full_tag ( 'descriptionformat' , FORMAT_HTML ) ; foreach ( $ this -> elements as $ element ) { $ this -> write_xml ( 'workshopform_rubric_level' , array ( 'id' => $ element [ 'id' ] , 'grade' => $ element [ 'maxscore' ] , 'definition' => $ element [ 'description' ] , 'definitionformat' => FORMAT_HTML ) , array ( '/workshopform_rubric_level/id' ) ) ; } $ this -> xmlwriter -> end_tag ( 'workshopform_rubric_dimension' ) ; }
docstring: Processes gathered elements coming from the legacy criterion strategy
  
  Legacy criterion strategy is converted to a rubric with single rubric item
  and the layout set to 'list'.
docstring_tokens: Processes gathered elements coming from the legacy criterion strategy