mirror of
https://github.com/moodle/moodle.git
synced 2025-03-20 15:40:17 +01:00
Merge branch 'MDL-79107-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE
This commit is contained in:
commit
183901ec6d
2
lib/editor/tiny/amd/build/editor.min.js
vendored
2
lib/editor/tiny/amd/build/editor.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -512,11 +512,15 @@ export const setupForTarget = async(target, options = {}) => {
|
||||
// At this point any plugin which has configuration options registered will have them applied for this instance.
|
||||
const [editor] = await tinyMCE.init(instanceConfig);
|
||||
|
||||
// Update the textarea when the editor to set the field type for Behat.
|
||||
target.dataset.fieldtype = 'editor';
|
||||
|
||||
// Store the editor instance in the instanceMap and register a listener on removal to remove it from the map.
|
||||
instanceMap.set(target, editor);
|
||||
editor.on('remove', ({target}) => {
|
||||
// Handle removal of the editor from the map on destruction.
|
||||
instanceMap.delete(target.targetElm);
|
||||
target.dataset.fieldtype = null;
|
||||
});
|
||||
|
||||
// If the editor is part of a form, also listen to the jQuery submit event.
|
||||
|
29
question/type/essay/tests/behat/non_form_fields.feature
Normal file
29
question/type/essay/tests/behat/non_form_fields.feature
Normal file
@ -0,0 +1,29 @@
|
||||
@editor @qtype @qtype_essay @javascript
|
||||
Feature: Set editor values when the editor is not in a form
|
||||
As an automated tester
|
||||
In order to use a non-form editor
|
||||
I need to set values
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username |
|
||||
| teacher |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher | C1 | editingteacher |
|
||||
And the following "question categories" exist:
|
||||
| contextlevel | reference | name |
|
||||
| Course | C1 | Test questions |
|
||||
And the following "questions" exist:
|
||||
| questioncategory | qtype | name | template |
|
||||
| Test questions | essay | essay | editorfilepicker |
|
||||
|
||||
Scenario: Preview an Essay question that uses the HTML editor with embedded files.
|
||||
When I am on the "essay" "core_question > preview" page logged in as teacher
|
||||
And I expand all fieldsets
|
||||
And I set the following fields to these values:
|
||||
| Answer text Question 1 | <p>The <b>cat</b> sat on the mat. Then it ate a <b>frog</b>.</p> |
|
||||
And I press "Submit and finish"
|
Loading…
x
Reference in New Issue
Block a user