original_string: public function cache($qubaids) {
          global $DB;
  
          $toinsert = new \stdClass();
  
          foreach ($this->fieldsindb as $field) {
              $toinsert->{$field} = $this->{$field};
          }
  
          $toinsert->hashcode = $qubaids->get_hash_code();
          $toinsert->timemodified = time();
  
          // Fix up some dodgy data.
          if (isset($toinsert->errorratio) && is_nan($toinsert->errorratio)) {
              $toinsert->errorratio = null;
          }
          if (isset($toinsert->standarderror) && is_nan($toinsert->standarderror)) {
              $toinsert->standarderror = null;
          }
  
          // Store the data.
          $DB->insert_record('quiz_statistics', $toinsert);
  
      }
code: public function cache($qubaids) {
          global $DB;
  
          $toinsert = new \stdClass();
  
          foreach ($this->fieldsindb as $field) {
              $toinsert->{$field} = $this->{$field};
          }
  
          $toinsert->hashcode = $qubaids->get_hash_code();
          $toinsert->timemodified = time();
  
          // Fix up some dodgy data.
          if (isset($toinsert->errorratio) && is_nan($toinsert->errorratio)) {
              $toinsert->errorratio = null;
          }
          if (isset($toinsert->standarderror) && is_nan($toinsert->standarderror)) {
              $toinsert->standarderror = null;
          }
  
          // Store the data.
          $DB->insert_record('quiz_statistics', $toinsert);
  
      }
code_tokens: public function cache ( $ qubaids ) { global $ DB ; $ toinsert = new \ stdClass ( ) ; foreach ( $ this -> fieldsindb as $ field ) { $ toinsert -> { $ field } = $ this -> { $ field } ; } $ toinsert -> hashcode = $ qubaids -> get_hash_code ( ) ; $ toinsert -> timemodified = time ( ) ; // Fix up some dodgy data. if ( isset ( $ toinsert -> errorratio ) && is_nan ( $ toinsert -> errorratio ) ) { $ toinsert -> errorratio = null ; } if ( isset ( $ toinsert -> standarderror ) && is_nan ( $ toinsert -> standarderror ) ) { $ toinsert -> standarderror = null ; } // Store the data. $ DB -> insert_record ( 'quiz_statistics' , $ toinsert ) ; }
docstring: Cache the stats contained in this class.
  
  @param $qubaids \qubaid_condition
docstring_tokens: Cache the stats contained in this class .