Skip to content

Commit

Permalink
MDL-71927 reports: show time to the second in logs report
Browse files Browse the repository at this point in the history
And in the question history in quiz reviews.

Without this, it can be difficult to investigate some problems.
  • Loading branch information
timhunt committed Jun 14, 2021
1 parent 9533e8d commit b4bbbf1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lang/en/langconfig.php
Expand Up @@ -43,7 +43,9 @@
$string['strftimedateshort'] = '%d %B';
$string['strftimedateshortmonthabbr'] = '%d %b';
$string['strftimedatetime'] = '%d %B %Y, %I:%M %p';
$string['strftimedatetimeaccurate'] = '%d %B %Y, %I:%M:%S %p';
$string['strftimedatetimeshort'] = '%d/%m/%y, %H:%M';
$string['strftimedatetimeshortaccurate'] = '%d/%m/%y, %H:%M:%S';
$string['strftimedaydate'] = '%A, %d %B %Y';
$string['strftimedaydatetime'] = '%A, %d %B %Y, %I:%M %p';
$string['strftimedayshort'] = '%A, %d %B';
Expand Down
2 changes: 2 additions & 0 deletions lib/classes/string_manager_standard.php
Expand Up @@ -302,7 +302,9 @@ public function get_string($identifier, $component = '', $a = null, $lang = null
'strftimedatefullshort' => 1,
'strftimedateshort' => 1,
'strftimedatetime' => 1,
'strftimedatetimeaccurate' => 1,
'strftimedatetimeshort' => 1,
'strftimedatetimeshortaccurate' => 1,
'strftimedaydate' => 1,
'strftimedaydatetime' => 1,
'strftimedayshort' => 1,
Expand Down
2 changes: 1 addition & 1 deletion question/engine/renderer.php
Expand Up @@ -472,7 +472,7 @@ protected function response_history(question_attempt $qa, qbehaviour_renderer $b
$restrictedqa = new question_attempt_with_restricted_history($qa, $i, null);

$row = [$stepno,
userdate($step->get_timecreated(), get_string('strftimedatetimeshort')),
userdate($step->get_timecreated(), get_string('strftimedatetimeshortaccurate', 'core_langconfig')),
s($qa->summarise_action($step)) . $this->action_author($step, $options),
$restrictedqa->get_state_string($options->correctness)];

Expand Down
4 changes: 2 additions & 2 deletions report/log/classes/table_log.php
Expand Up @@ -145,9 +145,9 @@ protected function get_user_fullname($userid) {
public function col_time($event) {

if (empty($this->download)) {
$dateformat = get_string('strftimedatetime', 'core_langconfig');
$dateformat = get_string('strftimedatetimeaccurate', 'core_langconfig');
} else {
$dateformat = get_string('strftimedatetimeshort', 'core_langconfig');
$dateformat = get_string('strftimedatetimeshortaccurate', 'core_langconfig');
}
return userdate($event->timecreated, $dateformat);
}
Expand Down
2 changes: 1 addition & 1 deletion report/loglive/classes/table_log.php
Expand Up @@ -116,7 +116,7 @@ public function col_course($event) {
* @return string HTML for the time column
*/
public function col_time($event) {
$recenttimestr = get_string('strftimedatetime', 'core_langconfig');
$recenttimestr = get_string('strftimedatetimeaccurate', 'core_langconfig');
return userdate($event->timecreated, $recenttimestr);
}

Expand Down

0 comments on commit b4bbbf1

Please sign in to comment.