-
Improvement
-
Resolution: Fixed
-
Major
-
3.5.7, 3.6.5, 3.7.1, 3.8
-
MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
-
MDL-66550-master -
- Existing CI tests pass
- New CI tests pass
In some situations we will have fields which have the same name, in different sections of the form.
This will happen for repeated elements, as well as where we have multiple grading forms on a page.
It's pretty natural to use the labelled fieldset to distinguish between the different but similar fields on the form. We should support that.
There are several ways in which we can already do so:
Then the "Grade to pass" "field" in the "Ratings" "fieldset" should be visible
|
Then I should see field "Grade to pass" in the "Ratings" "fieldset"
|
However, it's not currently possible to interact with them using form steps in a meaningful way.
I'm proposing the following new format, which will work in all situations:
Then the "Ratings > Grade to pass" "field" should be visible
|
Then I should see field "Ratings > Grade to pass"
|
Then I set field "Ratings > Grade to pass" to "40"
|
In order to do so it seems that we need to simplify the way in which we normalise selectors.
Right now it happens in two places:
- In some cases we call behat_selectors::get_behat_selector; and
- In other cases the find_all function did some of the same things.
So to solve this I have moved the normalisation of behat selectors to behat_base::normalise_selector() which takes the same arguments as get_behat_selector but also takes the $container and returns an associative array containing the combined container, and normalised selector and normalised locator. I've updated everywhere to use this normalisation.
This means that, going forward, the following exciting things are possible:
- I can select fields via their fieldset anywhere that I can specify a standard selector pair (selector + type)
- Any other type can do similar magic - i.e. we could define exactly the same kind of logic for a new "breadcrumb" type where it recursively finds the container depending on how many times the ">" character is used
It may also have additional uses in the future - I'm thinking for things like MDL-66335 and similar.
- blocks
-
MDL-66079 Add configuration to show grading options in the Forum settings
- Closed
- caused a regression
-
MOBILE-3173 regression: dragdropmarker questions no longer working in mobile app.
- Closed
- is blocked by
-
MDL-66457 Behat xpath union is too greedy
- Closed