protected function get_completion_active_rule_descriptions($moduledata) {
        $activeruledescriptions = [];

        if ($moduledata->completion == COMPLETION_TRACKING_AUTOMATIC) {
            // Generate the description strings for the core conditional completion rules (if set).
            if (!empty($moduledata->completionview)) {
                $activeruledescriptions[] = get_string('completionview_desc', 'completion');
            }
            if ($moduledata instanceof cm_info && !is_null($moduledata->completiongradeitemnumber) ||
                ($moduledata instanceof stdClass && !empty($moduledata->completionusegrade))) {
                $activeruledescriptions[] = get_string('completionusegrade_desc', 'completion');
            }

            // Now, ask the module to provide descriptions for its custom conditional completion rules.
            if ($customruledescriptions = component_callback($moduledata->modname,
                'get_completion_active_rule_descriptions', [$moduledata])) {
                $activeruledescriptions = array_merge($activeruledescriptions, $customruledescriptions);
            }
        }

        if ($moduledata->completion != COMPLETION_TRACKING_NONE) {
            if (!empty($moduledata->completionexpected)) {
                $activeruledescriptions[] = get_string('completionexpecteddesc', 'completion',
                    userdate($moduledata->completionexpected));
            }
        }

        return $activeruledescriptions;
    }