protected function get_child_module($cm) {
        $cmid = is_object($cm) ? $cm->id : $cm;
        if (!array_key_exists($cmid, $this->childrenmodules)) {
            $this->childrenmodules[$cmid] = null;
            if (!($cm instanceof cm_info)) {
                $cms = get_fast_modinfo($this->course)->cms;
                $cm = array_key_exists($cmid, $cms) ? $cms[$cmid] : null;
            }
            if ($cm && $cm->uservisible) {
                $this->childrenmodules[$cmid] = new file_info_context_module($this->browser,
                    $cm->context, $this->course, $cm, $cm->modname);
            }
        }
        return $this->childrenmodules[$cmid];
    }