Skip to content

Commit

Permalink
Merge pull request #367 from jrchamp/feature/option-webinar-by-default
Browse files Browse the repository at this point in the history
Feature/option webinar by default
  • Loading branch information
jrchamp authored Apr 8, 2022
2 parents 14b9219 + df1f215 commit 61f10d7
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lang/en/zoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@
$string['webinar_disable'] = 'Disable webinars';
$string['webinar_showonlyiflicense'] = 'Show webinar option only if the user has a license to host webinars';
$string['webinar_alwaysshow'] = 'Always show webinar option regardless if the user has a license to host webinars';
$string['webinar_by_default'] = 'Webinar by default';
$string['webinar_by_default_desc'] = 'Create Zoom instance as a webinar by default.';
$string['zoom:addinstance'] = 'Add a new Zoom meeting';
$string['week'] = 'Week(s)';
$string['weekoption_first'] = 'First';
Expand Down
2 changes: 1 addition & 1 deletion mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public function definition() {
}
$mform->addElement('advcheckbox', 'webinar', get_string('webinar', 'zoom'),
get_string('webinarthisis', 'zoom'), $webinarattr);
$mform->setDefault('webinar', 0);
$mform->setDefault('webinar', $config->webinardefault);
$mform->addHelpButton('webinar', 'webinar', 'zoom');
}
} else if ($this->current->webinar) {
Expand Down
5 changes: 5 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@
$webinarchoices);
$settings->add($offerwebinar);

$webinardefault = new admin_setting_configcheckbox('zoom/webinardefault',
get_string('webinar_by_default', 'mod_zoom'),
get_string('webinar_by_default_desc', 'mod_zoom'), 0, 1, 0);
$settings->add($webinardefault);

$encryptionchoices = array(ZOOM_ENCRYPTION_DISABLE => get_string('encryptiontype_disable', 'mod_zoom'),
ZOOM_ENCRYPTION_SHOWONLYIFPOSSIBLE => get_string('encryptiontype_showonlyife2epossible', 'mod_zoom'),
ZOOM_ENCRYPTION_ALWAYSSHOW => get_string('encryptiontype_alwaysshow', 'mod_zoom'));
Expand Down
10 changes: 10 additions & 0 deletions tests/advanced_passcode_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static function setUpBeforeClass(): void {

/**
* Tests that a default password of 6 numbers is created when settings are null.
* @covers ::zoom_create_default_passcode
*/
public function test_settings_default() {
$this->zoomdata = (object) mod_zoom_webservice::DEFAULT_MEETING_PASSWORD_REQUIREMENT;
Expand All @@ -59,6 +60,7 @@ public function test_settings_default() {

/**
* Tests that a password has the given minimum length.
* @covers ::zoom_create_default_passcode
*/
public function test_settings_length() {
$data = array('length' => 8,
Expand All @@ -75,6 +77,7 @@ public function test_settings_length() {

/**
* Tests that a password is all numbers when the setting is specified.
* @covers ::zoom_create_default_passcode
*/
public function test_settings_only_numeric() {
$data = array('length' => 10,
Expand All @@ -92,6 +95,7 @@ public function test_settings_only_numeric() {

/**
* Tests that a password has a letter when the setting is specified.
* @covers ::zoom_create_default_passcode
*/
public function test_settings_letter() {
$data = array('length' => null,
Expand All @@ -109,6 +113,7 @@ public function test_settings_letter() {

/**
* Tests that a password has uppercase and lowercase letters when the setting is specified.
* @covers ::zoom_create_default_passcode
*/
public function test_settings_upper_and_lower_letters() {
$data = array('length' => null,
Expand All @@ -127,6 +132,7 @@ public function test_settings_upper_and_lower_letters() {

/**
* Tests that a password has a special character when the setting is specified.
* @covers ::zoom_create_default_passcode
*/
public function test_settings_special_character() {
$data = array('length' => null,
Expand All @@ -144,6 +150,7 @@ public function test_settings_special_character() {

/**
* Tests that a password has correct length, a letter, and a special character when setting is specified.
* @covers ::zoom_create_default_passcode
*/
public function test_settings_all() {
$data = array('length' => 7,
Expand All @@ -162,6 +169,7 @@ public function test_settings_all() {

/**
* Tests that the password description is correct when all settings are present.
* @covers ::zoom_create_passcode_description
*/
public function test_pasword_description_all() {
$data = array('length' => 9,
Expand All @@ -183,6 +191,7 @@ public function test_pasword_description_all() {

/**
* Tests that the password description is correct when the only numeric option is present.
* @covers ::zoom_create_passcode_description
*/
public function test_pasword_description_only_numeric() {
$data = array('length' => 8,
Expand All @@ -203,6 +212,7 @@ public function test_pasword_description_only_numeric() {

/**
* Tests that the password description is correct when the default settings are present.
* @covers ::zoom_create_passcode_description
*/
public function test_pasword_description_default() {
$this->zoomdata = (object) mod_zoom_webservice::DEFAULT_MEETING_PASSWORD_REQUIREMENT;
Expand Down
2 changes: 2 additions & 0 deletions tests/error_handling_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public function setUp(): void {

/**
* Tests that uuid are encoded properly for use in web service calls.
* @covers ::zoom_is_meeting_gone_error
* @covers ::zoom_is_user_not_found_error
*/
public function test_correct_error_recognition() {
// Check meeting not found behavior.
Expand Down
1 change: 1 addition & 0 deletions tests/get_meeting_reports_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

/**
* PHPunit testcase class.
* @covers \mod_zoom\task\get_meeting_reports
*/
class get_meeting_reports_test extends advanced_testcase {

Expand Down
3 changes: 3 additions & 0 deletions tests/mod_zoom_grade_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function setUp(): void {

/**
* Tests that Zoom grades can be added and updated in the gradebook.
* @covers ::zoom_grade_item_update
*/
public function test_grade_added() {
$params['course'] = $this->course->id;
Expand Down Expand Up @@ -87,6 +88,7 @@ public function test_grade_added() {

/**
* Tests that the Zoom grade type cannot be changed to NONE if grades are already inputted.
* @covers ::zoom_grade_item_update
*/
public function test_grade_type_not_none() {
$params['course'] = $this->course->id;
Expand Down Expand Up @@ -117,6 +119,7 @@ public function test_grade_type_not_none() {

/**
* Tests that the Zoom grades can be deleted.
* @covers ::zoom_grade_item_delete
*/
public function test_grade_delete() {
$params['course'] = $this->course->id;
Expand Down
1 change: 1 addition & 0 deletions tests/mod_zoom_invitation_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

/**
* PHPunit testcase class for invitations.
* @covers \mod_zoom\invitation
*/
class mod_zoom_invitation_test extends advanced_testcase {

Expand Down
1 change: 1 addition & 0 deletions tests/mod_zoom_webservice_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

/**
* PHPunit testcase class.
* @covers \mod_zoom_webservice
*/
class mod_zoom_webservice_test extends advanced_testcase {

Expand Down

0 comments on commit 61f10d7

Please sign in to comment.