Skip to content

Commit

Permalink
MDL-70065 quiz: fix paging when adding questions from the bank
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Oct 29, 2020
1 parent 99680d1 commit 1622425
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mod/quiz/tests/behat/editing_add_from_question_bank.feature
Expand Up @@ -79,6 +79,9 @@ Feature: Adding questions to a quiz from the question bank
Then I should see "question 21 name" in the "categoryquestions" "table"
And I should see "question 22 name" in the "categoryquestions" "table"
And I should not see "question 01 name" in the "categoryquestions" "table"
And I click on "Show all 22" "link" in the ".pagingbottom" "css_element"
And I should see "question 01 name" in the "categoryquestions" "table"
And I should see "question 22 name" in the "categoryquestions" "table"

Scenario: Questions are added in the right place with multiple sections
Given the following "questions" exist:
Expand Down
2 changes: 1 addition & 1 deletion question/classes/bank/view.php
Expand Up @@ -860,7 +860,7 @@ protected function display_question_list($contexts, $pageurl, $categoryandcontex
if ($totalnumber > DEFAULT_QUESTIONS_PER_PAGE) {
if ($perpage == DEFAULT_QUESTIONS_PER_PAGE) {
$url = new \moodle_url('edit.php', array_merge($pageurl->params(),
array('qperpage' => MAXIMUM_QUESTIONS_PER_PAGE)));
array('qpage' => 0, 'qperpage' => MAXIMUM_QUESTIONS_PER_PAGE)));
if ($totalnumber > MAXIMUM_QUESTIONS_PER_PAGE) {
$showall = '<a href="'.$url.'">'.get_string('showperpage', 'moodle', MAXIMUM_QUESTIONS_PER_PAGE).'</a>';
} else {
Expand Down

0 comments on commit 1622425

Please sign in to comment.