This commit integrate and clean the social activities block to use the
standard course format outputs and the course editor modules. The code
is similar to the one used in the site_main_menu block and cleanup most
of the ancient code.
The commit adds all the necessary methods to allow social format to use
the course editor. The code is similar to the one used in the frontpage
format. The commit does not include the migration of the
social_activities blocks.
Some formats like the social need the blocks and drawers to access the
course editor. However, the include_course_ajax was called after the
main page structure is created and produces some errors, especially in
behat. Now include_course_ajax is called before the page header.
The course_ajax_enabled was using a course_format_ajax_support which
does not initialize the course format with the correct parameters.
Having a global function to get something the format base format can
provide is unnecessary and redudant, for this reason the function is now
deprecated.
This condition was checking whether navgfilter was true, and the
stringfilter was also true.
In most cases the condition will have actually worked correctly, albeit
by fluke. For users upgrading or otherwise missing the navfilter
configuration this condition led to warnings.
Refactor workshop participant queries to improve performance.
This commit refactors how the authors/reviewers selectors are done in
mod_workshop. Previously this was trying to do all the work within SQL
so querying user roles and capabilities, with massive UNIONS for each
group on the course, which on big courses lead to SQL thousands of
lines long which broke the page, or took 5+ minutes to load.
This has been refactored to try and query only what is required
and then do capability checks within code instead of SQL.
The current code may have a bug. If users set the audio bit rate to
a non-supported value, such as 1000,
Firefox will display an error in the console,
while Chrome will create the recorded audio file successfully,
but it will have no sound. I tested this on Ubuntu 24.04.
The minimum bit rate threshold varies depending on the audio format.
During my tests with Firefox version 131.0.3, which uses
the audio/Ogg format, I found that the minimum supported value
is 24000. In Chrome 129.0.6668.70, which uses the audio/MP4 format,
the minimum supported value is 2400.
Due to these differences, I decided to change the input from
a text field to a select field, offering options that support both
Ogg and MP4 audio formats.
The database conversion for the old value has been provided in
the lib/db/upgrade.php. The script will find the closest match to
the current data and update it accordingly.