4170 Commits

Author SHA1 Message Date
Víctor Déniz
5009d5030d Merge branch 'MDL-70032-master-2' of git://github.com/junpataleta/moodle 2020-10-29 22:27:47 +00:00
Jun Pataleta
ac9ecf6bef MDL-70032 qtype_multichoice: Use custom partial named selector
* With the removal of the label element, Behat now has to click on the
answer text. In order to achieve this, the custom partial named selector
"qtype_multichoice > Answer" was now added and have replaced the
instances where the label of the answer's checkbox/radio button is
being clicked.
2020-10-29 16:21:22 +08:00
Jun Pataleta
a1d81dc6d9 MDL-70032 qtype_multichoice: Fix answer labelling
* Discard the use of the label element in order to be able to render
multiple choice answers as they are and have these act as the radio
button/checkbox' label through the aria-labelledby attribute.
* New JS module qtype_multichoice/answers that listens for click events
on the answer text container and selects the appropriate answer radio
button/checkbox.
2020-10-29 15:36:15 +08:00
Jun Pataleta
b7294cc13b MDL-70004 qtype_multichoice: Set appropriate clear my choice role 2020-10-27 01:58:44 +08:00
Sara Arjona
ca2db4be71 Merge branch 'MDL-67673' of https://github.com/stronk7/moodle into master 2020-10-21 17:38:05 +02:00
Eloy Lafuente (stronk7)
3a5641cb74 MDL-67673 phpunit: Remove deprecated assertEquals() params
The optional parameters of assertEquals() and assertNotEquals()
are deprecated in PHPUnit 8 (to be removed in PHPUnit 9):

- delta => use assertEqualsWithDelta()
- canonicalize => use assertEqualsCanonicalizing()
- ignoreCase => use assertEqualsIgnoringCase
- maxDepth => removed without replacement.

More info @ https://github.com/sebastianbergmann/phpunit/issues/3341

Initial search done with:

ag 'assert(Not)?Equals\(.*,.*,' --php

Then, running tests and fixing remaining cases.
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
a293b3aea8 MDL-67673 phpunit: Remove deprecated non-public attribute assertions
With PHPUnit 8 a good number of assertions, all them related with
operations on non-public attributes have been deprecated. And will
be removed with PHPUnit 9.

The main point is that unit tests shouldn't be testing non-public
APIs (good practice) and those assertions were an error originally.

See https://github.com/sebastianbergmann/phpunit/issues/3338 for
the complete list and other details.

When possible (the attributes being checked are public), the change
is simple, just switching to normal assertions.

When the attributes are not public we need to find a workaround
to be able to test the same using public APIs, or use Reflection,
or remove the tests.

For the records, this is the regexp used to find all the cases:

ag '>(assertAttribute|attribute\(|readAttributte|getStaticAttribute| \
    getObjectAttribute)' -G "test.php"
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
d95c378771 MDL-67673 phpunit: Remove expectedException annotations
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

The annotations `@expectedException`, `@expectedExceptionCode`,
`@expectedExceptionMessage`, and `@expectedExceptionMessageRegExp`
are now deprecated.
Using these annotations will trigger a deprecation warning
in PHPUnit 8 and in PHPUnit 9 these annotations will be removed.

Also, all uses of expectExceptionMessageRegExp() has been moved
to expectExceptionMessageMatches(). See https://github.com/sebastianbergmann/phpunit/issues/3957

TODO: Various weirdness found while doing the changes with these tests:
- vendor/bin/phpunit lib/tests/exporter_test.php (created MDL-69700)
- vendor/bin/phpunit competency/tests/external_test.php (same issue than prev one)
- vendor/bin/phpunit question/engine/tests/questionengine_test.php (created MDL-69624)
- vendor/bin/phpunit lib/tests/event_test.php (created MDL-69688)
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
f94195c320 MDL-67673 phpunit: Remove deprecated assertInternalType()
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

