diff --git a/question/bank/customfields/tests/behat/customfield_question.feature b/question/bank/customfields/tests/behat/customfield_question.feature index 969f70085d4..3c3bad855eb 100644 --- a/question/bank/customfields/tests/behat/customfield_question.feature +++ b/question/bank/customfields/tests/behat/customfield_question.feature @@ -40,20 +40,21 @@ Feature: A teacher can edit question with custom fields And I am on the "Test quiz name" "mod_quiz > question bank" page Scenario: Edit a previously created question and see the custom field in the overview table and in the question preview. - When I choose "Edit question" action for "First question" in the question bank - And I should see "Category for test" + When I am on the "First question" "core_question > edit" page + Then I should see "Category for test" And I click on "Expand all" "link" in the "region-main" "region" And I should see "Field 1" And I set the following fields to these values: - | Field 1 | custom field text | + | Question name | First question edited | + | Field 1 | custom field text | And I press "id_submitbutton" And I should see "First question" And I should see "custom field text" - And I choose "Preview" action for "First question" in the question bank + And I am on the "First question edited" "core_question > preview" page And I should see "Field 1" - Then I should see "custom field text" + And I should see "custom field text" Scenario: Preview a previously created question with custom fields set with empty values - When I choose "Preview" action for "First question" in the question bank - And I should see "Field 1" - Then I should not see "custom field text" + When I am on the "First question" "core_question > preview" page + Then I should see "Field 1" + And I should not see "custom field text" diff --git a/question/bank/customfields/tests/behat/customfield_question_visbility.feature b/question/bank/customfields/tests/behat/customfield_question_visbility.feature index 8bcdab19b9a..0572f2f57a6 100644 --- a/question/bank/customfields/tests/behat/customfield_question_visbility.feature +++ b/question/bank/customfields/tests/behat/customfield_question_visbility.feature @@ -37,13 +37,12 @@ Feature: The visibility of question custom fields control where they are display | Correct answer | False | | Feedback for the response 'True'. | So you think it is true | | Feedback for the response 'False'. | So you think it is false | - And I am on the "Test quiz name" "mod_quiz > question bank" page @javascript Scenario: Display custom question fields to teachers based on their visibility. - When I choose "Edit question" action for "First question" in the question bank - And I should see "Category for test" - And I click on "Expand all" "link" in the "region-main" "region" + When I am on the "First question" "core_question > edit" page + Then I should see "Category for test" + And I click on "Expand all" "link" And I should see "Field 1" And I should see "Field 2" And I should see "Field 3" @@ -63,4 +62,4 @@ Feature: The visibility of question custom fields control where they are display And I should see "Field 2" And I should see "custom field text two" And I should see "Field 3" - Then I should see "secret" + And I should see "secret" diff --git a/question/bank/history/classes/question_history_view.php b/question/bank/history/classes/question_history_view.php index 2e61cb0bcd1..33a91834fef 100644 --- a/question/bank/history/classes/question_history_view.php +++ b/question/bank/history/classes/question_history_view.php @@ -92,8 +92,9 @@ class question_history_view extends view { } } - protected function create_new_question_form($category, $canadd): void { + public function allow_add_questions(): bool { // As we dont want to create questions in this page. + return false; } /** diff --git a/question/bank/usage/styles.css b/question/bank/usage/styles.css index 3f9e0ea49a2..4d928f1055b 100644 --- a/question/bank/usage/styles.css +++ b/question/bank/usage/styles.css @@ -1,4 +1,4 @@ -#categoryquestions td.questionlastused span.date { +.question-bank-table td.questionlastused span.date { font-weight: 400; font-size: .8em; } diff --git a/question/bank/viewquestionname/classes/question_name_idnumber_tags_column.php b/question/bank/viewquestionname/classes/question_name_idnumber_tags_column.php index 354755bc30a..c21c5a6dfe0 100644 --- a/question/bank/viewquestionname/classes/question_name_idnumber_tags_column.php +++ b/question/bank/viewquestionname/classes/question_name_idnumber_tags_column.php @@ -50,8 +50,8 @@ class question_name_idnumber_tags_column extends viewquestionname_column_helper // The non-breaking space ' ' is used in html to fix MDL-75051 (browser issues caused by chrome and Edge). if ($question->idnumber !== null && $question->idnumber !== '') { echo ' ' . \html_writer::span( - \html_writer::span(get_string('idnumber', 'question'), 'accesshide') - . ' ' . \html_writer::span(s($question->idnumber), 'badge badge-primary'), 'ml-1'); + \html_writer::span(get_string('idnumber', 'question') . ' ', 'accesshide') + . \html_writer::span(s($question->idnumber), 'badge badge-primary'), 'ml-1'); } // Question tags.