Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions classes/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function __construct($uniqueid) {
$this->define_columns($columns);
$this->no_sorting('usermessage');
$this->no_sorting('airesponse');
$this->sortable(true, 'timecreated', SORT_DESC);

// Define the titles of columns to show in header.
$headers = array('User ID', 'User Name', 'User Message', 'AI Response', 'Context', 'Time');
Expand Down
4 changes: 0 additions & 4 deletions report.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
$user = optional_param('user', '', PARAM_TEXT);
$starttime = optional_param('starttime', '', PARAM_TEXT);
$endtime = optional_param('endtime', '', PARAM_TEXT);
$tsort = optional_param('tsort', '', PARAM_TEXT);

$pageurl = $CFG->wwwroot . "/blocks/openai_chat/report.php?courseid=$courseid" .
"&user=$user" .
Expand Down Expand Up @@ -95,9 +94,6 @@
$where .= " AND ocl.timecreated < $endtime_ts";
}

if (!$tsort) {
$where .= " ORDER BY ocl.timecreated DESC";
}

$table->set_sql(
"ocl.*, CONCAT(u.firstname, ' ', u.lastname) as user_name",
Expand Down