original_string: public function qualifies_for_regrading() {
          if (empty($this->id)) {
              return false;
          }
  
          $db_item = new grade_item(array('id' => $this->id));
  
          $calculationdiff = $db_item->calculation != $this->calculation;
          $categorydiff    = $db_item->categoryid  != $this->categoryid;
          $gradetypediff   = $db_item->gradetype   != $this->gradetype;
          $scaleiddiff     = $db_item->scaleid     != $this->scaleid;
          $outcomeiddiff   = $db_item->outcomeid   != $this->outcomeid;
          $locktimediff    = $db_item->locktime    != $this->locktime;
          $grademindiff    = grade_floats_different($db_item->grademin,        $this->grademin);
          $grademaxdiff    = grade_floats_different($db_item->grademax,        $this->grademax);
          $multfactordiff  = grade_floats_different($db_item->multfactor,      $this->multfactor);
          $plusfactordiff  = grade_floats_different($db_item->plusfactor,      $this->plusfactor);
          $acoefdiff       = grade_floats_different($db_item->aggregationcoef, $this->aggregationcoef);
          $acoefdiff2      = grade_floats_different($db_item->aggregationcoef2, $this->aggregationcoef2);
          $weightoverride  = grade_floats_different($db_item->weightoverride, $this->weightoverride);
  
          $needsupdatediff = !$db_item->needsupdate &&  $this->needsupdate;    // force regrading only if setting the flag first time
          $lockeddiff      = !empty($db_item->locked) && empty($this->locked); // force regrading only when unlocking
  
          return ($calculationdiff || $categorydiff || $gradetypediff || $grademaxdiff || $grademindiff || $scaleiddiff
               || $outcomeiddiff || $multfactordiff || $plusfactordiff || $needsupdatediff
               || $lockeddiff || $acoefdiff || $acoefdiff2 || $weightoverride || $locktimediff);
      }
code: public function qualifies_for_regrading() {
          if (empty($this->id)) {
              return false;
          }
  
          $db_item = new grade_item(array('id' => $this->id));
  
          $calculationdiff = $db_item->calculation != $this->calculation;
          $categorydiff    = $db_item->categoryid  != $this->categoryid;
          $gradetypediff   = $db_item->gradetype   != $this->gradetype;
          $scaleiddiff     = $db_item->scaleid     != $this->scaleid;
          $outcomeiddiff   = $db_item->outcomeid   != $this->outcomeid;
          $locktimediff    = $db_item->locktime    != $this->locktime;
          $grademindiff    = grade_floats_different($db_item->grademin,        $this->grademin);
          $grademaxdiff    = grade_floats_different($db_item->grademax,        $this->grademax);
          $multfactordiff  = grade_floats_different($db_item->multfactor,      $this->multfactor);
          $plusfactordiff  = grade_floats_different($db_item->plusfactor,      $this->plusfactor);
          $acoefdiff       = grade_floats_different($db_item->aggregationcoef, $this->aggregationcoef);
          $acoefdiff2      = grade_floats_different($db_item->aggregationcoef2, $this->aggregationcoef2);
          $weightoverride  = grade_floats_different($db_item->weightoverride, $this->weightoverride);
  
          $needsupdatediff = !$db_item->needsupdate &&  $this->needsupdate;    // force regrading only if setting the flag first time
          $lockeddiff      = !empty($db_item->locked) && empty($this->locked); // force regrading only when unlocking
  
          return ($calculationdiff || $categorydiff || $gradetypediff || $grademaxdiff || $grademindiff || $scaleiddiff
               || $outcomeiddiff || $multfactordiff || $plusfactordiff || $needsupdatediff
               || $lockeddiff || $acoefdiff || $acoefdiff2 || $weightoverride || $locktimediff);
      }
code_tokens: public function qualifies_for_regrading ( ) { if ( empty ( $ this -> id ) ) { return false ; } $ db_item = new grade_item ( array ( 'id' => $ this -> id ) ) ; $ calculationdiff = $ db_item -> calculation != $ this -> calculation ; $ categorydiff = $ db_item -> categoryid != $ this -> categoryid ; $ gradetypediff = $ db_item -> gradetype != $ this -> gradetype ; $ scaleiddiff = $ db_item -> scaleid != $ this -> scaleid ; $ outcomeiddiff = $ db_item -> outcomeid != $ this -> outcomeid ; $ locktimediff = $ db_item -> locktime != $ this -> locktime ; $ grademindiff = grade_floats_different ( $ db_item -> grademin , $ this -> grademin ) ; $ grademaxdiff = grade_floats_different ( $ db_item -> grademax , $ this -> grademax ) ; $ multfactordiff = grade_floats_different ( $ db_item -> multfactor , $ this -> multfactor ) ; $ plusfactordiff = grade_floats_different ( $ db_item -> plusfactor , $ this -> plusfactor ) ; $ acoefdiff = grade_floats_different ( $ db_item -> aggregationcoef , $ this -> aggregationcoef ) ; $ acoefdiff2 = grade_floats_different ( $ db_item -> aggregationcoef2 , $ this -> aggregationcoef2 ) ; $ weightoverride = grade_floats_different ( $ db_item -> weightoverride , $ this -> weightoverride ) ; $ needsupdatediff = ! $ db_item -> needsupdate && $ this -> needsupdate ; // force regrading only if setting the flag first time $ lockeddiff = ! empty ( $ db_item -> locked ) && empty ( $ this -> locked ) ; // force regrading only when unlocking return ( $ calculationdiff || $ categorydiff || $ gradetypediff || $ grademaxdiff || $ grademindiff || $ scaleiddiff || $ outcomeiddiff || $ multfactordiff || $ plusfactordiff || $ needsupdatediff || $ lockeddiff || $ acoefdiff || $ acoefdiff2 || $ weightoverride || $ locktimediff ) ; }
docstring: Compares the values held by this object with those of the matching record in DB, and returns
  whether or not these differences are sufficient to justify an update of all parent objects.
  This assumes that this object has an id number and a matching record in DB. If not, it will return false.
  
  @return bool
docstring_tokens: Compares the values held by this object with those of the matching record in DB and returns whether or not these differences are sufficient to justify an update of all parent objects . This assumes that this object has an id number and a matching record in DB . If not it will return false .