Merge branch 'MDL-77218-master' of https://github.com/danghieu1407/moodle

This commit is contained in:
Ilya Tregubov 2023-05-16 15:59:53 +08:00
commit 5388970860
No known key found for this signature in database
GPG Key ID: 0F58186F748E55C1
14 changed files with 30 additions and 24 deletions

View File

@ -451,7 +451,7 @@ $string['questiontext'] = 'Question text';
$string['requiresgrading'] = 'Requires grading';
$string['responsehistory'] = 'Response history';
$string['restart'] = 'Start again';
$string['restartwiththeseoptions'] = 'Start again with these options';
$string['restartwiththeseoptions'] = 'Save preview options and start again';
$string['restoremultipletopcats'] = 'The backup file contains more than one top-level question categories for context {$a}.';
$string['rightanswer'] = 'Right answer';
$string['rightanswer_help'] = 'An automatically generated summary of the correct response. This can be limited, so you may wish to consider explaining the correct solution in the general feedback for the question, and turning this option off.';

View File

@ -45,6 +45,9 @@ class preview_options_form extends moodleform {
$mform->addElement('header', 'attemptoptionsheader', get_string('previewoptions', 'qbank_previewquestion'));
$mform->setExpanded('attemptoptionsheader', false);
// Add html element with class to display long text in single line.
$mform->addElement('html', \html_writer::div(get_string('theoptionsyouselectonlyaffectthepreview',
'qbank_previewquestion'), "col-md-12 row d-flex col-form-label form-group"));
$versions = $this->_customdata['versions'];
$versions[question_preview_options::ALWAYS_LATEST] = get_string('alwayslatest', 'qbank_previewquestion');
$currentversion = $this->_customdata['restartversion'];

View File

@ -35,6 +35,7 @@ $string['tagsnotfound'] = 'Tags not found';
$string['previewoptions'] = 'Preview options';
$string['questionversion'] = 'Question version';
$string['restartnow'] = 'Use latest version';
$string['theoptionsyouselectonlyaffectthepreview'] = 'These settings are for testing the question. The options you select only affect the preview.';
// Preview title.
$string['versiontitle'] = 'Version {$a}';
$string['versiontitlelatest'] = 'Version {$a} (latest)';

View File

@ -40,6 +40,7 @@ Feature: A teacher can preview questions in the question bank
And "Numerical" "icon" should exist
And I should see "Version"
And I click on "Preview options" "link"
And I should see "These settings are for testing the question. The options you select only affect the preview."
And I should see "Question version"
Scenario: Preview lets the teacher see what happens when an answer is saved
@ -68,7 +69,7 @@ Feature: A teacher can preview questions in the question bank
When I press "Preview options"
And I set the field "How questions behave" to "Immediate feedback"
And I set the field "Marked out of" to "3"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I set the field "Answer:" to "3.1"
And I press "Check"
Then the state of "What is pi to two d.p.?" question is shown as "Incorrect"
@ -88,7 +89,7 @@ Feature: A teacher can preview questions in the question bank
Scenario: Preview a question with very small grade
When I press "Preview options"
And I set the field "Marked out of" to "0.00000123456789"
And I press "Start again with these options"
And I press "Save preview options and start again"
Then the field "Marked out of" matches value "0.00000123456789"
Scenario: Question version is updated when edited and teacher can change question version

View File

@ -26,5 +26,5 @@ Feature: Preview a Description question
When I am on the "description-001" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I should see "Here is some information about the questions you are about to attempt."

View File

@ -28,7 +28,7 @@ Feature: Preview Essay questions
When I am on the "essay-001" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I should see "Please write a story about a frog."
@javascript @_switch_window
@ -36,7 +36,7 @@ Feature: Preview Essay questions
When I am on the "essay-002" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I should see "Please write a story about a frog."
And I should see "You can drag and drop files here to add them."
@ -45,5 +45,5 @@ Feature: Preview Essay questions
When I am on the "essay-003" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I should see "Please write a story about a frog."

View File

@ -50,7 +50,7 @@ Feature: Test all the basic functionality of this question type
| Marks | Show mark and max |
| Specific feedback | Shown |
| Right answer | Shown |
And I press "Start again with these options"
And I press "Save preview options and start again"
# Answer question correctly
And I set space "1" to "cat" in the select missing words question
@ -86,7 +86,7 @@ Feature: Test all the basic functionality of this question type
# Set behaviour options
And I set the following fields to these values:
| behaviour | immediatefeedback |
And I press "Start again with these options"
And I press "Save preview options and start again"
# Answer question correctly
And I press "Check"

View File

@ -26,7 +26,7 @@ Feature: Preview a Matching question
When I am on the "matching-001" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I set the field "Answer 1" to "amphibian"
And I set the field "Answer 2" to "mammal"
And I set the field "Answer 3" to "amphibian"
@ -39,7 +39,7 @@ Feature: Preview a Matching question
When I am on the "matching-001" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I set the field "Answer 1" to "amphibian"
And I set the field "Answer 2" to "insect"
And I set the field "Answer 3" to "amphibian"
@ -52,7 +52,7 @@ Feature: Preview a Matching question
When I am on the "matching-001" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I set the field "Answer 1" to "mammal"
And I set the field "Answer 2" to "insect"
And I set the field "Answer 3" to "insect"

View File

@ -27,7 +27,7 @@ Feature: Preview a Multiple choice question
When I am on the "Multi-choice-001" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I click on "One" "qtype_multichoice > Answer"
And I click on "Two" "qtype_multichoice > Answer"
And I press "Check"
@ -41,7 +41,7 @@ Feature: Preview a Multiple choice question
When I am on the "Multi-choice-001" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I click on "One" "qtype_multichoice > Answer"
And I click on "Three" "qtype_multichoice > Answer"
And I press "Check"
@ -57,7 +57,7 @@ Feature: Preview a Multiple choice question
When I am on the "Multi-choice-002" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I click on "One" "qtype_multichoice > Answer"
And I press "Check"
Then I should see "The oddest number is One."
@ -70,7 +70,7 @@ Feature: Preview a Multiple choice question
When I am on the "Multi-choice-002" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I click on "One" "qtype_multichoice > Answer"
Then I should see "Clear my choice"
And I click on "Clear my choice" "text"

View File

@ -31,7 +31,7 @@ Feature: Preview a Numerical question
And I should see "What is pi to two d.p.?"
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I set the field with xpath "//span[@class='answer']//input[contains(@id, '1_answer')]" to "3.14"
And I press "Check"
Then I should see "Very good."

View File

@ -44,7 +44,7 @@ Feature: Test editing a Short answer question
# Set behaviour options
And I set the following fields to these values:
| behaviour | immediatefeedback |
And I press "Start again with these options"
And I press "Save preview options and start again"
And I set the field with xpath "//div[@class='qtext']//input[contains(@id, '1_answer')]" to "newt"
And I press "Check"
And I should see "Newt is an OK good answer."

View File

@ -28,7 +28,7 @@ Feature: Preview a Short answer question
# Set behaviour options
And I set the following fields to these values:
| behaviour | immediatefeedback |
And I press "Start again with these options"
And I press "Save preview options and start again"
And I set the field with xpath "//div[@class='qtext']//input[contains(@id, '1_answer')]" to "frog"
And I press "Check"
Then I should see "Frog is a very good answer."
@ -42,7 +42,7 @@ Feature: Preview a Short answer question
# Set behaviour options
And I set the following fields to these values:
| behaviour | immediatefeedback |
And I press "Start again with these options"
And I press "Save preview options and start again"
And I set the field with xpath "//div[@class='qtext']//input[contains(@id, '1_answer')]" to "toad"
And I press "Check"
Then I should see "Toad is an OK good answer."
@ -56,7 +56,7 @@ Feature: Preview a Short answer question
# Set behaviour options
And I set the following fields to these values:
| behaviour | immediatefeedback |
And I press "Start again with these options"
And I press "Save preview options and start again"
And I set the field with xpath "//div[@class='qtext']//input[contains(@id, '1_answer')]" to "cat"
And I press "Check"
Then I should see "That is a bad answer."

View File

@ -26,7 +26,7 @@ Feature: Preview a Trtue/False question
When I am on the "true-false-001" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I click on "True" "radio"
And I press "Check"
And I should see "This is the right answer."
@ -37,7 +37,7 @@ Feature: Preview a Trtue/False question
When I am on the "true-false-001" "core_question > preview" page logged in as teacher
And I expand all fieldsets
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I press "Save preview options and start again"
And I click on "False" "radio"
And I press "Check"
And I should see "This is the wrong answer."

View File

@ -23,6 +23,8 @@ This files describes API changes for code that uses the question API.
and analysis_for_actual_response now take an optional $calculationtime, which is used the time
stored in the database. If not given, time() is used.
5) The "Start again with these options" text is changed "Save preview options and start again". If you use this text in behat test, please use the new text
or use the id of the button id_saverestart instead.
=== 4.2 ===
@ -51,7 +53,6 @@ This files describes API changes for code that uses the question API.
3) display_move_form() in qbank_managecategories\question_category_object class is deprecated and moved the logic to
the question/bank/managecategories/category.php.
=== 4.1 ===
1) get_bulk_action_key() in core_question\local\bank\bulk_action_base class is deprecated and renamed to get_key().