Commit graph

2546 commits

Author SHA1 Message Date
Sara Arjona
4611cf3b9f Merge branch 'MDL-70796_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-02-10 16:50:09 +01:00
Sara Arjona
ea1407452c Merge branch 'MDL-69101_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-02-10 15:11:58 +01:00
Mahmoud Kassaei
dcb319c441 MDL-70377 qtype_essay: When reviewing an attempt as a teacher
In the Response history table, Action Saved: does not display the value
of $a in the language string.
2021-02-08 17:05:03 +00:00
Tim Hunt
9ca6fd447c MDL-70796 count_words: match the count from LibraOffice & MS Word 2021-02-05 15:31:10 +00:00
Tim Hunt
1550b2a3e9 MDL-69101 Essay/Moodle XML: recent new settings not imported/exported 2021-02-03 08:10:55 +00:00
Sara Arjona
82a6dc6dd1 Merge branch 'MDL-70574_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-02-02 08:20:25 +01:00
Jun Pataleta
868af1cb0b MDL-70288 qtype: Remove unnecessary empty label string
* When a label is passed to an (advanced) checkbox and no text
  was provided, the label will be displayed on the right of the the
  checkbox element. So there's no point in passing an empty string for
  the label just to render the text to the right of the checkbox.
2021-02-02 14:22:15 +08:00
Andrew Nicols
a85f7f83b9 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:18 +08:00
Tim Hunt
296669ea36 MDL-70134 essay qtype: Provide options for smaller response boxes
And make the default box size 10
2021-01-18 09:24:57 +00:00
Sara Arjona
1520ae2cbd Merge branch 'MDL-69308_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-01-14 12:03:36 +01:00
Eloy Lafuente (stronk7)
5aed7f4217 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:28:39 +01:00
Tim Hunt
8306fc3f3e MDL-68597 qtype_essay: show the word count on the review screen 2021-01-12 19:53:01 +00:00
Tim Hunt
8d7b3b3fe7 MDL-68597 qtype_essay: switch the form to consistently use hideIf 2021-01-12 17:54:39 +00:00
Tim Hunt
48e0b24587 MDL-68597 essay word limits: fixes requested by the integrator 2021-01-11 20:32:24 +00:00
Mahmoud Kassaei
9b7439c3a8 MDL-68597 Qtype_Essay: Adding word min/max for online text input 2021-01-11 20:32:20 +00:00
Tim Hunt
7449ad7861 MDL-70574 qtype_multianswer: fractional scores should be possible 2021-01-11 17:35:51 +00:00
Jun Pataleta
fa9c582da9 Merge branch 'MDL-70374_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-01-07 12:24:26 +08:00
Jake Dallimore
d8247c90f2 Merge branch 'MDL-70426-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2020-12-22 15:16:23 +08:00
Tim Hunt
7242488cc0 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:14:04 +00:00
Tim Hunt
5426f8bc35 MDL-70374 qtype_multichoice: improve alignment of choices 2020-12-18 13:14:03 +00:00
Huong Nguyen
0cc42a2047 MDL-70426 qtype_ddmarker: infinite markers keep duplicating 2020-12-10 15:52:09 +07:00
Tim Hunt
a3cf931e3d MDL-70373 qtype_essay: missing border on atto input 2020-12-02 20:09:43 +00:00
Andrew Nicols
41e1eecf36 MDL-70153 qtype_essay: Whitespace/behat fixes 2020-11-26 12:51:53 +01:00
Andrew Nicols
f225783ae8 Merge branch 'MDL-70153-311' of git://github.com/dpalou/moodle into MOODLE_311_STABLE 2020-11-26 12:51:53 +01:00
Sara Arjona
029be97d37 Merge branch 'MDL-70248-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2020-11-26 12:51:52 +01:00
Huong Nguyen
d921cbb41f MDL-70248 qtype_ddimageortext: Drop zones have UI issue in Editing form 2020-11-19 17:02:55 +07:00
Dani Palou
5047eac57e MDL-70153 qtype_essay: Add behat test for attachments max size 2020-11-18 10:48:08 +01:00
Dani Palou
4657c380a6 MDL-70153 qtype_essay: Fix max size displayed for attachments 2020-11-18 10:48:08 +01:00
Andrew Nicols
f4a38bbaac 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
Sara Arjona
0ab938d309 Merge branch 'MDL-69823-310' of git://github.com/jleyva/moodle into MOODLE_310_STABLE 2020-11-11 07:41:31 +01:00
Juan Leyva
d0b4b6fa2f MDL-69823 qtype: Support core question types 2020-11-10 19:21:32 +01:00
Juan Leyva
a5dcaee31c MDL-69823 mod_quiz: Return question options via WS 2020-11-10 19:21:32 +01:00
Jun Pataleta
e803a24401 Merge branch 'MDL-69930-310' of https://github.com/HuongNV13/moodle into MOODLE_310_STABLE
# 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:08:57 +08:00
Víctor Déniz
849c7704f7 Merge branch 'MDL-69955-310' of https://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2020-11-09 21:47:22 +00:00
Eloy Lafuente (stronk7)
4aa83d92bf MDL-70146 upgrade: add 3.10.0 separation line to all upgrade scripts 2020-11-07 23:26:09 +01:00
Víctor Déniz
fa79a1876c Merge branch 'MDL-70112_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2020-11-04 19:17:34 +00:00
Huong Nguyen
ab542b6e98 MDL-69955 qtype_ddimageortext: drop zone disappear in special case 2020-11-04 09:52:31 +07:00
Tim Hunt
a8efb07714 MDL-70112 drag-drop qtypes: fix form preview 2020-11-03 21:36:00 +00:00
Eloy Lafuente (stronk7)
b0a1b4ce8b MDL-70089 versions: bump all versions and requires near release
version = 2020110900 release version
requires= 2020110300 current beta+ (week6roll1) version

Note that, because we are under parallel development period,
this is being done in the branch that is going to be released
(MOODLE_310_STABLE already existing) for Moodle 3.10.0 and
not in master, that is the one getting the bump under normal
(non-parallel) periods.
2020-11-03 19:34:52 +01:00
Víctor Déniz
04569f819f Merge branch 'MDL-70032-310-2' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2020-10-29 22:26:35 +00:00
Jun Pataleta
8ea746fa79 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:53 +08:00
Jun Pataleta
5d7bd0208a 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 16:21:53 +08:00
Andrew Nicols
f7ad3eaca3 Merge branch 'MDL-70004-310' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2020-10-28 13:14:12 +08:00
Jun Pataleta
c978fa26e2 MDL-70004 qtype_multichoice: Set appropriate clear my choice role 2020-10-27 09:57:32 +08:00
Huong Nguyen
ef6f42a825 MDL-69930 qtype_ddimageortext: Duplication items in drag-onto-image question 2020-10-25 20:14:43 +07:00
Eloy Lafuente (stronk7)
46606b3ddd 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:05 +02:00
Eloy Lafuente (stronk7)
35bc26b516 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:05 +02:00
Eloy Lafuente (stronk7)
106c64ac24 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:05 +02:00
Eloy Lafuente (stronk7)
ddf72dd60d 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:05 +02:00
Eloy Lafuente (stronk7)
a6674bf8a4 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:46:05 +02:00