Commit Graph

284 Commits

Author SHA1 Message Date
Tim Hunt ece18d3d22 MDL-84247 questions: rename is_valid_question -> is_qtype_usable
and move it next to is_qtype_installed. This makes the API of the
question_bank class more consistent
2025-03-17 17:12:50 +00:00
Conn Warwicker 77777a0726 MDL-84247 core_question: Improvements to handling invalid questions.
- Highlight the row and adds a badge to indicate that a question
is invalid, to make it much clearer.
- Remove the bulk action checkbox
- Fixes usage count and comments links for missingtype questions.
- Add new behat tests and fix up some existing ones to work
with new logic.
2025-03-17 16:37:27 +00:00
Conn Warwicker 01d4095926 MDL-80386 core_question: Add "show all" button to filters.
This adds the "Show All" button to the question bank filters
to allow users to select all questions easily.

It also adds new behat tests to test the functionality.
2025-03-12 15:43:08 +00:00
Andrew Nicols 2455005096 Merge branch 'MDL-84558' of https://github.com/timhunt/moodle 2025-03-06 11:56:36 +08:00
Sara Arjona 46619157f2 Merge branch 'MDL-83784' of https://github.com/cwarwicker/moodle 2025-02-19 11:58:21 +01:00
Conn Warwicker 2499276c65 MDL-83784 mod_quiz: Fix quiz unusable if question category missing.
Random questions set to question categories which no longer exist
was throwing an error making it impossible to use or edit the quiz
to fix it. This will now allow the user to view the questions and
edit the quiz in order to fix the problem of the missing category.
2025-02-19 09:21:43 +00:00
Tim Hunt 5d6fe4a279 MDL-84558 question bank: fix the PHPdocs for default_sort 2025-02-18 15:44:48 +00:00
Huong Nguyen a3e4e4565e Merge branch 'MDL-79265-master' of https://github.com/NashTechOpenUniversity/moodle 2025-02-13 09:15:20 +07:00
Hieu Nguyen Dang be4d569ad0 MDL-79265 question bank: fix which questions are listed with hidden
This fixes the bug where if the latest version of the question is hidden,
the question disappears, even if older versions exist that are still visible.
2025-02-06 14:48:33 +07:00
Mark Johnson c968ab77be MDL-84146 question: Improve handling of JS parameters 2025-02-04 02:34:28 +00:00
Jun Pataleta 8008466be8 Merge branch 'MDL-82542-master' of https://github.com/NashTechOpenUniversity/moodle 2025-02-01 00:20:36 +08:00
Huong Nguyen a3d72aa941 Merge branch 'MDL-83862_main' of https://github.com/marxjohnson/moodle 2025-01-30 09:35:02 +07:00
Mark Johnson bc57ced4f2 MDL-83862 question: Improve documentation of $qbank parameters 2025-01-27 11:24:54 +00:00
ferran d91b897549 MDL-82767 mod_qbank: fix delete action url 2025-01-22 10:35:23 +01:00
Sara Arjona 1627aa8e71 Merge branch 'MDL-83527-main-v02' of https://github.com/ferranrecio/moodle 2025-01-14 09:38:54 +01:00
ferran 3474d4a241 MDL-83527 mod_qbank: migrate cm action menu to output class 2025-01-13 14:49:46 +01:00
Luca Bösch e5b1650013 MDL-84141 mod_qbank: filter name and qbank on recently viewed. 2025-01-09 17:23:48 +01:00
hieuvu a6e4638752 MDL-82542 qbank_managecategories: Add new user preferences
Keep the checkbox to show questions from subcategories as a user preference.
2025-01-09 09:21:19 +07:00
Jun Pataleta c3e4f4af89 Merge branch 'MDL-82769_main' of https://github.com/cwarwicker/moodle 2025-01-09 10:16:23 +08:00
Mark Johnson 5478e8b4ca MDL-84080 question: Prevent overly-long qbank names
When a question bank is created by the system, it's name may be created
by combining a course of category name with a language string. If the
course name is already near the limit for its database field, the
resulting question bank name may be too long for that field, and cause
an error.

This implements a function for generating question bank names which will
trim string parameters down until the resulting name is below the
allowed length. It also implements some validation to prevent
manually-created banks with names that are too long.
2025-01-08 09:53:50 +00:00
Conn Warwicker d647b89089 MDL-82769 question: Update legacy filters on random questions.
- Adds the "cat" field to the converted legacy filter, which was
  missing.
- Does the conversion on the editrandom.php page as this was
  throwing a warning.
2025-01-06 14:15:36 +00:00
Huong Nguyen eb2be9fede Merge branch 'MDL-77713' of https://github.com/cwarwicker/moodle 2024-12-17 09:11:56 +07:00
Huong Nguyen 3cbad54d6a Merge branch 'MDL-83859_main' of https://github.com/marxjohnson/moodle 2024-12-16 10:46:52 +07:00
Huong Nguyen ebc3b82b48 Merge branch 'MDL-82273-master' of https://github.com/NashTechOpenUniversity/moodle 2024-12-16 10:01:51 +07:00
hieuvu 5e952377aa MDL-82273 core_question: get correct category for question bank view 2024-12-13 14:07:49 +07:00
Luca Bösch 3c3b4b5573 MDL-83013 core_question: put "Delete" action last in menu. 2024-12-05 18:35:24 +01:00
Mark Johnson 1613a98102 MDL-83859 core_question: Update filter condition API
This corrects some definitions of the methods in the base condition
class to make things more obvious to developers implementing new
filters.

