original_string: protected function deprecated_constructor($course,
                                                $groupid=0,
                                                $itemlist='',
                                                $export_feedback=false,
                                                $updatedgradesonly = false,
                                                $displaytype = GRADE_DISPLAY_TYPE_REAL,
                                                $decimalpoints = 2,
                                                $onlyactive = false,
                                                $usercustomfields = false) {
  
          debugging('Many argument constructor for class "grade_export" is deprecated. Call the 3 argument version instead.', DEBUG_DEVELOPER);
  
          $this->course = $course;
          $this->groupid = $groupid;
  
          $this->grade_items = grade_item::fetch_all(array('courseid'=>$this->course->id));
          //Populating the columns here is required by /grade/export/(whatever)/export.php
          //however index.php, when the form is submitted, will construct the collection here
          //with an empty $itemlist then reconstruct it in process_form() using $formdata
          $this->columns = array();
          if (!empty($itemlist)) {
              if ($itemlist=='-1') {
                  //user deselected all items
              } else {
                  $itemids = explode(',', $itemlist);
                  // remove items that are not requested
                  foreach ($itemids as $itemid) {
                      if (array_key_exists($itemid, $this->grade_items)) {
                          $this->columns[$itemid] =& $this->grade_items[$itemid];
                      }
                  }
              }
          } else {
              foreach ($this->grade_items as $itemid=>$unused) {
                  $this->columns[$itemid] =& $this->grade_items[$itemid];
              }
          }
  
          $this->export_feedback = $export_feedback;
          $this->userkey         = '';
          $this->previewrows     = false;
          $this->updatedgradesonly = $updatedgradesonly;
  
          $this->displaytype = $displaytype;
          $this->decimalpoints = $decimalpoints;
          $this->onlyactive = $onlyactive;
          $this->usercustomfields = $usercustomfields;
      }
code: protected function deprecated_constructor($course,
                                                $groupid=0,
                                                $itemlist='',
                                                $export_feedback=false,
                                                $updatedgradesonly = false,
                                                $displaytype = GRADE_DISPLAY_TYPE_REAL,
                                                $decimalpoints = 2,
                                                $onlyactive = false,
                                                $usercustomfields = false) {
  
          debugging('Many argument constructor for class "grade_export" is deprecated. Call the 3 argument version instead.', DEBUG_DEVELOPER);
  
          $this->course = $course;
          $this->groupid = $groupid;
  
          $this->grade_items = grade_item::fetch_all(array('courseid'=>$this->course->id));
          //Populating the columns here is required by /grade/export/(whatever)/export.php
          //however index.php, when the form is submitted, will construct the collection here
          //with an empty $itemlist then reconstruct it in process_form() using $formdata
          $this->columns = array();
          if (!empty($itemlist)) {
              if ($itemlist=='-1') {
                  //user deselected all items
              } else {
                  $itemids = explode(',', $itemlist);
                  // remove items that are not requested
                  foreach ($itemids as $itemid) {
                      if (array_key_exists($itemid, $this->grade_items)) {
                          $this->columns[$itemid] =& $this->grade_items[$itemid];
                      }
                  }
              }
          } else {
              foreach ($this->grade_items as $itemid=>$unused) {
                  $this->columns[$itemid] =& $this->grade_items[$itemid];
              }
          }
  
          $this->export_feedback = $export_feedback;
          $this->userkey         = '';
          $this->previewrows     = false;
          $this->updatedgradesonly = $updatedgradesonly;
  
          $this->displaytype = $displaytype;
          $this->decimalpoints = $decimalpoints;
          $this->onlyactive = $onlyactive;
          $this->usercustomfields = $usercustomfields;
      }
code_tokens: protected function deprecated_constructor ( $ course , $ groupid = 0 , $ itemlist = '' , $ export_feedback = false , $ updatedgradesonly = false , $ displaytype = GRADE_DISPLAY_TYPE_REAL , $ decimalpoints = 2 , $ onlyactive = false , $ usercustomfields = false ) { debugging ( 'Many argument constructor for class "grade_export" is deprecated. Call the 3 argument version instead.' , DEBUG_DEVELOPER ) ; $ this -> course = $ course ; $ this -> groupid = $ groupid ; $ this -> grade_items = grade_item :: fetch_all ( array ( 'courseid' => $ this -> course -> id ) ) ; //Populating the columns here is required by /grade/export/(whatever)/export.php //however index.php, when the form is submitted, will construct the collection here //with an empty $itemlist then reconstruct it in process_form() using $formdata $ this -> columns = array ( ) ; if ( ! empty ( $ itemlist ) ) { if ( $ itemlist == '-1' ) { //user deselected all items } else { $ itemids = explode ( ',' , $ itemlist ) ; // remove items that are not requested foreach ( $ itemids as $ itemid ) { if ( array_key_exists ( $ itemid , $ this -> grade_items ) ) { $ this -> columns [ $ itemid ] = & $ this -> grade_items [ $ itemid ] ; } } } } else { foreach ( $ this -> grade_items as $ itemid => $ unused ) { $ this -> columns [ $ itemid ] = & $ this -> grade_items [ $ itemid ] ; } } $ this -> export_feedback = $ export_feedback ; $ this -> userkey = '' ; $ this -> previewrows = false ; $ this -> updatedgradesonly = $ updatedgradesonly ; $ this -> displaytype = $ displaytype ; $ this -> decimalpoints = $ decimalpoints ; $ this -> onlyactive = $ onlyactive ; $ this -> usercustomfields = $ usercustomfields ; }
docstring: Old deprecated constructor.
  
  This deprecated constructor accepts the individual parameters as separate arguments, in
  2.8 this was simplified to just accept the data from the moodle form.
  
  @deprecated since 2.8 MDL-46548. Instead call the shortened constructor which accepts the data
  directly from the grade_export_form.
docstring_tokens: Old deprecated constructor .