1423 Commits

Author SHA1 Message Date
Andrew Nicols
75587e23c6
MDL-79890 core: Update uses of array_keys with multiple params
These now call the newly minted `moodle_array_keys_filter` method.
2023-11-15 09:14:40 +08:00
Mark Johnson
f3fc03e90c MDL-79615 course: Improve efficency of cache rebuilds
When bulk-updating course module visibility, set_coursemodule_visibily
was triggering a partial cache purge and rebuild for each course module.
This potentially led to 2 cache sets each requiring a lock to be
acquired and released per course module, plus any other cache updates
for other changes to the course in the same request.

This adds a new $rebuildcache paramter to the
set_coursemodule_visibilty, which is true by default to retain the
existing behaviour. If set false, it will skip doing the partial purge
and rebuild for that course module, and it is up to the calling code to
ensure the cache is updated as requried.

To assist with this, there is a new
course_modinfo::purge_course_module_cache_multiple() method, which
allows multiple course modules to be purged from the cache in a single
cache set.
2023-10-27 10:50:40 +01:00
Michael Hawkins
329a9e97d2
MDL-79573 communication: Support new records for each provider type
Previously, we replaced information in the same communication record
in the database, now there will be a unique record per provider.
This ensures when switching between different providers, the correct
actions such as room member management can be actioned for the correct
provider.

This also includes the required updates for the instances to no
longer assume a provider must be enabled to be relevant. Specifying a
provider is optional to fetch a specific provider instance, the default
will use the currently enabled provider.
2023-10-06 09:54:32 +08:00
Andrew Nicols
99c1543aa8
MDL-79581 communication: Context is a mandatory field
The API was incorrectly assuming that all uses of the API were for a
course, and that the instanceid of the communication instance was a
course id. These assumptions are both entirely wrong.

The API is intended to support a range of uses including use at the
site, user, and activity levels.

Furthermore, if a group were to be used, then the instanceid should be
of that group's id, and therefore the contextid would need to be fetched
or that group's course instead.

The only solution here is to add a new contextid field to the table, and
implement it all parts of the API.
2023-10-04 20:37:57 +08:00
Mikel Martín
d9a61945b6 MDL-78972 core_courseformat: Change delete actions link colours to red 2023-09-04 11:36:51 +02:00
Jun Pataleta
928ea71887
Merge branch 'MDL-78397' of https://github.com/paulholden/moodle 2023-08-25 11:52:57 +08:00
Jun Pataleta
932306b447
Merge branch 'MDL-77917-master' of https://github.com/andrewnicols/moodle 2023-08-24 23:39:10 +08:00
Andrew Nicols
914686bc5e
MDL-77917 communication_matrix: Support server API versions
This commit brings in support for multiple versions of the Matrix
specification.

A Matrix server is compromised of a number of individually versioned API
endpoints, for example:

    /_matrix/client/v3/createRoom
    /_matrix/client/v3/rooms/:roomid/joined_members
    /_matrix/media/v1/create

The combination of a large number of these individually versioned
endpoints forms a Matrix Specification version.

For example:

* the /_matrix/media/v1/create endpoint was created for version 1.7 of the
  specification, and does not exist in earlier versions.
* in the future a new behaviour or parameter may be created for the
  `createRoom` endpoint and a new endpoint created at:

    /_matrix/client/v4/createRoom

A single server can support multiple versions of the Matrix
specification. The server declares the versions of the specification
that it supports using a non-versioned endpoint at
`/_matrix/client/versions`.

As a Matrix client, Moodle should:
* query the server version endpoint
* determine the combination of mutually supported Matrix specification
  versions
* create a client instance of the highest-supported version of the
  specification.

For example, if Moodle (Matrix client) and a remote server have the
following support:

```
Moodle:      1.1  1.2  1.3  1.4  1.5  1.6  1.7
Server:  r0  1.1  1.2  1.3  1.4  1.5  1.6
```

The versions in common are 1.1 through 1.6, and version 1.6 would be
chosen.

To avoid duplication and allow for support of future features more
easily, the Moodle client is written as:
* a set of classes named `v1p1` through `v1p7` (currently) which extend
  the `matrix_client` abstract class; and
* a set if PHP traits which provide the implementation for individual
  versioned endpoints.

Each client version then imports any relevant traits which are present
in that version of the Matrix Specification. For example versions 1.1 to
1.6 do _not_ have the `/_matrix/media/v1/create` endpoint so they do not
import this trait. This trait was introduced in version 1.7, so the
trait is included from that version onwards.

In the future, if an endpoint is created which conflicts with an
existing endpoint, then it would be easy to create a new client version
which uses the existing common traits, and adds the new trait.

