24182 Commits

Author SHA1 Message Date
Ilya Tregubov
7e523dfff9
Merge branch 'MDL-77542-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-15 10:36:34 +08:00
Ilya Tregubov
053ad4a57e
Merge branch 'MDL-76733-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-15 10:23:36 +08:00
Andrew Nicols
1adbb84d07
MDL-76733 mod_assign: Remove JS requirement for time-based tests
Converting these tests to use an onlinetext submission and drop the JS
requirement means that they are much less susceptible to runtime issues,
and not susceptible to those caused by JS at all.
2023-06-15 09:34:06 +08:00
Andrew Nicols
b5fa1ee8dc
MDL-76733 mod_assign: Address random failure
This random failure was happening because of the time required to render
and interact with the file picker which sometimes exceeded 2 seconds,
depending on the speed of the machine running the tests.

Converting these tests to use an onlinetext submission and drop the JS
requirement means that they are much less susceptible to runtime issues,
and not susceptible to those caused by JS at all.
2023-06-15 09:33:42 +08:00
Sara Arjona
86b030d671 Merge branch 'MDL-76733-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-14 16:22:26 +02:00
Sara Arjona
29d1702f82 Merge branch 'MDL-76715-401' of https://github.com/aanabit/moodle into MOODLE_401_STABLE 2023-06-14 13:19:03 +02:00
Ilya Tregubov
beb0328060
Merge branch 'MDL-70152-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-06-14 13:25:03 +08:00
Amaia Anabitarte
789361ae13 MDL-76715 mod_data: Remove data_records when the last field is deleted 2023-06-13 09:35:09 +02:00
Jake Dallimore
f5e4dcf609
Merge branch 'MDL-73052-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-06-13 14:44:52 +08:00
Paul Holden
afe9d11746
MDL-77542 mod_assign: remove duplicate grade heading from grader.
It's already part of the subsequent rendered form.
2023-06-11 15:01:35 +01:00
Sara Arjona
c872490dcf Merge branch 'MDL-78415-401-enfix' of https://github.com/vmdef/moodle into MOODLE_401_STABLE 2023-06-08 20:33:14 +02:00
Helen Foster
e518de15f3 MDL-78415 lang: Import fixed English strings (en_fix) 2023-06-08 12:02:34 +01:00
Andrew Nicols
b272406c74
Merge branch 'MDL-75696_401_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_401_STABLE 2023-06-08 12:31:16 +08:00
Jun Pataleta
2cf0da5dc6 Merge branch 'MDL-75898-41' of https://github.com/matthewhilton/moodle into MOODLE_401_STABLE 2023-06-08 11:43:06 +08:00
Jun Pataleta
bf448de7aa Merge branch 'MDL-78229-401' of https://github.com/lucaboesch/moodle into MOODLE_401_STABLE 2023-06-08 10:30:23 +08:00
Jun Pataleta
79510d5d73 Merge branch 'MDL-78378-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-06-07 23:25:19 +08:00
Ferran Recio
5f30a47660 MDL-78010 mod_label: improve upgrade performance 2023-06-06 21:33:14 +02:00
Sara Arjona
8caeea5c47 MDL-73052 page: Fix page description when it has only an image
This is as regression of MDL-72413, when description was moved to a
standard module API.
In some cases, when description has only images, it's was not
displayed.
2023-06-02 08:20:38 +02:00
Sara Arjona
b17d91c6f8 MDL-78378 survey: Display default introduction when description is empty
This is a regression when the activity pages were redessigned in Moodle
4.0. The default introduction should be displayed when the activity
description is empty.
2023-06-02 08:19:49 +02:00
Ilya Tregubov
e0dc9aa297
Merge branch 'MDL-75961-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-06-01 09:08:28 +08:00
Luca Bösch
23ba0d96ef MDL-78314 quiz: style button fieldset in "Manually grade question". 2023-05-29 10:54:27 +02:00
Angelia Dela Cruz
948ac8f62b MDL-70152 behat: Forum behat generators use UI
Behat cleanup and optimisation
2023-05-29 10:28:04 +08:00
Angelia Dela Cruz
d7752f9576 MDL-70152 behat: Forum behat generators use UI
Replace steps that manually add forum and forum post instances
via the UI and use Behat generators. This improves the speed of
Behat test runs.
2023-05-29 10:27:33 +08:00
Andrew Nicols
c38a977f3d MDL-70152 forum: Create behat data generator
* Convert track_read_posts.feature to use activity and discussion
data generators as exmaple.