assertInternalType() is deprecated and will be removed in
PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(),
assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(),
assertIsResource(), assertIsString(), assertIsScalar(),
assertIsCallable(), or assertIsIterable() instead.
2020-10-21 12:45:59 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Jun Pataleta
56bfa69a72 MDL-69392 question: Fix Try again button styling 2020-10-21 14:11:39 +08:00
Jake Dallimore
e19669e432 Merge branch 'master_MDL-47178' of https://github.com/golenkovm/moodle 2020-10-16 11:52:09 +08:00
Huong Nguyen
0ee64fbc9c MDL-69266 qtype_ddwtos: 'unlimited' options fail in 3.9 2020-10-15 19:44:35 +07:00
Adrian Greeve
348961d206 Merge branch 'MDL-69798' of https://github.com/timhunt/moodle 2020-10-08 13:35:41 +08:00
Mikhail Golenkov
f8d859a685 MDL-47178 question: Retain question authors when restoring backups. 2020-10-06 09:29:18 +11:00
Tim Hunt
3c1416dcf3 MDL-69798 XML question export: excape special chars in idnumbers 2020-10-01 17:01:50 +01:00
Sara Arjona
32f5dbbb80 Merge branch 'MDL-69050-master-allowlist' of git://github.com/mudrd8mz/moodle into master 2020-10-01 14:51:11 +02:00
David Mudrák
e2d54e6bd8 MDL-69050 lang: Fix the variable name in the Essay question type 2020-09-24 19:41:58 +02:00
Mahmoud Kassaei
9dea33e8d0 MDL-68562 Qtype_essay: Adding file-size limit to the attachment files 2020-09-22 14:50:35 +01:00
Eloy Lafuente (stronk7)
3131766547 Merge branch 'MDL-69116-master' of git://github.com/rezaies/moodle into master 2020-09-08 23:14:19 +02:00
Shamim Rezaie
8739f218a9 MDL-69116 qtype_multichoice: accessibility improvement
- Screen-readers should not see 'clear my choice' when it is not visible
- 'clear my choice' option should only become visible when a choice is
selected
2020-08-31 23:51:29 +10:00
Shamim Rezaie
b0af84698b MDL-69116 qtype_mutichoice: Use label for the "clear my choice" link 2020-08-31 22:47:41 +10:00
Tim Hunt
de3d216c5a MDL-69246 questions: allow for float issues when validating manual marks
As well as fixing the bug, I also rewrote the test to use
data providers, which should lead to more useful failure messages.

And, I moved the magic number we used as the float tolerence to
be a named constant.
2020-08-27 17:37:31 +01:00
Eloy Lafuente (stronk7)
9a79c34eb6 MDL-69479 upgrade: Change all 4.0 occurrences to 3.10
Under parallel development, when something is worth being commented
in upgrade.txt notes, it will be applied to all the development branches
using the "earliest" one to be released. So, if something changes
in 3.10 (and also is applied to master), the upgrade.txt notes will
show 3.10 in both branches.

Of course, if something only goes to one dev branch (say master), then the
master version will be used in the notes (4.0 in this case).
2020-08-21 23:57:17 +02:00
Andrew Nicols
f24aae4cad Merge branch 'MDL-67735-master' of git://github.com/bmbrands/moodle 2020-08-19 08:28:49 +08:00
Andrew Nicols
3508f17417 Merge branch 'MDL-69414' of https://github.com/nadavkav/moodle 2020-08-18 00:47:48 +02:00
Eloy Lafuente (stronk7)
fbb0767536 MDL-69475 versions: bump all versions and requires in master
version = 2021052500 release version
requires= 2021052500 same than version

Why 20210525? (25th May 2021) ?

Because master is going to be Moodle 4.0, to be released
on November 2021. And, until then, we are going to have
a couple of "intermediate" releases:

