Not all global search configurations offer the same results as the
default course search does.
The default course search will return courses that the user can see
the details of even if they can see them via a category, even if
they are not enrolled and cannot enrol themselves on it.
The equivalent global search configuration is:
* Global search is enabled
* The course indexing is enabled
* All the name and summary of all courses are included in the results
This patch will only let global search replace the default course
search when those criteria are met.
It will also display on the global search configuration page if global
search will replace the legacy course search.
The method can_edit_content() now supports more scenarios where the
H5P content can be edited:
- Instead of supporting only mod_h5pactivity, now it supports any
mod or block when the user has the addinstance capability.
- If the component implements the can_edit_content method in the
h5p\canedit class and it returns true. For instance, the mod_forum
implements it and return true when filearea is post, if the user
can edit the post where the H5P is.
Depending on whether the secondary navigation is shown or not will
determine if the link to the responses is shown on the view.php
page.
Co-authored-by: Sujith Haridasan <sujith@moodle.com>
The problem (coincidence of contexts) was detected when running
oracle phpunit tests, so we skipped the tests as part of MDL-72743.
Now, with the problem fixed (previous commit), we can bring back
that test.
Though it's really rare for this to happen (it only was discovered
when running unit tests with Oracle), it's possible to get
problems restoring courses when context ids in the backup file
do match existing contexts in the restore target site in certain
ways (see the issue for more information).
This change just ensures that every call to the method (that
happens 4 times, for sys, coursecat, course and module levels):
prechek_precheck_qbanks_by_level()
Is processed always for that level. Before the patch it was
possible (hardly but possible) to return question categories
belonging to another level when some qcats contexts were matching
between the backup file and the target site.