protected function get_min_max_of_sd() {
        $min = $max = null;
        $set = false;

        foreach ($this->subqstats as $subqstat) {
            if (isset($subqstat->sd) && $subqstat->maxmark) {
                $value = $subqstat->sd / $subqstat->maxmark;
            } else {
                $value = null;
            }

            if (!$set) {    // It is not good enough to check if (!isset($min)),
                            // because $min might have been set to null in an earlier iteration.
                $min = $value;
                $max = $value;
                $set = true;
            }

            $min = $this->min($min, $value);
            $max = $this->max($max, $value);
        }

        return [$min, $max];
    }