Skip to content

Commit

Permalink
Moved recordingtype string function. Added check to update existing n…
Browse files Browse the repository at this point in the history
…ames.
  • Loading branch information
cebounph committed Mar 21, 2024
2 parents cb15cef + a2d09e1 commit 0dd7ed9
Show file tree
Hide file tree
Showing 50 changed files with 1,744 additions and 573 deletions.
444 changes: 444 additions & 0 deletions CHANGES.md

Large diffs are not rendered by default.

401 changes: 0 additions & 401 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/form.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/form.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions amd/src/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,12 @@ define(['jquery', 'core/form-autocomplete', 'core/str', 'core/notification'], fu
* Breakout rooms editor.
*/
var BreakoutroomsEditor = function() {
this.roomsListColumn = $("#meeting-rooms-list");
this.roomsListColumn = $("#mod-zoom-meeting-rooms-list");
this.roomsList = $("ul", this.roomsListColumn);
this.addBtn = $("#add-room", this.roomsListColumn);
this.emptyAlert = $(".empty-alert", this.roomsListColumn);
this.deleteBtn = $(".delete-room", this.roomsListColumn);
this.roomsDataColumn = $("#meeting-rooms-data");
this.roomsDataColumn = $("#mod-zoom-meeting-rooms-data");
this.roomItemToClone = $('#rooms-list-item').html();
this.roomItemDataToClone = $('#rooms-list-item-data').html();
this.initialRoomsCount = parseInt(this.roomsListColumn.attr('data-initial-rooms-count'));
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/backup_zoom_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class backup_activity_structure_step extends \backup_activity_structure_step {
protected function define_structure() {
// Define the root element describing the zoom instance.
$zoom = new backup_nested_element('zoom', ['id'], [
'intro', 'introformat', 'grade', 'meeting_id', 'start_url', 'join_url', 'created_at', 'host_id', 'name',
'intro', 'introformat', 'grade', 'grading_method', 'meeting_id', 'join_url', 'created_at', 'host_id', 'name',
'start_time', 'timemodified', 'recurring', 'recurrence_type', 'repeat_interval', 'weekly_days', 'monthly_day',
'monthly_week', 'monthly_week_day', 'monthly_repeat_option', 'end_times', 'end_date_time', 'end_date_option',
'webinar', 'duration', 'timezone', 'password', 'option_jbh', 'option_start_type', 'option_host_video',
Expand Down
4 changes: 2 additions & 2 deletions backup/moodle2/restore_zoom_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

require_once($CFG->dirroot . '/mod/zoom/locallib.php');

use moodle_exception;
use restore_path_element;

/**
Expand Down Expand Up @@ -57,7 +58,7 @@ protected function define_structure() {
protected function process_zoom($data) {
global $DB;

$data = (object)$data;
$data = (object) $data;

// Update start_time before attempting to create a new meeting.
$data->start_time = $this->apply_date_offset($data->start_time);
Expand All @@ -68,7 +69,6 @@ protected function process_zoom($data) {
$data = populate_zoom_from_response($data, $updateddata);
$data->exists_on_zoom = ZOOM_MEETING_EXISTS;
} catch (moodle_exception $e) {
$data->start_url = '';
$data->join_url = '';
$data->meeting_id = 0;
$data->exists_on_zoom = ZOOM_MEETING_EXPIRED;
Expand Down
4 changes: 3 additions & 1 deletion classes/analytics/indicator/activity_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@

namespace mod_zoom\analytics\indicator;

use core_analytics\local\indicator\community_of_inquiry_activity;

/**
* Activity base class.
*/
abstract class activity_base extends \core_analytics\local\indicator\community_of_inquiry_activity {
abstract class activity_base extends community_of_inquiry_activity {
/**
* Grading not implemented.
*
Expand Down
9 changes: 6 additions & 3 deletions classes/analytics/indicator/cognitive_depth.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

namespace mod_zoom\analytics\indicator;

use cm_info;
use lang_string;

/**
* Cognitive depth indicator - zoom.
*/
Expand All @@ -33,8 +36,8 @@ class cognitive_depth extends activity_base {
*
* @return object
*/
public static function get_name(): \lang_string {
return new \lang_string('indicator:cognitivedepth', 'mod_zoom');
public static function get_name(): lang_string {
return new lang_string('indicator:cognitivedepth', 'mod_zoom');
}

/**
Expand All @@ -53,7 +56,7 @@ public function get_indicator_type() {
*
* @return integer
*/
public function get_cognitive_depth_level(\cm_info $cm) {
public function get_cognitive_depth_level(cm_info $cm) {
return self::COGNITIVE_LEVEL_1;
}
}
9 changes: 6 additions & 3 deletions classes/analytics/indicator/social_breadth.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

namespace mod_zoom\analytics\indicator;

use cm_info;
use lang_string;

/**
* Social breadth indicator.
*/
Expand All @@ -35,8 +38,8 @@ class social_breadth extends activity_base {
*
* @return object
*/
public static function get_name(): \lang_string {
return new \lang_string('indicator:socialbreadth', 'mod_zoom');
public static function get_name(): lang_string {
return new lang_string('indicator:socialbreadth', 'mod_zoom');
}

/**
Expand All @@ -55,7 +58,7 @@ public function get_indicator_type() {
*
* @return integer
*/
public function get_social_breadth_level(\cm_info $cm) {
public function get_social_breadth_level(cm_info $cm) {
return self::SOCIAL_LEVEL_2;
}
}
4 changes: 3 additions & 1 deletion classes/api_limit_exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

namespace mod_zoom;

use stdClass;

/**
* Exceeded daily API limit.
*/
Expand All @@ -43,7 +45,7 @@ class api_limit_exception extends webservice_exception {
public function __construct($response, $errorcode, $retryafter) {
$this->retryafter = $retryafter;

$a = new \stdClass();
$a = new stdClass();
$a->response = $response;
parent::__construct(
$response,
Expand Down
9 changes: 6 additions & 3 deletions classes/event/join_meeting_button_clicked.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

namespace mod_zoom\event;

use coding_exception;
use moodle_url;

/**
* Records when a join meeting button is clicked.
*/
Expand All @@ -44,9 +47,9 @@ protected function validate_data() {
$fieldstovalidate = ['cmid' => "integer", 'meetingid' => "integer", 'userishost' => "boolean"];
foreach ($fieldstovalidate as $field => $shouldbe) {
if (is_null($this->other[$field])) {
throw new \coding_exception("The $field value must be set in other.");
throw new coding_exception("The $field value must be set in other.");
} else if (gettype($this->other[$field]) != $shouldbe) {
throw new \coding_exception("The $field value must be an $shouldbe.");
throw new coding_exception("The $field value must be an $shouldbe.");
}
}
}
Expand Down Expand Up @@ -76,6 +79,6 @@ public function get_description() {
* @return moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/zoom/view.php', ['id' => $this->other['cmid']]);
return new moodle_url('/mod/zoom/view.php', ['id' => $this->other['cmid']]);
}
}
2 changes: 2 additions & 0 deletions classes/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@

require_once("$CFG->libdir/externallib.php");

use context_module;
use external_api;
use external_function_parameters;
use external_single_structure;
use external_value;
use external_warnings;
use invalid_response_exception;

/**
* Zoom external functions
Expand Down
14 changes: 9 additions & 5 deletions classes/invitation.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@

namespace mod_zoom;

use coding_exception;
use context_module;
use moodle_exception;

/**
* Invitation class.
*/
Expand Down Expand Up @@ -81,11 +85,11 @@ public function get_display_string(int $coursemoduleid, int $userid = null) {
}

// Check user capabilities, and remove parts of the invitation they don't have permission to view.
if (!has_capability('mod/zoom:viewjoinurl', \context_module::instance($coursemoduleid), $userid)) {
if (!has_capability('mod/zoom:viewjoinurl', context_module::instance($coursemoduleid), $userid)) {
$displaystring = $this->remove_element($displaystring, 'joinurl');
}

if (!has_capability('mod/zoom:viewdialin', \context_module::instance($coursemoduleid), $userid)) {
if (!has_capability('mod/zoom:viewdialin', context_module::instance($coursemoduleid), $userid)) {
$displaystring = $this->remove_element($displaystring, 'onetapmobile');
$displaystring = $this->remove_element($displaystring, 'dialin');
$displaystring = $this->remove_element($displaystring, 'sip');
Expand All @@ -94,7 +98,7 @@ public function get_display_string(int $coursemoduleid, int $userid = null) {
// Fix the formatting of the onetapmobile section if it exists.
$displaystring = $this->add_paragraph_break_above_element($displaystring, 'onetapmobile');
}
} catch (\moodle_exception $e) {
} catch (moodle_exception $e) {
// If the regex parsing fails, log a debugging message and return the whole invitation.
debugging($e->getMessage(), DEBUG_DEVELOPER);
return $this->invitation;
Expand All @@ -120,7 +124,7 @@ private function remove_element(string $invitation, string $element): string {

$configregex = $this->get_config_invitation_regex();
if (!array_key_exists($element, $configregex)) {
throw new \coding_exception('Cannot remove element: ' . $element
throw new coding_exception('Cannot remove element: ' . $element
. '. See mod/zoom/classes/invitation.php:get_default_invitation_regex for valid elements.');
}

Expand All @@ -134,7 +138,7 @@ private function remove_element(string $invitation, string $element): string {

// If invitation is null, an error occurred in preg_replace.
if ($invitation === null) {
throw new \moodle_exception(
throw new moodle_exception(
'invitationmodificationfailed',
'mod_zoom',
$PAGE->url,
Expand Down
Loading

0 comments on commit 0dd7ed9

Please sign in to comment.