Skip to content

Commit

Permalink
GH-796 Fix error of questions table
Browse files Browse the repository at this point in the history
Previously, sorting the questions of a scale by attempt time and then
switching the page via pagination or doing a fulltext search would cause
an error. This is fixed now by using the same column name for the
col_NAME() function as for the sortable column.
  • Loading branch information
davidszkiba authored and mona-shakiba committed Feb 10, 2025
1 parent 189bb56 commit 9e40eb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function renderquestionstable() {
'name' => get_string('name', 'core'),
'model' => get_string('model', 'local_catquiz'),
'attempts' => get_string('attempts', 'local_catquiz'),
'lastattempttime' => get_string('lastattempttime', 'local_catquiz'),
'astatlastattempttime' => get_string('lastattempttime', 'local_catquiz'),
'difficulty' => get_string('difficulty', 'local_catquiz'),
'discrimination' => get_string('discrimination', 'local_catquiz'),
'guessing' => get_string('guessing', 'local_catquiz'),
Expand Down
2 changes: 1 addition & 1 deletion classes/table/catscalequestions_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function col_view($values) {
* @param \stdClass $values
* @return string
*/
public function col_lastattempttime($values) {
public function col_astatlastattempttime($values) {

if (intval($values->astatlastattempttime) === 0) {
return get_string('notyetcalculated', 'local_catquiz');
Expand Down

0 comments on commit 9e40eb3

Please sign in to comment.