Each endpoint is written using a `command` class which extends the
Guzzle implementation of the PSR-7 Request interface. This command
class adds support for easy creation of:
* path parameters within the URI
* query parameters
* body parameters

This is done to avoid complex patterns of Request creation which are
repeated for every client endpoint.
2023-08-24 11:59:25 +08:00
Paul Holden
8ca8c92f3c
MDL-78397 course: update module name using API after duplicating.
This ensures that various ancillary tasks are also performed (such
as ensuring the gradebook item name matches).
2023-08-23 09:14:04 +01:00
Ferran Recio
ee2e084e89 MDL-78291 core_courseformat: availability in activity action menu 2023-08-22 09:39:13 +02:00
Ferran Recio
cb541081bd MDL-78203 core_courseformat: groupmode action menu item 2023-08-11 17:24:18 +02:00
Huong Nguyen
aeeb1653c0
Merge branch 'MDL-78553-master' of https://github.com/davewoloszyn/moodle 2023-08-03 09:44:24 +07:00
David Woloszyn
317251a978 MDL-78553 core_communication: Move settings to their own page 2023-08-03 12:36:04 +10:00
Andrew Nicols
8b97071c94
MDL-78738 core_communication: Set avatar from a stored_file
We should always use a stored_file instance to set the avatar, and never
a data uri. Especially where the datauri is from Moodle itself.

This change requires a number of changes in associated locations.

I am not adding this change to any upgrade notes as this is a
master-only feature.

Note: I have removed some tests and will not consider fixing them
because I will be entirely removing that test file in a subsequent issue
(MDL-77917).
2023-08-01 19:50:14 +08:00
Andrew Nicols
0a5c1ea5f9
MDL-78738 core_course: Add helper to get the course image 2023-08-01 19:50:14 +08:00
Ferran Recio
01e0e56665 MDL-78282 core_courseformat: interactive visibility badges 2023-07-26 15:44:28 +02:00
Paul Holden
58963baba4
MDL-77645 course: ensure active enrolments are considered for drawer.
Otherwise the enrolment index page tries to load the course index
drawer, which doesn't exist at this point and triggers exceptions in
the editor module.

Co-authored-by: Tim Volckmann <tim.volckmann@mastersolution.com>
2023-07-12 14:26:17 +01:00
Paul Holden
e3583a2302
MDL-78385 course: fix non-AJAX activity indentation URL parameter. 2023-06-14 12:58:13 +01:00
Safat
982938fa04 MDL-77357 core_course: Api call for dynamic form fields 2023-06-01 00:39:03 +10:00
Safat
ad5c10016a MDL-77576 core_course: Implement communication api
This commit implements the core communication api in the
core course to create or update matrix roomand its members
according to course settings. This commit will add the
communicaiton room in the course so that users can access
communication room from course.

Originally implemented as MDL-76702, MDL-76705 and MDL-76703.

Co-Authored-By: David Woloszyn <david.woloszyn@moodle.com>
Co-Authored-By: Safat Shahin <safat.shahin@moodle.com>
2023-05-11 13:35:16 +10:00
Jun Pataleta
860f85e8b8 Merge branch 'MDL-77670-master' of https://github.com/juancs/moodle 2023-03-28 07:04:23 +08:00
Juan Segarra Montesinos
adb63ac50e MDL-77670 course: Preserve course summary format 2023-03-17 20:56:26 +01:00
Ferran Recio
856b295569 MDL-76851 core_courseformat: plugin custom editor strings
Most section related actions require the frontend to use alternative
strings depending on the format plugin lang file. This patch adds
overridden strings to the current setViewFormat course editor setup
object.
2023-03-17 11:07:13 +01:00
Mathew May
e5ca7766e7 MDL-52805 core: Remove legacy log calls 2023-03-07 13:08:46 +08:00
Andrew Nicols
0c8b3749f2 Merge branch 'MDL-40600-master-duplicate_section' of https://github.com/alexmorrisnz/moodle 2023-03-02 09:23:05 +08:00
Amaia Anabitarte
b37fe9a088 MDL-76990 core_course: Recover move right/left functionality 2023-02-27 18:27:57 +01:00
Alex Morris
f1c4cc73df
MDL-40600 course: Add ability to duplicate section 2023-02-27 09:10:36 +13:00
Tomo Tsuyuki
9e725bc168 MDL-45301 assign: Add font options for EditPDF 2023-02-17 15:30:25 +11:00
Ferran Recio
1113f8328e MDL-76432 core_courseformat: migrate file drag and drop
Replace the old course/dragdrop.js file (which was not even minimised)
to AMD modules and integrate them to the new reactive course editor.
From now on, a file can be drop over any course section, no matter if it
is in the course content or in the course index. It will also start
using the new process monitor to show the uploading state to the user.
2023-02-06 12:59:25 +01:00
Ferran Recio
35a12cfffb MDL-74987 core_courseformat: migrate duplicate to state action 2023-01-04 09:25:52 +01:00
Ferran Recio
fe4784e60f MDL-74989 core_courseformat: migrate cm delete to reactive
Migrate the course index delete activities to the new reactive actions
with batch deletion.
2023-01-03 13:07:31 +01:00
hieuvu
c6e018e04e MDL-58266 core_completion: Add new view table. 2022-10-14 00:30:28 +07:00
Ferran Recio
8777705827 MDL-73933 core_courseformat: hide and show reactive action
Hide, show and stealth actions were still using the old YUI
module. Now they are using the new course editor
2022-09-15 16:39:29 +02:00
Ferran Recio
dc63d643b8 MDL-74800 core_courseformat: fix accessibility checks 2022-08-08 14:46:42 +02:00
Jun Pataleta
c5e19c2ba6 Merge branch 'MDL-75208' of https://github.com/stronk7/moodle 2022-07-21 11:26:52 +08:00
Eloy Lafuente (stronk7)
ca7890f2fc MDL-75208 oracle: Amend a couple of queries to make Oracle happy
The changes introduced here are completely safe, just we stop
binding SITEID and, instead, embed it in the SQL.

