MDL-57487 mod_scorm: final deprecation xxx_print_overview

This commit is contained in:
Sara Arjona
2019-06-14 17:41:18 +02:00
parent c023ce5873
commit 9e2101a206
+3 -52
View File
@@ -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.');
}
/**