MDL-74041 quiz: use own size for paging the question bank

This commit is contained in:
Tim Hunt 2022-03-03 12:33:03 +00:00
parent 10e8ffe312
commit aac5b47cea
4 changed files with 29 additions and 12 deletions

View file

@ -36,6 +36,8 @@ use mod_quiz\question\bank\filter\custom_category_condition;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class custom_view extends \core_question\local\bank\view {
/** @var int number of questions per page to show in the add from question bank modal. */
const DEFAULT_PAGE_SIZE = 20;
/** @var bool $quizhasattempts whether the quiz this is used by has been attemptd. */
protected $quizhasattempts = false;
@ -57,6 +59,7 @@ class custom_view extends \core_question\local\bank\view {
public function __construct($contexts, $pageurl, $course, $cm, $quiz) {
parent::__construct($contexts, $pageurl, $course, $cm);
$this->quiz = $quiz;
$this->pagesize = self::DEFAULT_PAGE_SIZE;
}
protected function get_question_bank_plugins(): array {