Merge branch 'MDL-78006' of https://github.com/paulholden/moodle
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -44,6 +44,8 @@ const ACTIVITIESRESOURCESREC = 5;
|
||||
const ACTIVITY = 0;
|
||||
const RESOURCE = 1;
|
||||
|
||||
let initialized = false;
|
||||
|
||||
/**
|
||||
* Set up the activity chooser.
|
||||
*
|
||||
@@ -67,6 +69,12 @@ export const init = (courseId, chooserConfig) => {
|
||||
* @param {Object} chooserConfig Any PHP config settings that we may need to reference
|
||||
*/
|
||||
const registerListenerEvents = (courseId, chooserConfig) => {
|
||||
|
||||
// Ensure we only add our listeners once.
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
const events = [
|
||||
'click',
|
||||
CustomEvents.events.activate,
|
||||
@@ -170,6 +178,8 @@ const registerListenerEvents = (courseId, chooserConfig) => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
initialized = true;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -89,3 +89,11 @@ Feature: Sections can be edited and deleted in topics format
|
||||
Then I should see "Topic 6" in the "Topic 6" "section"
|
||||
And I should not see "Test choice name" in the "Topic 5" "section"
|
||||
And I should see "Test choice name" in the "Topic 6" "section"
|
||||
|
||||
@javascript
|
||||
Scenario: Add a topic and then add an activity in it
|
||||
When I click on "Add topic" "link" in the "Topic 5" "section"
|
||||
And I add a "Assignment" to section "6" and I fill the form with:
|
||||
| Assignment name | Very new activity |
|
||||
| Description | Test |
|
||||
Then I should see "Very new activity" in the "Topic 6" "section"
|
||||
|
||||
Reference in New Issue
Block a user