mirror of
https://github.com/moodle/moodle.git
synced 2025-07-13 18:36:34 +02:00
MDL-74054 qbank: Updates to plugins to support qbank customisation
This commit is contained in:
committed by
Andrew Nicols
parent
82599bef84
commit
3685a3355f
@ -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
|
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.
|
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
|
When I am on the "First question" "core_question > edit" page
|
||||||
And I should see "Category for test"
|
Then I should see "Category for test"
|
||||||
And I click on "Expand all" "link" in the "region-main" "region"
|
And I click on "Expand all" "link" in the "region-main" "region"
|
||||||
And I should see "Field 1"
|
And I should see "Field 1"
|
||||||
And I set the following fields to these values:
|
And I set the following fields to these values:
|
||||||
|
| Question name | First question edited |
|
||||||
| Field 1 | custom field text |
|
| Field 1 | custom field text |
|
||||||
And I press "id_submitbutton"
|
And I press "id_submitbutton"
|
||||||
And I should see "First question"
|
And I should see "First question"
|
||||||
And I should see "custom field text"
|
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"
|
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
|
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
|
When I am on the "First question" "core_question > preview" page
|
||||||
And I should see "Field 1"
|
Then I should see "Field 1"
|
||||||
Then I should not see "custom field text"
|
And I should not see "custom field text"
|
||||||
|
@ -37,13 +37,12 @@ Feature: The visibility of question custom fields control where they are display
|
|||||||
| Correct answer | False |
|
| Correct answer | False |
|
||||||
| Feedback for the response 'True'. | So you think it is true |
|
| Feedback for the response 'True'. | So you think it is true |
|
||||||
| Feedback for the response 'False'. | So you think it is false |
|
| 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
|
@javascript
|
||||||
Scenario: Display custom question fields to teachers based on their visibility.
|
Scenario: Display custom question fields to teachers based on their visibility.
|
||||||
When I choose "Edit question" action for "First question" in the question bank
|
When I am on the "First question" "core_question > edit" page
|
||||||
And I should see "Category for test"
|
Then I should see "Category for test"
|
||||||
And I click on "Expand all" "link" in the "region-main" "region"
|
And I click on "Expand all" "link"
|
||||||
And I should see "Field 1"
|
And I should see "Field 1"
|
||||||
And I should see "Field 2"
|
And I should see "Field 2"
|
||||||
And I should see "Field 3"
|
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 "Field 2"
|
||||||
And I should see "custom field text two"
|
And I should see "custom field text two"
|
||||||
And I should see "Field 3"
|
And I should see "Field 3"
|
||||||
Then I should see "secret"
|
And I should see "secret"
|
||||||
|
@ -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.
|
// As we dont want to create questions in this page.
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#categoryquestions td.questionlastused span.date {
|
.question-bank-table td.questionlastused span.date {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: .8em;
|
font-size: .8em;
|
||||||
}
|
}
|
||||||
|
@ -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).
|
// 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 !== '') {
|
if ($question->idnumber !== null && $question->idnumber !== '') {
|
||||||
echo ' ' . \html_writer::span(
|
echo ' ' . \html_writer::span(
|
||||||
\html_writer::span(get_string('idnumber', 'question'), 'accesshide')
|
\html_writer::span(get_string('idnumber', 'question') . ' ', 'accesshide')
|
||||||
. ' ' . \html_writer::span(s($question->idnumber), 'badge badge-primary'), 'ml-1');
|
. \html_writer::span(s($question->idnumber), 'badge badge-primary'), 'ml-1');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Question tags.
|
// Question tags.
|
||||||
|
Reference in New Issue
Block a user