/** * Get the right field name to fetch a stat for these attempts that is calculated for more than one $whichattempts (count or * avg). * * @param string $field name of field * @return int|float */ protected function get_field($field) { $fieldname = calculator::using_attempts_string_id($this->whichattempts) . $field; return $this->{$fieldname}; }