Merge branch 'MDL-74584-400-v1' of https://github.com/mihailges/moodle into MOODLE_400_STABLE

This commit is contained in:
Jun Pataleta
2022-05-06 14:17:37 +08:00
30 changed files with 387 additions and 7 deletions
+15 -4
View File
@@ -38,11 +38,22 @@
}
if (!empty($show) and confirm_sesskey()) {
$class = \core_plugin_manager::resolve_plugininfo_class('mod');
$class::enable_plugin($show, true);
$canenablemodule = true;
$modulename = $show;
admin_get_root(true, false); // settings not required - only pages
redirect(new moodle_url('/admin/modules.php'));
// Invoking a callback function that enables plugins to force additional actions (e.g. displaying notifications,
// modals, etc.) and also specify through its returned value (bool) whether the process of enabling the plugin
// should continue after these actions or not.
if (component_callback_exists("mod_{$modulename}", 'pre_enable_plugin_actions')) {
$canenablemodule = component_callback("mod_{$modulename}", 'pre_enable_plugin_actions');
}
if ($canenablemodule) {
$class = \core_plugin_manager::resolve_plugininfo_class('mod');
$class::enable_plugin($show, true);
admin_get_root(true, false); // Settings not required - only pages.
redirect(new moodle_url('/admin/modules.php'));
}
}
echo $OUTPUT->header();
+7
View File
@@ -1,5 +1,12 @@
This files describes API changes in /admin/*.
=== 4.0.1 ===
* A new callback xxx_pre_enable_plugin_actions has been added in admin/modules.php. Plugins can use this callback to
force additional actions (e.g. displaying notifications, modals, etc.) before enabling the plugin. The expected
return value (bool) from the plugin callback method specifies whether the process of enabling the plugin should
continue after the added actions or not.
=== 3.11 ===
* New admin setting admin_setting_encryptedpassword allows passwords in admin settings to be
+3 -2
View File
@@ -391,12 +391,13 @@ function course_integrity_check($courseid, $rawmods = null, $sections = null, $f
* and the value is a lang_string object with a human-readable string.
*
* @param bool $plural If true, the function returns the plural forms of the names.
* @param bool $resetcache If true, the static cache will be reset
* @return lang_string[] Localised human-readable names of all used modules.
*/
function get_module_types_names($plural = false) {
function get_module_types_names($plural = false, $resetcache = false) {
static $modnames = null;
global $DB, $CFG;
if ($modnames === null) {
if ($modnames === null || $resetcache) {
$modnames = array(0 => array(), 1 => array());
if ($allmods = $DB->get_records("modules")) {
foreach ($allmods as $mod) {
+11
View File
@@ -0,0 +1,11 @@
define("mod_bigbluebuttonbn/accept_dpa",["exports","core_form/modalform","core/notification","core/str"],(function(_exports,_modalform,_notification,_str){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}
/**
* Javascript module for confirming the acceptance of the current data processing agreement before enabling
* the BigBlueButton activity module.
*
* @module mod_bigbluebuttonbn/accept_dpa
* @copyright 2022 Mihail Geshoski <mihail@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_modalform=_interopRequireDefault(_modalform),_notification=_interopRequireDefault(_notification);_exports.init=()=>{const modalForm=new _modalform.default({modalConfig:{title:(0,_str.get_string)("enablingbigbluebutton","mod_bigbluebuttonbn"),large:!1},formClass:"mod_bigbluebuttonbn\\form\\accept_dpa",saveButtonText:(0,_str.get_string)("enable")});modalForm.addEventListener(modalForm.events.FORM_SUBMITTED,(event=>{event.detail.result?window.location.reload():_notification.default.addNotification({type:"error",message:event.detail.errors.join("<br>")})})),modalForm.show()}}));
//# sourceMappingURL=accept_dpa.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"accept_dpa.min.js","sources":["../src/accept_dpa.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Javascript module for confirming the acceptance of the current data processing agreement before enabling\n * the BigBlueButton activity module.\n *\n * @module mod_bigbluebuttonbn/accept_dpa\n * @copyright 2022 Mihail Geshoski <[email protected]>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport ModalForm from 'core_form/modalform';\nimport Notification from 'core/notification';\nimport {get_string as getString} from 'core/str';\n\n/**\n * Initialize module.\n */\nexport const init = () => {\n\n const modalForm = new ModalForm({\n modalConfig: {\n title: getString('enablingbigbluebutton', 'mod_bigbluebuttonbn'),\n large: false,\n },\n formClass: 'mod_bigbluebuttonbn\\\\form\\\\accept_dpa',\n saveButtonText: getString('enable'),\n });\n\n // Once the form has been submitted and successfully processed, reload the page to enable the activity module.\n modalForm.addEventListener(modalForm.events.FORM_SUBMITTED, event => {\n if (event.detail.result) {\n window.location.reload();\n } else {\n Notification.addNotification({\n type: 'error',\n message: event.detail.errors.join('<br>')\n });\n }\n });\n\n modalForm.show();\n};\n"],"names":["modalForm","ModalForm","modalConfig","title","large","formClass","saveButtonText","addEventListener","events","FORM_SUBMITTED","event","detail","result","window","location","reload","addNotification","type","message","errors","join","show"],"mappings":";;;;;;;;kMA+BoB,WAEVA,UAAY,IAAIC,mBAAU,CAC5BC,YAAa,CACTC,OAAO,mBAAU,wBAAyB,uBAC1CC,OAAO,GAEXC,UAAW,wCACXC,gBAAgB,mBAAU,YAI9BN,UAAUO,iBAAiBP,UAAUQ,OAAOC,gBAAgBC,QACpDA,MAAMC,OAAOC,OACbC,OAAOC,SAASC,+BAEHC,gBAAgB,CACzBC,KAAM,QACNC,QAAUR,MAAMC,OAAOQ,OAAOC,KAAK,aAK/CpB,UAAUqB"}
+56
View File
@@ -0,0 +1,56 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Javascript module for confirming the acceptance of the current data processing agreement before enabling
* the BigBlueButton activity module.
*
* @module mod_bigbluebuttonbn/accept_dpa
* @copyright 2022 Mihail Geshoski <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
import ModalForm from 'core_form/modalform';
import Notification from 'core/notification';
import {get_string as getString} from 'core/str';
/**
* Initialize module.
*/
export const init = () => {
const modalForm = new ModalForm({
modalConfig: {
title: getString('enablingbigbluebutton', 'mod_bigbluebuttonbn'),
large: false,
},
formClass: 'mod_bigbluebuttonbn\\form\\accept_dpa',
saveButtonText: getString('enable'),
});
// Once the form has been submitted and successfully processed, reload the page to enable the activity module.
modalForm.addEventListener(modalForm.events.FORM_SUBMITTED, event => {
if (event.detail.result) {
window.location.reload();
} else {
Notification.addNotification({
type: 'error',
message: event.detail.errors.join('<br>')
});
}
});
modalForm.show();
};
@@ -0,0 +1,104 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace mod_bigbluebuttonbn\form;
use context;
use moodle_exception;
use moodle_url;
use core_form\dynamic_form;
use mod_bigbluebuttonbn\local\config;
/**
* Accept data processing agreement form presented before enabling the BigBlueButton activity module.
*
* @package mod_bigbluebuttonbn
* @copyright 2022 Mihail Geshoski <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class accept_dpa extends dynamic_form {
/**
* Form definition
*/
protected function definition() {
$this->_form->addElement('html', \html_writer::tag('p',
get_string('enablingbigbluebuttondpainfo', 'mod_bigbluebuttonbn', config::DEFAULT_DPA_URL)));
$this->_form->addElement('checkbox', 'acceptdefaultdpa', false, get_string('acceptdpa', 'mod_bigbluebuttonbn'),
['class' => 'bold']);
$this->_form->addRule('acceptdefaultdpa', get_string('required'), 'required', null, 'client');
}
/**
* Return form context
*
* @return context
*/
protected function get_context_for_dynamic_submission(): context {
return \context_system::instance();
}
/**
* Check if current user has access to this form, otherwise throw exception.
*
* @return void
* @throws moodle_exception
*/
protected function check_access_for_dynamic_submission(): void {
require_capability('moodle/site:config', $this->get_context_for_dynamic_submission());
}
/**
* Process the form submission, used if form was submitted via AJAX.
*
* @return array
*/
public function process_dynamic_submission(): array {
$result = false;
$errors = [];
if ($this->get_data()->acceptdefaultdpa) {
try {
set_config('bigbluebuttonbn_default_dpa_accepted', true);
$result = true;
} catch (\Exception $e) {
$errors[] = $e->getMessage();
}
}
return [
'result' => $result,
'errors' => $errors,
];
}
/**
* Load in existing data as form defaults (not applicable).
*
* @return void
*/
public function set_data_for_dynamic_submission(): void {
}
/**
* Returns url to set in $PAGE->set_url() when form is being rendered or submitted via AJAX.
*
* @return moodle_url
*/
protected function get_page_url_for_dynamic_submission(): moodle_url {
return new moodle_url('/admin/modules.php', ['show' => 'bigbluebuttonbn', 'sesskey' => sesskey()]);
}
}
@@ -35,6 +35,9 @@ class config {
/** @var string Default bigbluebutton server shared secret */
public const DEFAULT_SHARED_SECRET = '0b21fcaf34673a8c3ec8ed877d76ae34';
/** @var string Default bigbluebutton data processing agreement url */
public const DEFAULT_DPA_URL = 'https://blindsidenetworks.com/dpa-moodle-free-tier';
/**
* Returns moodle version.
*
@@ -108,6 +111,7 @@ class config {
'lockonjoin_default' => true,
'lockonjoin_editable' => false,
'welcome_default' => '',
'default_dpa_accepted' => false,
];
}
+10
View File
@@ -174,6 +174,16 @@ class settings {
$item,
$settingsgeneral
);
$item = new \admin_setting_description(
'bigbluebuttonbn_dpa_info',
'',
get_string('config_dpa_note', 'bigbluebuttonbn', config::DEFAULT_DPA_URL),
);
$this->add_conditional_element(
'dpa_info',
$item,
$settingsgeneral
);
$settingsgeneral->add($item);
$item = new admin_setting_heading(
'bigbluebuttonbn_config_default_messages',
@@ -0,0 +1,58 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
declare(strict_types=1);
namespace mod_bigbluebuttonbn\task;
use core\task\adhoc_task;
use core\message\message;
use mod_bigbluebuttonbn\local\config;
/**
* Ad-hoc task to send a notification related to the disabling of the BigBlueButton activity module.
*
* The ad-hoc tasks sends a notification to the administrator informing that the BigBlueButton activity module has
* been disabled and they are required to confirm their acceptance of the data processing agreement prior to
* re-enabling it.
*
* @package mod_bigbluebuttonbn
* @copyright 2022 Mihail Geshoski <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class send_bigbluebutton_module_disabled_notification extends adhoc_task {
/**
* Execute the task.
*/
public function execute(): void {
$message = new message();
$message->component = 'moodle';
$message->name = 'notices';
$message->userfrom = \core_user::get_noreply_user();
$message->userto = get_admin();
$message->notification = 1;
$message->contexturl = (new \moodle_url('/admin/modules.php'))->out(false);
$message->contexturlname = get_string('modsettings', 'admin');
$message->subject = get_string('bigbluebuttondisablednotification_subject', 'mod_bigbluebuttonbn');
$message->fullmessageformat = FORMAT_HTML;
$message->fullmessagehtml = get_string('bigbluebuttondisablednotification', 'mod_bigbluebuttonbn',
config::DEFAULT_DPA_URL);
$message->smallmessage = strip_tags($message->fullmessagehtml);
message_send($message);
}
}
@@ -30,6 +30,7 @@ use mod_bigbluebuttonbn\local\proxy\recording_proxy;
use mod_bigbluebuttonbn\meeting;
use stdClass;
use testing_data_generator;
use core\plugininfo\mod;
trait testcase_helper_trait {
/** @var testing_data_generator|null */
@@ -47,6 +48,12 @@ trait testcase_helper_trait {
* @return array($context, $cm, $instance) Testable wrapper around the assign class.
*/
protected function create_instance(?stdClass $course = null, array $params = [], array $options = []): array {
// Prior to creating the instance, make sure that the BigBlueButton module is enabled.
$modules = \core_plugin_manager::instance()->get_plugins_of_type('mod');
if (!$modules['bigbluebuttonbn']->is_enabled()) {
mod::enable_plugin('bigbluebuttonbn', true);
}
if (!$course) {
$course = $this->get_course();
}
+33
View File
@@ -0,0 +1,33 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Install script for mod_bigbluebuttonbn.
*
* @package mod_bigbluebuttonbn
* @copyright 2022 Mihail Geshoski <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Perform the post-install procedures.
*/
function xmldb_bigbluebuttonbn_install() {
global $DB;
// Disable the BigBlueButton activity module on new installs by default.
$DB->set_field('modules', 'visible', 0, ['name' => 'bigbluebuttonbn']);
}
+20
View File
@@ -418,6 +418,26 @@ function xmldb_bigbluebuttonbn_upgrade($oldversion = 0) {
// Automatically generated Moodle v4.0.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2022041901) {
set_config('bigbluebuttonbn_default_dpa_accepted', false);
// If the default server configuration is used.
if (config::get('server_url') === config::DEFAULT_SERVER_URL) {
// Disable the BigBlueButton activity module.
$DB->set_field('modules', 'visible', 0, ['name' => 'bigbluebuttonbn']);
// Use an adhoc task to send a notification to inform the admin that the BigBlueButton activity module
// has been disabled and they are required to confirm their acceptance of the data processing agreement
// prior to re-enabling it.
$notificationtask = new mod_bigbluebuttonbn\task\send_bigbluebutton_module_disabled_notification();
core\task\manager::queue_adhoc_task($notificationtask);
}
// Bigbluebuttonbn savepoint reached.
upgrade_mod_savepoint(true, 2022041901, 'bigbluebuttonbn');
}
return true;
}
@@ -26,6 +26,7 @@
defined('MOODLE_INTERNAL') || die();
$string['activityoverview'] = 'You have upcoming BigBlueButton sessions';
$string['acceptdpa'] = 'I understand and accept the data processing agreement';
$string['bbbduetimeoverstartingtime'] = 'The close time must be later than the open time.';
$string['bbbdurationwarning'] = 'The maximum duration for this session is %duration% minutes.';
$string['bbbrecordwarning'] = 'This session may be recorded.';
@@ -43,7 +44,12 @@ $string['bigbluebuttonbn:unprotectrecordings'] = 'Unprotect recordings';
$string['bigbluebuttonbn:deleterecordings'] = 'Delete recordings';
$string['bigbluebuttonbn:importrecordings'] = 'Import recordings';
$string['bigbluebuttonbn'] = 'BigBlueButton';
$string['bigbluebuttondisablednotification_subject'] = 'BigBlueButton activity module disabled.';
$string['bigbluebuttondisablednotification'] = 'The BigBlueButton activity module has been disabled and any existing BigBlueButton course activities are currently not accessible. Prior to re-enabling this plugin, please ensure that you have read and accepted the <a href="{$a}" target="_blank">data processing agreement</a> with Blindside Networks Inc.';
$string['cannotperformaction'] = 'Cannot perform action {$a} on this recording';
$string['enablingbigbluebutton'] = 'Enabling BigBlueButton activity';
$string['enablingbigbluebuttondpainfo'] = 'In order to meet your data protection obligations, prior to enabling this plugin, you may need to ensure that you have read and accepted the <a href="{$a}" target="_blank">data processing agreement</a> with Blindside Networks Inc.<br/>
Please consult with your own privacy professionals for advice.';
$string['indicator:cognitivedepth'] = 'BigBlueButton cognitive';
$string['indicator:cognitivedepth_help'] = 'This indicator is based on the cognitive depth reached by the student in a BigBlueButton activity.';
$string['indicator:socialbreadth'] = 'BigBlueButton social';
@@ -124,6 +130,9 @@ $string['sendnotification'] = 'Send notification';
$string['minute'] = 'minute';
$string['minutes'] = 'minutes';
$string['config_dpa_note'] = 'Note: In order to meet your data protection obligations, prior to using a service provider for this plugin, you may need to ensure that you have read and accepted the service provider\'s data processing agreement.
For the default free BigBlueButton service provided by Blindside Networks Inc., please read and accept the following <a href="{$a}" target="_blank">data processing agreement</a>.<br/>
Please consult with your own privacy professionals for advice.';
$string['config_general'] = 'General settings';
$string['config_general_description'] = 'These settings are always used.';
$string['config_server_url'] = 'BigBlueButton server URL';
+20
View File
@@ -36,6 +36,7 @@ use mod_bigbluebuttonbn\local\helpers\reset;
use mod_bigbluebuttonbn\logger;
use mod_bigbluebuttonbn\meeting;
use mod_bigbluebuttonbn\recording;
use mod_bigbluebuttonbn\local\config;
global $CFG;
@@ -691,3 +692,22 @@ function bigbluebuttonbn_print_recent_activity(object $course, bool $viewfullnam
}
return true;
}
/**
* Callback method executed prior to enabling the activity module.
*
* @return bool Whether to proceed and enable the plugin or not.
*/
function bigbluebuttonbn_pre_enable_plugin_actions(): bool {
global $PAGE;
// If the default server configuration is used and the administrator has not accepted the default data processing
// agreement, do not enable the plugin. Instead, display a dynamic form where the administrator can confirm that he
// accepts the DPA prior to enabling the plugin.
if (config::get('server_url') === config::DEFAULT_SERVER_URL && !config::get('default_dpa_accepted')) {
$PAGE->requires->js_call_amd('mod_bigbluebuttonbn/accept_dpa', 'init', []);
return false;
}
// Otherwise, continue and enable the plugin.
return true;
}
@@ -6,6 +6,7 @@ Feature: bigbluebuttonbn instance
Background: Make sure that a course is created
Given a BigBlueButton mock server is configured
And I enable "bigbluebuttonbn" "mod" plugin
And the following "courses" exist:
| fullname | shortname | category |
| Test course | Test course | 0 |
@@ -4,6 +4,7 @@ When a bibluebutton instance has been created I can edit it
Background: Make sure that a course is created
Given a BigBlueButton mock server is configured
And I enable "bigbluebuttonbn" "mod" plugin
And the following config values are set as admin:
| bigbluebuttonbn_voicebridge_editable | 1 |
And the following "courses" exist:
@@ -6,6 +6,7 @@ Feature: Test the ability to end a meeting
Background:
Given a BigBlueButton mock server is configured
And I enable "bigbluebuttonbn" "mod" plugin
Scenario Outline: Only a BigBlueButton moderator can end a session
Given the following course exists:
@@ -5,6 +5,7 @@ Feature: Test the module in group mode.
# groupmode 1 = separate groups, we force the group
# groupmode 2 = visible group
Given a BigBlueButton mock server is configured
And I enable "bigbluebuttonbn" "mod" plugin
And the following "courses" exist:
| fullname | shortname | category | groupmode | groupmodeforce |
| Test Course 1 | C1 | 0 | 1 | 1 |
@@ -4,6 +4,7 @@ Feature: Test the ability to run the full meeting lifecycle (start to end)
Background:
Given a BigBlueButton mock server is configured
And I enable "bigbluebuttonbn" "mod" plugin
Scenario: Users should be able to join a meeting then end the meeting for themselves and
return to the meeting page to join again.
@@ -6,6 +6,7 @@ Feature: Test that the meeting has the right lock setting.
Background:
Given a BigBlueButton mock server is configured
And I enable "bigbluebuttonbn" "mod" plugin
@javascript
Scenario Outline: Teacher should be able to set the right lock feature in a given meeting
@@ -6,6 +6,7 @@ Feature: Test that meeting roles are sent to the server
Background:
Given a BigBlueButton mock server is configured
And I enable "bigbluebuttonbn" "mod" plugin
@javascript
Scenario Outline: Users should receive the appropriate role when joining the meeting
@@ -4,6 +4,7 @@ Feature: The recording can be managed through the room page
Background: Make sure that import recording is enabled and course, activities and recording exists
Given a BigBlueButton mock server is configured
And I enable "bigbluebuttonbn" "mod" plugin
And the following "courses" exist:
| fullname | shortname | category |
| Test Course 1 | C1 | 0 |
@@ -7,6 +7,7 @@ Feature: Manage and list recordings
And the following config values are set as admin:
| bigbluebuttonbn_importrecordings_enabled | 1 |
| bigbluebuttonbn_importrecordings_from_deleted_enabled | 1 |
And I enable "bigbluebuttonbn" "mod" plugin
And the following "courses" exist:
| fullname | shortname | category |
| Test Course 1 | C1 | 0 |
@@ -3,6 +3,7 @@ Feature: Bigbluebuttonbn rooms
When a meeting is created, roles for each type of participant can be changed
Background: Make sure that a course is created
Given I enable "bigbluebuttonbn" "mod" plugin
And the following course exists:
| name | Test course |
| shortname | C1 |
@@ -3,6 +3,7 @@ Feature: The recording can be managed through the room page and as a user I can
Background: Make sure that import recording is enabled and course, activities and recording exists
Given a BigBlueButton mock server is configured
And I enable "bigbluebuttonbn" "mod" plugin
And the following "courses" exist:
| fullname | shortname | category |
| Test Course 1 | C1 | 0 |
@@ -6,6 +6,7 @@ Feature: Test the ability to start a meeting
Background:
Given a BigBlueButton mock server is configured
And I enable "bigbluebuttonbn" "mod" plugin
Scenario Outline: Users should be able to join a session depending on the Wait for moderator to join setting
Given the following course exists:
@@ -24,6 +24,7 @@
* @author Jesus Federico (jesus [at] blindsidenetworks [dt] com)
*/
use core\plugininfo\mod;
use mod_bigbluebuttonbn\instance;
use mod_bigbluebuttonbn\logger;
use mod_bigbluebuttonbn\recording;
@@ -47,6 +48,12 @@ class mod_bigbluebuttonbn_generator extends \testing_module_generator {
* @return stdClass record from module-defined table with additional field cmid
*/
public function create_instance($record = null, array $options = null) {
// Prior to creating the instance, make sure that the BigBlueButton module is enabled.
$modules = \core_plugin_manager::instance()->get_plugins_of_type('mod');
if (!$modules['bigbluebuttonbn']->is_enabled()) {
mod::enable_plugin('bigbluebuttonbn', true);
}
$now = time();
$defaults = [
"type" => 0,
@@ -107,6 +107,9 @@ class mod_helper_trait_test extends \advanced_testcase {
$generator = $this->getDataGenerator();
list($bbactivitycontext, $bbactivitycm, $bbactivity) =
$this->create_instance(null, ['type' => instance::TYPE_RECORDING_ONLY]);
// Reset some static caches used by this test after enabling the plugin.
get_module_types_names(false, true);
$bbformdata = $this->get_form_data_from_instance($bbactivity);
// Enrol users in a course so he will receive the message.
@@ -137,6 +140,9 @@ class mod_helper_trait_test extends \advanced_testcase {
$generator = $this->getDataGenerator();
list($bbactivitycontext, $bbactivitycm, $bbactivity) =
$this->create_instance(null, ['type' => instance::TYPE_RECORDING_ONLY]);
// Reset some static caches used by this test after enabling the plugin.
get_module_types_names(false, true);
$bbformdata = $this->get_form_data_from_instance($bbactivity);
$bbformdata->update = false;
@@ -168,6 +174,9 @@ class mod_helper_trait_test extends \advanced_testcase {
$generator = $this->getDataGenerator();
list($bbactivitycontext, $bbactivitycm, $bbactivity) =
$this->create_instance(null, ['type' => instance::TYPE_RECORDING_ONLY]);
// Reset some static caches used by this test after enabling the plugin.
get_module_types_names(false, true);
$bbformdata = $this->get_form_data_from_instance($bbactivity);
$bbformdata->completionunlocked = 0;
$bbformdata->completion = COMPLETION_AGGREGATION_ANY;
+1 -1
View File
@@ -27,6 +27,6 @@
defined('MOODLE_INTERNAL') || die;
$plugin->version = 2022041900;
$plugin->version = 2022041901;
$plugin->requires = 2022041200;
$plugin->component = 'mod_bigbluebuttonbn';