Previously if your filter wanted to use the default
`core/datafilter/filtertype` class, you still had to implement
`get_filter_class` to return `null`, since it was declared as abstract.
This change defines it as returning `null` by default, so this is no
longer necessary.

Also, this removes the default definitions for `get_condition_key` and
`build_query_from_functions`, and declares them abstract. Currently it
is necessary to override these to implement a functional filter so it
doesn't make sense to have a useless default definition.

This will not cause any breakages with existing filters. All filters
must already be defining the methods that are now abstract, otherwise
they will not function. Any filter that is now overriding
`get_filter_class` to return `null` will continue to work as before,
even though this is no longer necessary.
2024-12-05 11:30:32 +00:00
Conn Warwicker 3f36e1ca6a MDL-77713 question: List question versions with most recent on top.
This makes the display of question versions consistent between
question preview and when users are building quizzes.
2024-12-05 11:17:06 +00:00
Huong Nguyen 488da643c6 Merge branch 'MDL-83606-master' of https://github.com/NashTechOpenUniversity/moodle 2024-12-05 12:09:24 +07:00
Jun Pataleta e9cded4559 Merge branch 'MDL-83727-master' of https://github.com/NashTechOpenUniversity/moodle 2024-12-05 12:35:52 +08:00
Khoa Nguyen fd2946fa59 MDL-83727 question: Core question privacy provider misuses lazy-loading 2024-11-29 10:54:11 +07:00
Khoa Nguyen 69fc9048bf MDL-83606 Question bank: Delete questions to fit one page causes errors. 2024-11-26 11:15:56 +07:00
Simon Adams a0cf3d2da5 MDL-71378 core_question & mod_quiz: Refactor deprecated contexts 2024-11-18 10:22:59 +00:00
Simon Adams 291fdacfd5 MDL-71378 core_question: Only show module banks in question filters 2024-11-18 10:22:58 +00:00
Simon Adams a6c4ddada5 MDL-71378 qbank_bulkmove: refactor for moving to shared question banks 2024-11-18 10:22:58 +00:00
Simon Adams 746efe94eb MDL-71378 mod_qbank: Implement add to quiz bank sharing UI 2024-11-18 10:22:58 +00:00
Simon Adams 776d1e40e4 MDL-71378 mod_qbank: Add question bank management 2024-11-15 15:18:47 +00:00
Ilya Tregubov 5c50a77859 Merge branch 'MDL-82810' of https://github.com/timhunt/moodle 2024-08-29 10:56:48 +08:00
Mark Johnson e3513f84a2 MDL-72397 qbank_managecategories: API reorganisation
This splits the API functions required for the reorganised category UI,
to properly separate the qbank_managecategories and core_question APIs.

This methods that were part of question_category_object that should live
in the core_question namespace (generate CRUD operations related to
categories) are moved to the new \core_question\category_manager class.
The parts that belong in the qbank_managecategories plugin as they are
used to display the editing UI are moved to the
\qbank_managecategories\question_categories class.

Static methods that were defined in \qbank_managecategories\helper and
were only used within methods that have been moved to one of the new
classes have been deprecated and moved to those new classes as well.

This will allow the entire
\qbank_managecategories\question_category_object class to be deprecated
in the following commit.
2024-08-22 10:27:16 +01:00
Huong Nguyen dca18ebca3 Merge branch 'MDL-81634-main' of https://github.com/andrewnicols/moodle 2024-08-20 09:30:44 +07:00
Tim Hunt 8a662a008e MDL-82810 question bank: stop action menu from getting truncated 2024-08-16 13:34:06 +01:00
Mikel Martín 0a03018116 MDL-75671 theme_boost: Refactor spacing classes for BS5
- Add SCSS code for spacing utility classes to the Boostrap 5 bridge SCSS file
- Replace all occurrences in the codebase (pr-1 > pe-1, ml-auto > ms-auto, ml-sm-3 > ms-sm-3, ...)
2024-08-09 07:40:17 +02:00
Andrew Nicols 024e36be17 MDL-81634 core: Fix all implicitly defined nullables
Note: This does not impact third-party libraries.
2024-08-02 14:11:12 +08:00
Sara Arjona 89dcf5066b Merge branch 'MDL-74251-main' of https://github.com/lucaboesch/moodle 2024-07-03 09:35:56 +02:00
Adrian Perez e1353c7649 MDL-74251 core: Remove old icon helper classes 2024-06-27 18:28:05 +02:00
Stephan Robotta f736db9777 MDL-79758 qbank: add filter in pagination links
Contains some minor tweaks by Tim Hunt <T.J.Hunt@open.ac.uk>.
2024-06-27 09:21:23 +01:00
Anupama Sarjoshi 691b87e077 MDL-81407 qbank_columnsortorder: Fix error displaying hiddencols
When the question custom fields were deleted, if there were any
hidden columns in qbank Column sort order referring those fields they
were throwing 'Custom field does not exist' exception. Changes done to
ignore such fields and display valid hiddencols, as these references
were breaking the qbank Column sort order and Question bank pages.
2024-05-19 08:51:50 +01:00
Andrew Nicols d26c40db26 Merge branch 'MDL-81114' of https://github.com/timhunt/moodle 2024-04-11 23:25:22 +08:00
Sara Arjona 54960f8e15 Merge branch 'MDL-81383' of https://github.com/timhunt/moodle 2024-04-11 12:49:29 +02:00
Tim Hunt 0b8c6bd64d MDL-81383 questions: get_filtered_questions order should be predictable
This method supports $limit and $offset paramters. The query must have
a predictable ORDER BY for that to make sense.
2024-04-11 10:25:50 +01:00