4210 Commits

Author SHA1 Message Date
Andrew Nicols
cedb58f642 MDL-66979 question: Improve behat test reliability
Expand all fieldsets rather than individual fieldsets.

This can fail in some situations where the page moves as the first
fieldset opens and HTML transitions take effect. This causes subsequent
fieldsets to move after WebDriver has calculated the click target.
2021-01-22 14:52:11 +08:00
Tim Hunt
f6a665a84a MDL-70134 essay qtype: Provide options for smaller response boxes
And make the default box size 10
2021-01-18 09:21:43 +00:00
Tim Hunt
f0934f6db9 MDL-70134 manual grading: make starting comment box size 3 lines
I am guessing most comments are short, and the box can be expanded if needed.
2021-01-18 09:13:56 +00:00
Sara Arjona
7d24686e59 Merge branch 'MDL-69308' of https://github.com/stronk7/moodle 2021-01-14 12:03:30 +01:00
Eloy Lafuente (stronk7)
77342b96fc MDL-69308 upgrade: remove all the < 3.6.0 upgrade steps
This just deletes all the upgrade steps previous to 3.6.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2018120300 (v3.6.0) as anti-cheating measure.

Note that in this case, there wasn't any case of upgradelib
functions being used, hence we haven't to deprecate/remove
anything in codebase. When there is such a need, that is done
in separate commits (one for each function) and documented here.

See MDL-65809 commits for an example removing/deprecating a
good number of functions.
2021-01-13 19:11:19 +01:00
Tim Hunt
c4e2b67c22 MDL-68597 qtype_essay: show the word count on the review screen 2021-01-13 10:27:40 +00:00
Tim Hunt
6fc462ad4d MDL-68597 qtype_essay: switch the form to consistently use hideIf 2021-01-13 10:27:40 +00:00
Tim Hunt
d9b0da85cc MDL-68597 essay word limits: fixes requested by the integrator 2021-01-13 10:27:40 +00:00
Mahmoud Kassaei
997a407b37 MDL-68597 qtype_essay: add word min/max for online text input 2021-01-13 10:27:14 +00:00
Jun Pataleta
50fdadffc0 Merge branch 'MDL-70374' of https://github.com/timhunt/moodle 2021-01-07 12:37:08 +08:00
Jake Dallimore
cc1ad82037 Merge branch 'MDL-70426-master' of https://github.com/HuongNV13/moodle 2020-12-22 15:15:56 +08:00
Tim Hunt
add7ebab30 MDL-70374 qtype_multichoice: code cleanup
* Remove some obsoliete CSS.
* Put the CSS in a more logical order.
* Rename some variables in the renderer, for more clarity.
2020-12-18 13:12:54 +00:00
Tim Hunt
4d23573182 MDL-70374 qtype_multichoice: improve alignment of choices 2020-12-18 12:59:30 +00:00
Sara Arjona
45bbc5a4cf Merge branch 'MDL-70373' of https://github.com/timhunt/moodle 2020-12-16 12:40:36 +01:00
Jake Dallimore
5c10b07c6f Merge branch 'MDL-70324-master' of https://github.com/JBThong/moodle 2020-12-14 11:29:37 +08:00
Huong Nguyen
d07c7ae33e MDL-70426 qtype_ddmarker: infinite markers keep duplicating 2020-12-09 11:16:31 +07:00
Andrew Nicols
9e12342aa5 Merge branch 'MDL-70321' of https://github.com/timhunt/moodle 2020-12-03 11:39:13 +08:00
Tim Hunt
7a1da781a9 MDL-70373 qtype_essay: missing border on atto input 2020-12-02 20:08:53 +00:00
Thong Bui
017b1252ed MDL-70324 Question: get_all_response_file_areas() not work correctly 2020-12-01 16:03:44 +07:00
Andrew Nicols
0aecabf004 MDL-70153 qtype_essay: Whitespace/behat fixes 2020-11-26 12:46:10 +01:00
Andrew Nicols
22388c9e7f Merge branch 'MDL-70153-master' of git://github.com/dpalou/moodle 2020-11-26 12:46:10 +01:00
Sara Arjona
42d23f2ddf Merge branch 'MDL-70248-master' of https://github.com/HuongNV13/moodle 2020-11-26 12:46:10 +01:00
Tim Hunt
32bd113761 MDL-70321 question backup: fix MDL-47178 unit tests
They were failing if you had CodeRunner installed
2020-11-24 15:26:32 +00:00
Jun Pataleta
1ce10609f3 Merge branch 'MDL-70094-master' of https://github.com/SangNguyen2601/moodle 2020-11-19 09:38:39 +08:00
sangnguyen2601
39652702f0 MDL-70094 Question: Technical info section expands if click help icon 2020-11-18 18:03:08 +07:00
Dani Palou
98dac07d54 MDL-70153 qtype_essay: Add behat test for attachments max size 2020-11-18 10:15:43 +01:00
Huong Nguyen
a03b08abaf MDL-70248 qtype_ddimageortext: Drop zones have UI issue in Editing form 2020-11-18 16:09:05 +07:00
Andrew Nicols
bce0d4b80f MDL-70148 qtype: Update qtype steps to new key interaction
Note: The ddmarker question type was previously getting the number of
keypresses wrong. This was because it was using both keyDown/keyUp, and
also keyPress. As a result each keypress was essentially happening two
times.
2020-11-17 15:14:43 +08:00
Andrew Nicols
ba34d6e225 MDL-70148 behat: Update steps for keyboard 2020-11-17 15:14:43 +08:00
Dani Palou
d1af86fd62 MDL-70153 qtype_essay: Fix max size displayed for attachments 2020-11-16 15:20:34 +01:00
Sara Arjona
e7ea4ae450 Merge branch 'MDL-69823-master' of git://github.com/jleyva/moodle 2020-11-11 07:41:19 +01:00
Andrew Nicols
8d8443411d Merge branch 'MDL-70065' of https://github.com/timhunt/moodle 2020-11-11 09:49:26 +08:00
Juan Leyva
440aaccb57 MDL-69823 qtype: Support core question types 2020-11-10 19:16:24 +01:00
Juan Leyva
caddb8f175 MDL-69823 mod_quiz: Return question options via WS 2020-11-10 19:16:24 +01:00
Jun Pataleta
84b7d23334 Merge branch 'MDL-69930-master' of https://github.com/HuongNV13/moodle
# Conflicts:
#	question/type/ddimageortext/amd/build/question.min.js
#	question/type/ddimageortext/amd/build/question.min.js.map
#	question/type/ddimageortext/amd/src/question.js
2020-11-10 14:11:54 +08:00
Víctor Déniz
27ef489443 Merge branch 'MDL-69955-master' of https://github.com/HuongNV13/moodle 2020-11-09 21:46:53 +00:00
Huong Nguyen
d67bcd6b9a MDL-69955 qtype_ddimageortext: drop zone disappear in special case 2020-11-04 09:51:00 +07:00
Tim Hunt
a26c04c34a MDL-70112 drag-drop qtypes: fix form preview 2020-11-03 21:25:51 +00:00
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
Tim Hunt
1622425260 MDL-70065 quiz: fix paging when adding questions from the bank 2020-10-29 20:25:53 +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
Huong Nguyen
dc293a2eb6 MDL-69930 qtype_ddimageortext: Duplication items in drag-onto-image question 2020-10-25 20:13:39 +07: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