From 2558cf6996f849bd41fc466a98a621df27cd8b03 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Tue, 9 Dec 2025 16:31:06 -0600 Subject: [PATCH] Order problems from the OPL before those from Contrib in the library browser. There have been several complaints about Contrib problems being listed first in the library browser. Perhaps this will help to quiet those complaints. This is done at the database level, and so should be rather efficient. --- lib/WeBWorK/Utils/ListingDB.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/WeBWorK/Utils/ListingDB.pm b/lib/WeBWorK/Utils/ListingDB.pm index 1e6dae5e9f..528ac038a6 100644 --- a/lib/WeBWorK/Utils/ListingDB.pm +++ b/lib/WeBWorK/Utils/ListingDB.pm @@ -308,7 +308,7 @@ sub getDBListings ($c, $amcounter = 0) { ts.chapter_id = tc.chapter_id AND prob.section_id = ts.section_id AND p.path_id = pgf.path_id - $extrawhere $textextrawhere $kw_where $group_by"; + $extrawhere $textextrawhere $kw_where $group_by ORDER BY FIELD('pgf.libraryroot', 'Library')"; $pg_file_ref = $dbh->selectall_arrayref($query, {}, @select_parameters, @textInfo_parameters, @keyword_parameters); @@ -319,7 +319,7 @@ sub getDBListings ($c, $amcounter = 0) { dbc.DBchapter_id = dbsc.DBchapter_id AND dbsc.DBsection_id = pgf.DBsection_id AND p.path_id = pgf.path_id - $extrawhere $kw_where $group_by"; + $extrawhere $kw_where $group_by ORDER BY FIELD('pgf.libraryroot', 'Library')"; $pg_file_ref = $dbh->selectall_arrayref($query, {}, @select_parameters, @keyword_parameters); }