moodle/blocks/activity_results/tests/behat/addunsupportedactivity.feature
David Mudrák d84c64b7d6 MDL-52873 forms: Generate unique id attributes for modgrade elements
The previous method of generating the id attribute of the elements
within the modgrade group did not take the name of the modgrade field
into account. So if there were multiple fields of the modgrade type
added into a form (not a common case yet still valid), elements created
within the group were assigned same id attributes.

The patch introduces a new method for generating the id attribute of
modgrade elements. The new method takes the name of the modgrade group
into account and returns the id in the format similar to the default one
returned by HTML_QuickForm_element::_generateId().

The patch changes the generated id attribute. Apart from the
block_activity_results' behat feature files, not other places seem to
rely on the exact value.
2016-01-22 14:24:53 +01:00

40 lines
1.7 KiB
Gherkin

@block @block_activity_results
Feature: The activity results block displays student scores
In order to be display student scores
As a user
I need to properly configure the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
Scenario: Try to configure the block to use an activity without grades
Given I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
And I follow "C1"
And I add the "Activity results" block
And I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 1 |
| id_config_showworst | 0 |
| id_config_gradeformat | Percentages |
| id_config_nameformat | Display full names |
And I press "Save changes"
When I follow "Test assignment"
And I click on "Edit settings" "link" in the "Administration" "block"
And I set the following fields to these values:
| id_grade_modgrade_type | None |
And I press "Save and return to course"
Then I should see "Error: the activity selected uses a grading method that is not supported by this block." in the "Activity results" "block"