- Moodle 3.10 to be released 9th November 2020. (2020110900)

  This version will be using versions from today to 2020110900
  (once it's released the YYYYMMDD part stops advancing).

- Moodle 3.11 to be released 10th May 2021. (2021051000)

  This version will be using versions from 3.10 release to 2021051000
  (once it's released the YYYYMMDD part stops advancing).

That means that all versions from today to 2021051000 are going
to be used by those 2 "intermediate" releases (3.10 and 3.11).

And we cannot use them in master, because it's forbidden to have
any overlapping of versions between branches (or different upgrade
paths will fail).

So, get that 2021051000, let's add it a couple of weeks to cover
the on-sync period (or a 2 weeks delay max!) and, the first version
that master can "own" in exclusive (without any overlap) is, exactly,
25th May 2021, hence our 20210525.
2020-08-18 00:47:15 +02:00
Bas Brands
4394f9e358 MDL-67735 theme_boost: remove bs2 and bs4alpha compatibility css 2020-08-17 08:16:42 +00:00
Nadav Kavalerchik
77bdf2150b MDL-69414 qtype/ddimageortext: Fix dropzones display in RTL mode 2020-08-08 20:46:34 +03:00
Adrian Greeve
17e99314a2 Merge branch 'MDL-67657-master' of git://github.com/andrewnicols/moodle 2020-07-21 14:47:14 +08:00
Eloy Lafuente (stronk7)
5a32562f82 Merge branch 'MDL-69165-master' of https://github.com/HuongNV13/moodle 2020-07-16 16:21:27 +02:00
Andrew Nicols
cd6eadd407 MDL-67657 behat: Convert existing uses of executeScript 2020-07-16 11:06:31 +08:00
Andrew Nicols
45871ec48e MDL-69068 behat: Allow singular, pivotted data generators 2020-07-15 15:27:31 +08:00
Andrew Nicols
b49cb92e82 MDL-69068 behat: New step to support singular generators 2020-07-15 15:27:31 +08:00
Jake Dallimore
0524f3ae5b Merge branch 'MDL-69104-master' of https://github.com/HuongNV13/moodle 2020-07-08 13:06:45 +08:00
Huong Nguyen
579da44a70 MDL-69165 Questions: Incorrect id used in init_submit_button function 2020-07-08 10:54:24 +07:00
Huong Nguyen
5fa8f1c811 MDL-69104 Questions: Drag and drop question family don't work with iOS
- Drag and Drop marker question type
 - Drag and Drop onto image question type
 - Drag and Drop into text question type
2020-06-30 13:15:48 +07:00
Luca Bösch
8dfa3027a0 MDL-68584 core_question: flexbox compatible separator for question types
* the br tag does not work well in a flexbox context, a 100% with div
works in both classic and boost.
2020-06-25 22:01:15 +02:00
Eloy Lafuente (stronk7)
b764343e5a MDL-69044 upgrade: add 3.9.0 separation line to all upgrade scripts 2020-06-14 13:08:09 +02:00
Jake Dallimore
337e2e2b23 Merge branch 'MDL-68973' of https://github.com/stronk7/moodle 2020-06-10 16:13:57 +08:00
Jun Pataleta
4baa3d1280 MDL-68864 qtype_multichoice: Rebuild clearchoice source map 2020-06-10 11:20:22 +08:00
Bas Brands
5d5153906c MDL-68864 qtype_multichoice: clearchoice button styles
- display the clearchoice link as a button to improve the way
it looks when using keyboard focus
2020-06-10 11:10:46 +08:00
Bas Brands
233eafd8eb MDL-68864 qtype_multichoice: shift focus to first option on keyboard tab
- This prevents losing focus when using keyboard navigation.
2020-06-10 11:10:46 +08:00
Bas Brands
b59de78bd1 MDL-68864 qtype_multichoice: clearchoice
- Reverted changes from MDL-67901
2020-06-10 11:10:46 +08:00
Eloy Lafuente (stronk7)
115cc0214f MDL-68973 versions: bump all versions and requires near release
version = 2020061500 release version
requires= 2020060900 current rc1 (week7roll1) version
2020-06-09 16:23:09 +02:00
Bas Brands
024a0cc7c2 MDL-68963 qtype_calculatedmulti: show question content inline
- Applies the CSS changes added in MDL-68761 for the multichoice qtype
so questions don't start on a new line
2020-06-08 15:03:37 +02:00
Bas Brands
1ce86e3ada MDL-68963 qtype_multichoice: better styles for safari
- Input type radio needs a width attribute when it is in a flexbox
container
2020-06-08 15:02:59 +02:00
Bas Brands
40d1487bf5 MDL-68761 question_multichoice: show question content inline 2020-06-03 11:02:59 +02:00
Jake Dallimore
cfe32a7caf Merge branch 'MDL-68802-master' of https://github.com/HuongNV13/moodle 2020-05-29 10:53:57 +08:00