Why? Because Oracle 21 has started to return non-sense results
when SITEID is bound.

After lots of tests, attempts, debugging... we have been unable
to find any logic to the need of this change and also, have been
unable to reproduce the problem with a standalone script that
pretty much runs the same queries that the ones changed here.

I'm sure that there is something, somewhere, but have failed
to find it, grrr.

Please read MDL-75208 and linked issues to find more information
about this problem, that is one of the biggest mysteries I've
seen recently. Maybe at the end there is a tiny detail that
explains it all, but it's really well hidden.
2022-07-19 09:48:33 +02:00
Ilya Tregubov
31badf8221 Merge branch 'MDL-72905-master' of https://github.com/golenkovm/moodle 2022-07-18 12:41:50 +04:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Mikhail Golenkov
7725abc4a8 MDL-72905 course: Add new callback for timeline classification 2022-07-04 14:47:07 +10:00
Mihail Geshoski
90f517cf1f MDL-74584 course: New optional parameter in get_module_types_names()
Adds new parameter in get_module_types_names() to optionally reset
the $modnames static cache.
2022-05-06 14:39:06 +08:00
Andrew Nicols
27bed0b928 Merge branch 'MDL-72991-master-4' of https://github.com/HuongNV13/moodle 2022-03-17 22:25:10 +08:00
Sara Arjona
dbb63cfffc Merge branch 'MDL-73863-master' of https://github.com/mihailges/moodle 2022-03-17 11:33:58 +01:00
Huong Nguyen
bfe14e2312 MDL-72991 Course: Partial course cache rebuild with cache versioning 2022-03-17 15:34:26 +07:00
Huong Nguyen
457d10a49f MDL-72991 Course: Fix move_section_to is not updating correct section
When we change the position of two sections, we just need to update
the position of the affected sections, not all the sections in the course.
This will improve the performance since the system only executes the queries to affected sections.
Also, the system only clears the cache for affected sections, not all the sections in the course.
2022-03-17 15:34:26 +07:00
Dongsheng Cai
f97b86e841 MDL-72991 Course: Partial course cache rebuild
When updating/deleting a section/module, the system now only
invalidate of the element (section/module), not the whole course cache
Also, the system now only recalculate the cache for element (section/module)
if necessary, not the whole course cache

Move module/section purging to course_modinfo:
  + course_modinfo::purge_course_section_cache_by_id was created to purge section by id
  + course_modinfo::purge_course_section_cache_by_number was created to purge section by number
  + course_modinfo::purge_course_module_cache was created to purge module
2022-03-17 15:34:01 +07:00
Mihail Geshoski
36fe5695fe MDL-73863 course: Add tertiary navigation in completion pages 2022-03-10 12:28:39 +08:00
Sara Arjona
9b5da4de17 Merge branch 'MDL-73993-master' of https://github.com/golenkovm/moodle 2022-03-09 13:24:29 +01:00
Mikhail Golenkov
8c914c8756 MDL-73993 phpdoc: get_module_types_names returns lang_string objects 2022-03-03 10:39:09 +11:00
Peter Dias
f1959af7f6 MDL-73462 course: Introduce course category tertiary navigation
Update the category management page.
2022-03-01 17:57:24 +08:00
Ferran Recio
c64bef51a9 MDL-73547 core_courseformat: enable course index cache
Adding caches to the course editor reactive state. The patch improve the
course index loading.
2022-02-21 12:33:33 +01:00