Co-authored-by: Jun Pataleta <jun@moodle.com>
2023-05-29 10:27:33 +08:00
Jun Pataleta
59596ddedc Merge branch 'MDL-76065-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-05-25 16:56:14 +02:00
Paul Holden
aaf17fc8b6
MDL-78320 quiz_overview: format group names in overview report. 2023-05-24 16:19:34 +01:00
Simey Lameze
b12f914708 MDL-75961 behat: review and enhance mod_imscp tests
This commit makes the following improvements to mod_imscp tests:
* Removes unnecessary @javascript and @_file_upload tags from non-JS tests.
* Removes user/enrol data generation from tests that can be performed as admin.
* Removes "I log out" and other unnecessary steps.
2023-05-24 10:41:41 +08:00
Angelia Dela Cruz
e7d32b89ac MDL-75961 behat: IMSCP behat generators use UI
Replace steps that manually add IMSCP instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-05-24 10:41:41 +08:00
Simey Lameze
1936b30c88 MDL-76065 behat: Review and enhance mod_lti Behat tests
In this commit, the following improvements were made to the mod_lti Behat tests:

* Replaced manual steps with data generators to set completion.
* Eliminated unnecessary user and course enrolments data generation as some tests can be performed as an admin.
* Removed the @javascript tag from non-JS tests.
* Updated the LTI data generator to generate an internal Moodle URL in the toolurl field, enabling the use of XML files.
2023-05-23 12:23:26 +08:00
Angelia Dela Cruz
f19f31736a MDL-76065 behat: LTI behat generators use UI
Replace steps that manually add LTI instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-05-23 12:15:25 +08:00
Andrew Nicols
1450dade43
MDL-76733 mod_assign: Tidy up availability behat tests
This feature had lots of small issues and it made sense to fix it whilst
investigating a query:

* most of the steps do not require JavaScript
* it uses the UI to set an admin setting, for every scenario:
** only 3-4 of the scenarios actually test that setting
** it is very slow to do it his way when we have a generator step we can use
* we create two assignments in the Background, but each test only uses one of them
* we create the assignments in the Background with a generator, but
  update them to modify various settings in each Scenario using the UI
  when we should just create one assignment for each test and set it up
  correctly for that Scenario
2023-05-23 10:58:07 +08:00
Luca Bösch
6bb4351e8b MDL-78229 quiz: quiz editing page less narrow.
This is a backport of MDL-77872.
2023-05-19 18:13:07 +02:00
Mark Johnson
5620e0059a MDL-75696 quiz: Fix restoring pre-4.0 quizzes with random questions
Restoring multiple quizzes from a pre-4.0 backup was broken when
the quizzes shared a random question. This is because after the
first quiz created a set reference in place of the random question,
it deleted the question record so it was not there for the second
quiz to use. This change tracks the IDs of random questions so
they can be deleted at the end.
2023-05-18 15:59:53 +01:00
Mark Johnson
85b1e992e9 MDL-75696 quiz: Set default value for includingsubcategories on restore 2023-05-18 15:56:02 +01:00
Andrew Nicols
b28a28ef0f
Merge branch 'MDL-78260_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-05-18 11:51:47 +08:00
Tim Hunt
3d023db5b0 MDL-78260 quiz stats: fix View details for random questions 2023-05-17 09:04:49 +01:00
Ilya Tregubov
87223abc7a
Merge branch 'MDL-78152-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-17 15:07:38 +08:00
Jun Pataleta
4818dae2fc Merge branch 'MDL-75576_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-05-16 09:59:01 +08:00
Ilya Tregubov
dc38a92ec6
Merge branch 'MDL-77840-401' of https://github.com/davewoloszyn/moodle into MOODLE_401_STABLE 2023-05-16 09:47:48 +08:00
Andrew Nicols
946405d44b
Merge branch 'MDL-77432-401' of https://github.com/lucaboesch/moodle into MOODLE_401_STABLE 2023-05-15 22:12:44 +08:00
Andrew Nicols
bdeda3ea9b
Merge branch 'MDL-78149-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-05-15 22:07:13 +08:00
Tim Hunt
efe895f1bb MDL-75576 quiz/question statistics: don't expire by time
Previously, a set of calculated quiz statistics would only 'last' for
15 minutes. Then they would be considered invalid and not used.

