#118 Fixed issue with activity dates not displaying
This commit is contained in:
parent
0f206bccbb
commit
8c84adeb8d
1 changed files with 3 additions and 5 deletions
|
@ -135,7 +135,7 @@ class element extends \mod_customcert\element {
|
||||||
if ($dateitem == CUSTOMCERT_DATE_ISSUE) {
|
if ($dateitem == CUSTOMCERT_DATE_ISSUE) {
|
||||||
$date = $issue->timecreated;
|
$date = $issue->timecreated;
|
||||||
} else if ($dateitem == CUSTOMCERT_DATE_COMPLETION) {
|
} else if ($dateitem == CUSTOMCERT_DATE_COMPLETION) {
|
||||||
// Get the enrolment end date.
|
// Get the last completion date.
|
||||||
$sql = "SELECT MAX(c.timecompleted) as timecompleted
|
$sql = "SELECT MAX(c.timecompleted) as timecompleted
|
||||||
FROM {course_completions} c
|
FROM {course_completions} c
|
||||||
WHERE c.userid = :userid
|
WHERE c.userid = :userid
|
||||||
|
@ -150,10 +150,8 @@ class element extends \mod_customcert\element {
|
||||||
} else if ($dateitem == CUSTOMCERT_DATE_COURSE_END) {
|
} else if ($dateitem == CUSTOMCERT_DATE_COURSE_END) {
|
||||||
$date = $DB->get_field('course', 'enddate', array('id' => $courseid));
|
$date = $DB->get_field('course', 'enddate', array('id' => $courseid));
|
||||||
} else {
|
} else {
|
||||||
$gradeitem = new \stdClass();
|
if ($modinfo = \customcertelement_grade\element::get_mod_grade($dateitem, GRADE_DISPLAY_TYPE_PERCENTAGE,
|
||||||
$gradeitem->gradeitem = $dateitem;
|
$issue->userid)) {
|
||||||
$gradeitem->gradeformat = GRADE_DISPLAY_TYPE_PERCENTAGE;
|
|
||||||
if ($modinfo = \customcertelement_grade\element::get_grade($gradeitem, $issue->userid, $courseid)) {
|
|
||||||
if (!empty($modinfo->dategraded)) {
|
if (!empty($modinfo->dategraded)) {
|
||||||
$date = $modinfo->dategraded;
|
$date = $modinfo->dategraded;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue