Skip to content

Commit

Permalink
WR422914 Plugin update with lang string changes and cron fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonThornett committed Nov 8, 2024
1 parent 5adb32f commit 8e2704e
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 47 deletions.
5 changes: 3 additions & 2 deletions classes/frequency.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public function get_event_users_raw(int $contextid, string $module): array {
$users = $users + get_users_from_role_on_context($role, $coursecontext);
}

$this->eventuserscache[$cachekey] = array_column($users, 'userid');
$this->eventuserscache[$cachekey] = $users;
return $this->eventuserscache[$cachekey];
}

Expand Down Expand Up @@ -1025,7 +1025,8 @@ public function get_events_due_by_activity(int $year, int $month = 0, bool $cach
$params = [];
$sql = 'SELECT s.module, COUNT(s.id) as count
FROM {local_assessfreq_site} s
LEFT JOIN {course} c ON s.courseid = c.id ';
LEFT JOIN {course} c ON s.courseid = c.id
WHERE 1=1';

$includehiddencourses = get_config('local_assessfreq', 'hiddencourses');
if (!$includehiddencourses) {
Expand Down
2 changes: 1 addition & 1 deletion report/student_search/classes/output/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function render_report() {
],
'table' => [
'id' => 'assessfreqreport-student-search',
'name' => get_string('studentsearch:head', 'assessfreqreport_student_search'),
'name' => get_string('student_search:head', 'assessfreqreport_student_search'),
'rows' => [$rows[$preferencerows] => 'true'],
]
]
Expand Down
40 changes: 20 additions & 20 deletions report/student_search/classes/output/user_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function __construct(
$columns[] = $field;
}

$headers[] = get_string('studentsearch:quiz', 'assessfreqreport_student_search');
$headers[] = get_string('student_search:quiz', 'assessfreqreport_student_search');
$columns[] = 'quizname';

$this->define_columns(array_merge($columns, $this->get_common_columns()));
Expand Down Expand Up @@ -143,9 +143,9 @@ public function col_fullname($row): string {
*/
public function col_timestart($row) {
if ($row->timestart == 0) {
$content = \html_writer::span(get_string('studentsearch:na', 'assessfreqreport_student_search'));
$content = \html_writer::span(get_string('student_search:na', 'assessfreqreport_student_search'));
} else {
$datetime = userdate($row->timestart, get_string('studentsearch:trenddatetime', 'assessfreqreport_student_search'));
$datetime = userdate($row->timestart, get_string('student_search:trenddatetime', 'assessfreqreport_student_search'));
$content = \html_writer::span($datetime);
}

Expand All @@ -161,13 +161,13 @@ public function col_timestart($row) {
*/
public function col_timefinish($row) {
if ($row->timefinish == 0 && $row->timestart == 0) {
$content = \html_writer::span(get_string('studentsearch:na', 'assessfreqreport_student_search'));
$content = \html_writer::span(get_string('student_search:na', 'assessfreqreport_student_search'));
} else if ($row->timefinish == 0 && $row->timestart > 0) {
$time = $row->timestart + $row->timelimit;
$datetime = userdate($time, get_string('studentsearch:trenddatetime', 'assessfreqreport_student_search'));
$datetime = userdate($time, get_string('student_search:trenddatetime', 'assessfreqreport_student_search'));
$content = \html_writer::span($datetime, 'local-assessfreq-disabled');
} else {
$datetime = userdate($row->timefinish, get_string('studentsearch:trenddatetime', 'assessfreqreport_student_search'));
$datetime = userdate($row->timefinish, get_string('student_search:trenddatetime', 'assessfreqreport_student_search'));
$content = \html_writer::span($datetime);
}

Expand Down Expand Up @@ -199,7 +199,7 @@ public function col_state($row) {
}

$content = \html_writer::span('', 'local-assessfreq-status-icon', ['style' => $color]);
$content .= get_string('studentsearch:'.$row->state, 'assessfreqreport_student_search');
$content .= get_string('student_search:'.$row->state, 'assessfreqreport_student_search');

return $content;
}
Expand All @@ -211,13 +211,13 @@ public function col_state($row) {
*/
protected function get_common_headers(): array {
return [
get_string('studentsearch:quiztimeopen', 'assessfreqreport_student_search'),
get_string('studentsearch:quiztimeclose', 'assessfreqreport_student_search'),
get_string('studentsearch:quiztimelimit', 'assessfreqreport_student_search'),
get_string('studentsearch:quiztimestart', 'assessfreqreport_student_search'),
get_string('studentsearch:quiztimefinish', 'assessfreqreport_student_search'),
get_string('studentsearch:status', 'assessfreqreport_student_search'),
get_string('studentsearch:actions', 'assessfreqreport_student_search'),
get_string('student_search:quiztimeopen', 'assessfreqreport_student_search'),
get_string('student_search:quiztimeclose', 'assessfreqreport_student_search'),
get_string('student_search:quiztimelimit', 'assessfreqreport_student_search'),
get_string('student_search:quiztimestart', 'assessfreqreport_student_search'),
get_string('student_search:quiztimefinish', 'assessfreqreport_student_search'),
get_string('student_search:status', 'assessfreqreport_student_search'),
get_string('student_search:actions', 'assessfreqreport_student_search'),
];
}

Expand Down Expand Up @@ -261,7 +261,7 @@ protected function get_common_column_actions(\stdClass $row): string {
'id' => 'tool-assessfreq-attempt-' . $row->id,
'data-toggle' => 'tooltip',
'data-placement' => 'top',
'title' => get_string('studentsearch:userattempt', 'assessfreqreport_student_search'),
'title' => get_string('student_search:userattempt', 'assessfreqreport_student_search'),
];
} else {
$classes = 'action-icon disabled';
Expand All @@ -281,7 +281,7 @@ protected function get_common_column_actions(\stdClass $row): string {
'id' => 'tool-assessfreq-profile-' . $row->id,
'data-toggle' => 'tooltip',
'data-placement' => 'top',
'title' => get_string('studentsearch:userprofile', 'assessfreqreport_student_search'),
'title' => get_string('student_search:userprofile', 'assessfreqreport_student_search'),
]);

$logurl = new \moodle_url('/report/log/user.php', ['id' => $row->id, 'course' => 1, 'mode' => 'all']);
Expand All @@ -291,7 +291,7 @@ protected function get_common_column_actions(\stdClass $row): string {
'id' => 'tool-assessfreq-log-' . $row->id,
'data-toggle' => 'tooltip',
'data-placement' => 'top',
'title' => get_string('studentsearch:userlogs', 'assessfreqreport_student_search'),
'title' => get_string('student_search:userlogs', 'assessfreqreport_student_search'),
]);
return $actions;
}
Expand Down Expand Up @@ -338,7 +338,7 @@ public function col_quizname($row) {
* @return string html used to display the field.
*/
public function col_timeopen($row) {
$datetime = userdate($row->timeopen, get_string('studentsearch:trenddatetime', 'assessfreqreport_student_search'));
$datetime = userdate($row->timeopen, get_string('student_search:trenddatetime', 'assessfreqreport_student_search'));

if ($row->timeopen != $row->quiztimeopen) {
$content = \html_writer::span($datetime, 'local-assessfreq-override-status');
Expand All @@ -357,7 +357,7 @@ public function col_timeopen($row) {
* @return string html used to display the field.
*/
public function col_timeclose($row) {
$datetime = userdate($row->timeclose, get_string('studentsearch:trenddatetime', 'assessfreqreport_student_search'));
$datetime = userdate($row->timeclose, get_string('student_search:trenddatetime', 'assessfreqreport_student_search'));

if ($row->timeclose != $row->quiztimeclose) {
$content = \html_writer::span($datetime, 'local-assessfreq-override-status');
Expand Down Expand Up @@ -405,7 +405,7 @@ public function col_actions($row) {
// 'id' => 'tool-assessfreq-override-' . $row->id . '-' . $row->quiz,
// 'data-toggle' => 'tooltip',
// 'data-placement' => 'top',
// 'title' => get_string('studentsearch:useroverride', 'assessfreqreport_student_search'),
// 'title' => get_string('student_search:useroverride', 'assessfreqreport_student_search'),
//]);

$manage .= $this->get_common_column_actions($row);
Expand Down
47 changes: 23 additions & 24 deletions report/student_search/lang/en/assessfreqreport_student_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

$string['tab:name'] = 'Student Search';

$string['studentsearch:head'] = 'Student attempt status';
$string['student_search:head'] = 'Student attempt status';
$string['student_search:view'] = 'Ability to view the student search report.';

$string['settings:graphsheading'] = 'Chart settings';
$string['settings:graphsheading_desc'] = 'These settings allow you to configure the the settings used in the charts and graphs';
Expand All @@ -51,26 +52,24 @@

$string['report:usage_guidlines'] = '';

$string['studentsearch:quiz'] = 'Quiz';
$string['studentsearch:na'] = 'N/A';
$string['studentsearch:trenddatetime'] = '%H:%M, %d-%m-%y';
$string['studentsearch:abandoned'] = 'Abandoned';
$string['studentsearch:notloggedin'] = 'Not logged in';
$string['studentsearch:loggedin'] = 'Logged in';
$string['studentsearch:inprogress'] = 'In progress';
$string['studentsearch:finished'] = 'Finished';
$string['studentsearch:uploadpending'] = 'Upload pending';
$string['studentsearch:overdue'] = 'Overdue';
$string['studentsearch:useroverride'] = 'Add user override';
$string['studentsearch:quiztimeopen'] = 'Open time';
$string['studentsearch:quiztimeclose'] = 'Close time';
$string['studentsearch:quiztimelimit'] = 'Time limit';
$string['studentsearch:quiztimestart'] = 'Start';
$string['studentsearch:quiztimefinish'] = 'Finish';
$string['studentsearch:status'] = 'Status';
$string['studentsearch:actions'] = 'Actions';
$string['studentsearch:userlogs'] = 'View user logs';
$string['studentsearch:userattempt'] = 'View user attempt';
$string['studentsearch:userprofile'] = 'View user profile';

$string[''] = '';
$string['student_search:quiz'] = 'Quiz';
$string['student_search:na'] = 'N/A';
$string['student_search:trenddatetime'] = '%H:%M, %d-%m-%y';
$string['student_search:abandoned'] = 'Abandoned';
$string['student_search:notloggedin'] = 'Not logged in';
$string['student_search:loggedin'] = 'Logged in';
$string['student_search:inprogress'] = 'In progress';
$string['student_search:finished'] = 'Finished';
$string['student_search:uploadpending'] = 'Upload pending';
$string['student_search:overdue'] = 'Overdue';
$string['student_search:useroverride'] = 'Add user override';
$string['student_search:quiztimeopen'] = 'Open time';
$string['student_search:quiztimeclose'] = 'Close time';
$string['student_search:quiztimelimit'] = 'Time limit';
$string['student_search:quiztimestart'] = 'Start';
$string['student_search:quiztimefinish'] = 'Finish';
$string['student_search:status'] = 'Status';
$string['student_search:actions'] = 'Actions';
$string['student_search:userlogs'] = 'View user logs';
$string['student_search:userattempt'] = 'View user attempt';
$string['student_search:userprofile'] = 'View user profile';

0 comments on commit 8e2704e

Please sign in to comment.