From 9e2101a2069914563da2f16430e95e22fd2af22e Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Wed, 12 Jun 2019 20:27:41 +0200 Subject: [PATCH] MDL-57487 mod_scorm: final deprecation xxx_print_overview --- mod/scorm/lib.php | 55 +++-------------------------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index ae9672e885e..e25645476e6 100644 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -1101,59 +1101,10 @@ function scorm_debug_log_remove($type, $scoid) { } /** - * writes overview info for course_overview block - displays upcoming scorm objects that have a due date - * - * @deprecated since 3.3 - * @todo The final deprecation of this function will take place in Moodle 3.7 - see MDL-57487. - * @param object $type - type of log(aicc,scorm12,scorm13) used as prefix for filename - * @param array $htmlarray - * @return mixed + * @deprecated since Moodle 3.3, when the block_course_overview block was removed. */ -function scorm_print_overview($courses, &$htmlarray) { - global $USER, $CFG; - - debugging('The function scorm_print_overview() is now deprecated.', DEBUG_DEVELOPER); - - if (empty($courses) || !is_array($courses) || count($courses) == 0) { - return array(); - } - - if (!$scorms = get_all_instances_in_courses('scorm', $courses)) { - return; - } - - $strscorm = get_string('modulename', 'scorm'); - $strduedate = get_string('duedate', 'scorm'); - - foreach ($scorms as $scorm) { - $time = time(); - $showattemptstatus = false; - if ($scorm->timeopen) { - $isopen = ($scorm->timeopen <= $time && $time <= $scorm->timeclose); - } - if ($scorm->displayattemptstatus == SCORM_DISPLAY_ATTEMPTSTATUS_ALL || - $scorm->displayattemptstatus == SCORM_DISPLAY_ATTEMPTSTATUS_MY) { - $showattemptstatus = true; - } - if ($showattemptstatus || !empty($isopen) || !empty($scorm->timeclose)) { - $str = html_writer::start_div('scorm overview').html_writer::div($strscorm. ': '. - html_writer::link($CFG->wwwroot.'/mod/scorm/view.php?id='.$scorm->coursemodule, $scorm->name, - array('title' => $strscorm, 'class' => $scorm->visible ? '' : 'dimmed')), 'name'); - if ($scorm->timeclose) { - $str .= html_writer::div($strduedate.': '.userdate($scorm->timeclose), 'info'); - } - if ($showattemptstatus) { - require_once($CFG->dirroot.'/mod/scorm/locallib.php'); - $str .= html_writer::div(scorm_get_attempt_status($USER, $scorm), 'details'); - } - $str .= html_writer::end_div(); - if (empty($htmlarray[$scorm->course]['scorm'])) { - $htmlarray[$scorm->course]['scorm'] = $str; - } else { - $htmlarray[$scorm->course]['scorm'] .= $str; - } - } - } +function scorm_print_overview() { + throw new coding_exception('scorm_print_overview() can not be used any more and is obsolete.'); } /**