public function get_progress_proportion_range() {
        // If there is no progress underway, we must have finished.
        if (empty($this->currents)) {
            return array(1.0, 1.0);
        }
        $count = count($this->currents);
        $min = 0.0;
        $max = 1.0;
        for ($i = 0; $i < $count; $i++) {
            // Get max value at that section - if it's indeterminate we can tell
            // no more.
            $sectionmax = $this->maxes[$i];
            if ($sectionmax === self::INDETERMINATE) {
                return array($min, $max);
            }

            // Special case if current value is max (this should only happen
            // just before ending a section).
            $sectioncurrent = $this->currents[$i];
            if ($sectioncurrent === $sectionmax) {
                return array($max, $max);
            }

            // Using the current value at that section, we know we are somewhere
            // between 'current' and the next 'current' value which depends on
            // the parentcount of the nested section (if any).
            $newmin = ($sectioncurrent / $sectionmax) * ($max - $min) + $min;
            $nextcurrent = $sectioncurrent + 1;
            if ($i + 1 < $count) {
                $weight = $this->parentcounts[$i + 1];
                $nextcurrent = $sectioncurrent + $weight;
            }
            $newmax = ($nextcurrent / $sectionmax) * ($max - $min) + $min;
            $min = $newmin;
            $max = $newmax;
        }

        // If there was nothing indeterminate, we use the min value as current.
        return array($min, $min);
    }