diff --git a/classes/local/dash_framework/structure/videotime_session_table.php b/classes/local/dash_framework/structure/videotime_session_table.php index 500f105f..3e3fae4a 100644 --- a/classes/local/dash_framework/structure/videotime_session_table.php +++ b/classes/local/dash_framework/structure/videotime_session_table.php @@ -122,7 +122,14 @@ public function get_fields(): array { ]), new field('status', new lang_string('activitystatus', 'videotime'), $this, 'MAX(cmc.completionstate)', [ new completion_status_attribute() - ]) + ]), + new field('timecompleted', new lang_string('timecompleted', 'videotime'), $this, 'CASE + WHEN MAX(cmc.completionstate) > 0 + THEN MAX(cmc.timemodified) + ELSE NULL + END', [ + new date_attribute() + ]), ]; $fields = array_merge($fields, $addfields); } diff --git a/lang/en/videotime.php b/lang/en/videotime.php index 2b42c763..95d2949f 100644 --- a/lang/en/videotime.php +++ b/lang/en/videotime.php @@ -280,6 +280,7 @@ $string['tabs'] = 'Tabs'; $string['generalsettings'] = 'General settings'; $string['taskscheduled'] = 'Task scheduled for next cron run'; +$string['timecompleted'] = 'Time completed'; $string['timestarted'] = 'Date started'; $string['todo'] = 'TODO'; $string['totaluniquevisitors'] = 'Total unique visitors';