public function get_total_logs() {
        global $DB;

        // No logs if no students.
        if (empty($this->get_students())) {
            return 0;
        }

        if ($this->ntotallogs === null) {
            list($filterselect, $filterparams) = $this->course_students_query_filter();
            if (!$logstore = \core_analytics\manager::get_analytics_logstore()) {
                $this->ntotallogs = 0;
            } else {
                $this->ntotallogs = $logstore->get_events_select_count($filterselect, $filterparams);
            }
        }

        return $this->ntotallogs;
    }