Skip to content

Commit

Permalink
MDL-77639 gradebook_setup: Create outcomes via dyn form
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocolate-lightning committed Jun 30, 2023
1 parent 267203e commit af6d520
Show file tree
Hide file tree
Showing 9 changed files with 537 additions and 23 deletions.
2 changes: 1 addition & 1 deletion admin/tool/behat/tests/behat/data_generators.feature
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ Feature: Set up contextual data for tests
Then I should see "Test Outcome Grade Item 1"
And I click on grade item menu "Test Outcome Grade Item 1" of type "gradeitem" on "setup" page
And I choose "Edit grade item" in the open action menu
And I click on "Show more..." "link" in the "Edit outcome item" "dialogue"
And the field "Outcome" matches value "Grade outcome 1"
And I expand all fieldsets
And I should see "Grade category 1" in the "Grade category" "form_row"
And I press "Cancel"

Expand Down
2 changes: 1 addition & 1 deletion grade/amd/build/gradebooksetup_forms.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion grade/amd/build/gradebooksetup_forms.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions grade/amd/src/gradebooksetup_forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ export const init = () => {
title = trigger.getAttribute('data-category') === '-1' ?
getString('newcategory', 'core_grades') : getString('categoryedit', 'core_grades');
args.category = trigger.getAttribute('data-category');
} else if (event.target.closest('[data-trigger="add-outcome-form"]')) {
event.preventDefault();
trigger = event.target.closest('[data-trigger="add-outcome-form"]');
formClass = 'core_grades\\form\\add_outcome';
title = trigger.getAttribute('data-itemid') === '-1' ?
getString('newitem', 'core_grades') : getString('outcomeitemsedit', 'core_grades');
args.itemid = trigger.getAttribute('data-itemid');
}

if (trigger) {
Expand Down
Loading

0 comments on commit af6d520

Please sign in to comment.