Now, computed statistics are kept indefinitely. Instead, when a new
batch of values are computed for a particular set of settings, older numbers
for the same settings are deleted first. Therefore,
question_stats_cleanup_task is no more.
2023-05-15 10:04:34 +01:00
Tim Hunt
a532f407bb MDL-75576 quiz statistics: don't time-limit the use of cached values
This should have been done as part of  MDL-74762, but was missed.
2023-05-15 10:04:33 +01:00
Tim Hunt
86932a330b MDL-75576 quiz statistics: don't compute when a user views the qbank
Previously, when users viewed the question bank, if the quiz statistics
had not already been calculated, we would try to compute them there an then.
This could be very, very slow, leading to session lock problems.

Now, we never try to compute the statistics on the fly. Instead, we rely
on the existing \quiz_statistics\task\recalculate scheduled task to do it.
2023-05-15 10:04:33 +01:00
Jun Pataleta
28026b923a Merge branch 'MDL-76903-401' of https://github.com/laurentdavid/moodle into MOODLE_401_STABLE 2023-05-15 12:06:02 +08:00
Luca Bösch
f1dd604fce MDL-77432 mod_assign: Confirm submission page standard and not incourse 2023-05-12 09:44:22 +02:00
Cameron Ball
77eb2ed79b MDL-75898 assignfeedback_editpdf: Add randomness to PDF annotations
The behat step "I draw on the pdf" creates the exact same line every
time it is called. This can cause issues in a situation like the following:

- Student uploads PDF
- Teacher annotates page 1
- Student edits submission, adding another PDF
- Teacher annotates page 1 again
- When the student looks at their annotated PDF it appears the same as
  before they added the second PDF (i.e., they don't see extra pages for
  the second PDF)

Exactly why this happens isn't clear, and in practice this probably never
happens because the chances of drawing the exact same line twice are almost
0. However, when testing the functionality added in MDL-45580 it was causing
issues.
2023-05-12 09:14:03 +10:00
Cameron Ball
90350915c2 MDL-75898 assignfeedback_editpdf: Don't poll readonly pages
When requesting the readonly version of pages (which contain
teacher annotations), they should always be available - the
PHP side even throws an exception when they're not. This
means we don't need to worry about polling document converters
from the JS side and can just return the pages immediately.
2023-05-12 09:14:03 +10:00
Cameron Ball
825609ae08 MDL-75898 assignfeedback_editpdf: Improve page count mismatch logic
MDL-45580 introduced the readonlypages filearea, and when loading
page images for an attempt, the code would check if the pages existed
, creating them if not. The code inside this block also contained
a guard clause for the case where no readonly pages existed - which
is a situation that should not happen. Whenever readonly pages are
requested, they should exist.

MDL-66626 introduced a situation where page counts not matching would
also retrigger page generation. However this led to a situation where
the guard clause could be entered when requesting readonly pages.

This patch refactors the guard clause, and improves the logic to
regenerate pages.
2023-05-12 09:14:03 +10:00
Laurent David
20b4efad5c MDL-76903 mod_book: Fix activity completion
* Check only visibles pages to set completion status.
* Make sure we have consistent completion value in API and on the view page.
2023-05-11 12:09:24 +02:00