From 918a32590fde0ae6ad2515c435a6487b121cabbb Mon Sep 17 00:00:00 2001 From: NinaHerrmann Date: Wed, 22 Nov 2023 15:05:52 +0100 Subject: [PATCH] Using moodle bautifier to fix at least the most obvious problem - hope it doesn't break anything --- .github/workflows/moodle-ci.yml | 2 +- .github/workflows/moodle-release.yml | 2 +- README.md | 47 +- addactivity.php | 37 +- addactivityepisode.php | 32 +- addlti.php | 27 +- addltiepisode.php | 32 +- addtranscription.php | 25 +- addvideo.php | 81 +- amd/src/block_form_handler.js | 29 +- amd/src/block_index.js | 104 +- amd/src/block_lti_form_handler.js | 4 +- amd/src/block_manage_series.js | 123 +- amd/src/block_settings.js | 108 +- amd/src/tabulator.js | 41984 ++++++++-------- .../backup_opencast_block_task.class.php | 30 +- backup/moodle2/backup_opencast_stepslib.php | 21 +- .../restore_opencast_block_task.class.php | 31 +- backup/moodle2/restore_opencast_stepslib.php | 25 +- .../settings/block_backup_setting.class.php | 6 +- .../settings/block_restore_setting.class.php | 3 +- block_opencast.php | 19 +- changeowner.php | 34 +- changescheduledvisibility.php | 23 +- changevisibility.php | 40 +- classes/admin_setting_configeditabletable.php | 20 +- classes/admin_setting_configtextvalidate.php | 11 +- classes/admin_setting_hiddenhelpbtn.php | 20 +- classes/enrolled_user_selector.php | 16 +- classes/event/upload_failed.php | 24 +- classes/event/upload_succeeded.php | 24 +- classes/external.php | 119 +- classes/groupaccess.php | 28 +- classes/local/activitymodulemanager.php | 130 +- classes/local/addactivity_form.php | 30 +- classes/local/addactivityepisode_form.php | 28 +- classes/local/addlti_form.php | 30 +- classes/local/addltiepisode_form.php | 28 +- classes/local/addtranscription_form.php | 13 +- classes/local/addvideo_form.php | 100 +- classes/local/apibridge.php | 688 +- classes/local/attachment_helper.php | 70 +- .../local/autocomplete_suggestion_helper.php | 22 +- classes/local/changeowner_form.php | 8 +- classes/local/event.php | 115 +- .../local/eventstatus_notification_helper.php | 55 +- classes/local/file_deletionmanager.php | 30 +- classes/local/file_system_filedir.php | 9 +- classes/local/flexible_table.php | 10 +- classes/local/importvideos_coursesearch.php | 8 +- .../local/importvideos_select_series_form.php | 14 +- classes/local/importvideos_step1_form.php | 10 +- classes/local/importvideos_step2_form.php | 11 +- classes/local/importvideos_step3_form.php | 37 +- classes/local/importvideos_step3_form_acl.php | 10 +- classes/local/importvideos_step4_form.php | 8 +- classes/local/importvideosmanager.php | 105 +- classes/local/ingest_uploader.php | 111 +- classes/local/liveupdate_helper.php | 27 +- classes/local/lti_helper.php | 6 +- classes/local/ltimodulemanager.php | 236 +- classes/local/managedefaults_form.php | 26 +- classes/local/notifications.php | 69 +- classes/local/scheduledvisibility_form.php | 38 +- classes/local/series_form.php | 37 +- classes/local/updatemetadata_form.php | 30 +- classes/local/upload_helper.php | 134 +- classes/local/visibility_form.php | 35 +- classes/local/visibility_helper.php | 129 +- classes/opencast_connection_exception.php | 5 +- classes/opencast_state_exception.php | 5 +- classes/output/importvideos/renderer.php | 119 +- classes/privacy/provider.php | 50 +- classes/setting_default_manager.php | 42 +- classes/setting_helper.php | 35 +- .../task/cleanup_imported_episodes_cron.php | 51 +- classes/task/cleanup_lti_module_cron.php | 14 +- classes/task/process_attachment_cron.php | 24 +- classes/task/process_delete_cron.php | 30 +- .../task/process_delete_notification_cron.php | 26 +- classes/task/process_duplicate_event.php | 59 +- ...ess_duplicated_event_visibility_change.php | 39 +- classes/task/process_notification_cron.php | 24 +- classes/task/process_upload_cron.php | 24 +- classes/task/process_visibility_cron.php | 24 +- db/access.php | 230 +- db/caches.php | 8 +- db/install.xml | 393 +- db/messages.php | 22 +- db/services.php | 40 +- db/tasks.php | 52 +- db/upgrade.php | 87 +- deleteaclgroup.php | 6 +- deletedraft.php | 26 +- deleteevent.php | 6 +- deletetranscription.php | 26 +- directaccess.php | 19 +- downloadtranscription.php | 17 +- downloadvideo.php | 8 +- engageredirect.php | 11 +- importvideos.php | 81 +- index.php | 98 +- lib.php | 18 +- managedefaults.php | 31 +- manageseries.php | 5 +- managetranscriptions.php | 6 +- overview.php | 48 +- overview_videos.php | 28 +- pix/caption.svg | 9 +- pix/play.svg | 5 +- pix/share.svg | 5 +- recordvideo.php | 13 +- renderer.php | 321 +- reportproblem.php | 21 +- serveworkflowconfigpanel.php | 9 +- settings.php | 74 +- startworkflow.php | 12 +- templates/defaults_settings_actions.mustache | 21 +- templates/series_settings_actions.mustache | 21 +- templates/series_table.mustache | 8 +- templates/table_legend_details.mustache | 110 +- templates/table_legend_help_icon.mustache | 54 +- templates/transcriptions_table.mustache | 65 +- templates/workflow_settings_opencast.mustache | 79 +- tests/backup_test.php | 74 +- tests/behat/behat_block_opencast.php | 54 +- ...ock_opencast_autocomplete_metadata.feature | 26 +- .../block_opencast_cleanup_backup.feature | 8 +- .../behat/block_opencast_directaccess.feature | 1 + .../block_opencast_updatemetadata.feature | 22 +- tests/delete_file_test.php | 12 +- .../api_calls/delete/api_events_delete.json | 4 +- .../api_calls/get/api_events_byseries_1.json | 306 +- .../get/api_events_byseries_1_nolimit.json | 306 +- .../api_calls/get/api_events_byseries_2.json | 306 +- .../api_events_byseries_changevisibility.json | 306 +- .../get/api_events_byseries_importvideo.json | 306 +- .../api_events_byseries_importvideo_2.json | 306 +- ...pi_events_get_single_changevisibility.json | 60 +- ...flow_import_duplicate_with_workflowid.json | 38 +- .../api_calls/put/api_events_acl_2.json | 4 +- ...i_events_acl_import_change_visibility.json | 4 +- .../put/api_events_metadata_episode.json | 4 +- .../api_calls/put/api_series_acl.json | 4 +- .../api_calls/put/api_series_acl_2.json | 4 +- .../api_calls/put/api_series_metadata.json | 4 +- tests/generator/lib.php | 10 +- tests/helper/apibridge_testable.php | 75 +- tests/privacy_test.php | 102 +- tests/upload_test.php | 39 +- updatemetadata.php | 32 +- videoeditor.php | 16 +- 152 files changed, 25902 insertions(+), 24773 deletions(-) diff --git a/.github/workflows/moodle-ci.yml b/.github/workflows/moodle-ci.yml index 9cbdb737..48865715 100644 --- a/.github/workflows/moodle-ci.yml +++ b/.github/workflows/moodle-ci.yml @@ -2,7 +2,7 @@ name: Moodle Plugin CI ######################################################################################################################## -on: [push, pull_request] +on: [ push, pull_request ] ######################################################################################################################## diff --git a/.github/workflows/moodle-release.yml b/.github/workflows/moodle-release.yml index c6aa29b6..865055b1 100644 --- a/.github/workflows/moodle-release.yml +++ b/.github/workflows/moodle-release.yml @@ -4,7 +4,7 @@ name: Moodle Plugin Release on: release: - types: [published] + types: [ published ] ######################################################################################################################## diff --git a/README.md b/README.md index 6a6ee988..f2a89250 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,18 @@ moodle-block_opencast ===================== This block can be used to link moodle courses to opencast series. -Users with respective privileges (in the following called teacher) can use this block to upload videos via moodle to opencast. +Users with respective privileges (in the following called teacher) can use this block to upload videos via moodle to +opencast. These videos are transmitted to the opencast system by the cronjob and create a event for the respective series there. The block can be used to automatically set the access privileges of moodle users enrolled in the course. -All events belonging to the series are displayed in the block. +All events belonging to the series are displayed in the block. This way, the teacher gets an overview of all recorded lectures as well as planned ones. -Further, if setup correctly, the teacher is able to restrict the visibility to moodle groups or prevent access by students at all. +Further, if setup correctly, the teacher is able to restrict the visibility to moodle groups or prevent access by +students at all. Features ------------------ + * Upload videos to Opencast * Record videos using Opencast studio * Overview of recorded and planned videos in the course @@ -30,7 +33,7 @@ Block overview The block has a detail view which displays two lists of videos. The first list shows the upload jobs which are not completed yet. The current status of the videos is shown in a column. -The second table shows all videos of the series which is associated with the block. +The second table shows all videos of the series which is associated with the block. It is possible that the videos were uploaded by the block or that they were uploaded otherwise. The table shows the upload date as well as the status. Video, which are planned to be recorded in the future, are also displayed in this list. @@ -42,6 +45,7 @@ Usage scenarios In the following 3 use cases are described, how the plugin can be used. ### Use case 1 - Upload a video ### + The teacher of a course wants to upload the video "Lecture 1" to his Moodle course. Prerequisite: The course page already contains an instance of the Block "Opencast Videos". @@ -49,48 +53,53 @@ Steps to upload a video: 1. Clicking on "Add video" leads to an upload form. 2. Here the teacher can upload a video file to moodle:
-
+
3. Saving the form creates an upload job, which is registered to the Upload Job Queue.
-
+
4. The processing of a video is done during a cron job and contain the following steps: 1. A new series is created in opencast with the name which was set in the settings, if it is not yet created. - 2. A new group is created in opencast with the name which was set in the settings, if it is not yet created. This step is skipped if "Create a group" is not selected in the settings. - This group control the access to the video. + 2. A new group is created in opencast with the name which was set in the settings, if it is not yet created. This + step is skipped if "Create a group" is not selected in the settings. + This group control the access to the video. 3. The video is uploaded to opencast, if it does not yet exist or the config *reuseexistingupload* is false. - In this step all permanent and non-permanent ACL-Rules are assigned to the video. + In this step all permanent and non-permanent ACL-Rules are assigned to the video. 4. The group is assigned to the video. - -Since most operations in the upload process are done by opencast in an asynchronous fashion, uploading a video can take multiple runs of the cronjob to finish. +Since most operations in the upload process are done by opencast in an asynchronous fashion, uploading a video can take +multiple runs of the cronjob to finish. ## Use case 2 - Change the visibility ### + The teacher of a course wants to hide an uploaded video from the students. The (opencast) admin has definded student specific roles. Steps to change the visibility: 1. Go to the overview section of the block.
-
+
2. Click on the visibility icon. 3. In the visibility form the teacher can select the needed visibility state.
-
+
4. The processing of the video starts: 1. The ACL-Roles of the video are changed and updated in Opencast. 2. A workflow (must be defined in the settings) is started which refreshes the metadata. - + ## Use case 3 - Linking a recorded series ### -A teacher wants to link an existing series to his moodle course and control the access to these videos using the list of students in his moodle course. +A teacher wants to link an existing series to his moodle course and control the access to these videos using the list of +students in his moodle course. For this the series id has to be reference in the block. 1. Go to the overview section of the block. 2. Go to "Edit series mapping".
-
+
3. Enter the series id and save the form. 4. Now all videos of the series should be displayed in the block and the visibility of them can be adjusted. ## Documentation ## -The full documentation is available at [https://moodle.docs.opencast.org/#block/about/](https://moodle.docs.opencast.org/#block/about/). + +The full documentation is available +at [https://moodle.docs.opencast.org/#block/about/](https://moodle.docs.opencast.org/#block/about/). ## License ## @@ -105,7 +114,7 @@ version. This program 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. +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 -this program. If not, see . +this program. If not, see . diff --git a/addactivity.php b/addactivity.php index 7975a37f..1bef7374 100644 --- a/addactivity.php +++ b/addactivity.php @@ -21,22 +21,29 @@ * @copyright 2020 Alexander Bias, Ulm University , 2021 Justus Dieckmann WWU * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ + +use block_opencast\local\activitymodulemanager; +use block_opencast\local\addactivity_form; +use block_opencast\local\apibridge; +use core\output\notification; +use tool_opencast\local\settings_api; + require_once('../../config.php'); global $PAGE, $OUTPUT, $CFG, $USER; $courseid = required_param('courseid', PARAM_INT); -$ocinstanceid = optional_param('ocinstanceid', \tool_opencast\local\settings_api::get_default_ocinstance()->id, PARAM_INT); +$ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT); $seriesid = required_param('seriesid', PARAM_ALPHANUMEXT); $submitbutton2 = optional_param('submitbutton2', '', PARAM_ALPHA); $baseurl = new moodle_url('/blocks/opencast/addactivity.php', - array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid, 'seriesid' => $seriesid)); + ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid, 'seriesid' => $seriesid]); $PAGE->set_url($baseurl); $redirecturloverview = new moodle_url('/blocks/opencast/index.php', - array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); -$redirecturlcourse = new moodle_url('/course/view.php', array('id' => $courseid)); + ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); +$redirecturlcourse = new moodle_url('/course/view.php', ['id' => $courseid]); require_login($courseid, false); @@ -47,7 +54,7 @@ $PAGE->navbar->add(get_string('addactivity_addbuttontitle', 'block_opencast'), $baseurl); // Check if the Opencast Activity module feature is enabled and working. -if (\block_opencast\local\activitymodulemanager::is_enabled_and_working_for_series($ocinstanceid) == false) { +if (activitymodulemanager::is_enabled_and_working_for_series($ocinstanceid) == false) { throw new moodle_exception('add opencast activity series module not enabled or working', 'block_opencast', $redirecturloverview); } @@ -57,18 +64,18 @@ require_capability('block/opencast:addactivity', $coursecontext); // Existing Opencast Activity module check. -$moduleid = \block_opencast\local\activitymodulemanager::get_module_for_series($ocinstanceid, $courseid, $seriesid); +$moduleid = activitymodulemanager::get_module_for_series($ocinstanceid, $courseid, $seriesid); if ($moduleid) { // Redirect to Opencast videos overview page. redirect($redirecturloverview, get_string('addactivity_moduleexists', 'block_opencast'), null, - \core\output\notification::NOTIFY_WARNING); + notification::NOTIFY_WARNING); } -$addactivityform = new \block_opencast\local\addactivity_form(null, - array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid, 'seriesid' => $seriesid)); +$addactivityform = new addactivity_form(null, + ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid, 'seriesid' => $seriesid]); -$apibridge = \block_opencast\local\apibridge::get_instance($ocinstanceid); +$apibridge = apibridge::get_instance($ocinstanceid); if ($addactivityform->is_cancelled()) { redirect($redirecturloverview); @@ -118,11 +125,11 @@ redirect($redirecturloverview, get_string('series_not_found', 'block_opencast', $data->seriesid), null, - \core\output\notification::NOTIFY_ERROR); + notification::NOTIFY_ERROR); } // Create the module. - $result = \block_opencast\local\activitymodulemanager::create_module_for_series($courseid, $ocinstanceid, + $result = activitymodulemanager::create_module_for_series($courseid, $ocinstanceid, $data->title, $seriesid, $sectionid, $introtext, $introformat, $availability, $data->allowdownload); // Check if the module was created successfully. @@ -133,7 +140,7 @@ redirect($redirecturlcourse, get_string('addactivity_modulecreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_SUCCESS); + notification::NOTIFY_SUCCESS); // Form was submitted with first submit button. } else { @@ -141,7 +148,7 @@ redirect($redirecturloverview, get_string('addactivity_modulecreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_SUCCESS); + notification::NOTIFY_SUCCESS); } // Otherwise. @@ -150,7 +157,7 @@ redirect($redirecturloverview, get_string('addactivity_modulenotcreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_ERROR); + notification::NOTIFY_ERROR); } } diff --git a/addactivityepisode.php b/addactivityepisode.php index 9a0e2405..1478edd8 100644 --- a/addactivityepisode.php +++ b/addactivityepisode.php @@ -21,6 +21,12 @@ * @copyright 2020 Alexander Bias, Ulm University , 2021 Justus Dieckmann WWU * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ + +use block_opencast\local\activitymodulemanager; +use block_opencast\local\addactivityepisode_form; +use core\output\notification; +use tool_opencast\local\settings_api; + require_once('../../config.php'); global $PAGE, $OUTPUT, $CFG; @@ -28,15 +34,15 @@ $episodeuuid = required_param('episodeuuid', PARAM_ALPHANUMEXT); $courseid = required_param('courseid', PARAM_INT); $submitbutton2 = optional_param('submitbutton2', '', PARAM_ALPHA); -$ocinstanceid = optional_param('ocinstanceid', \tool_opencast\local\settings_api::get_default_ocinstance()->id, PARAM_INT); +$ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT); $baseurl = new moodle_url('/blocks/opencast/addactivityepisode.php', - array('episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); + ['episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); $PAGE->set_url($baseurl); $redirecturloverview = new moodle_url('/blocks/opencast/index.php', - array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); -$redirecturlcourse = new moodle_url('/course/view.php', array('id' => $courseid)); + ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); +$redirecturlcourse = new moodle_url('/course/view.php', ['id' => $courseid]); require_login($courseid, false); @@ -47,7 +53,7 @@ $PAGE->navbar->add(get_string('addactivityepisode_addicontitle', 'block_opencast'), $baseurl); // Check if the Opencast Activity module feature is enabled and working. -if (\block_opencast\local\activitymodulemanager::is_enabled_and_working_for_episodes($ocinstanceid) == false) { +if (activitymodulemanager::is_enabled_and_working_for_episodes($ocinstanceid) == false) { throw new moodle_exception('add opencast activity episode module not enabled or working', 'block_opencast', $redirecturloverview); } @@ -57,15 +63,15 @@ require_capability('block/opencast:addactivityepisode', $coursecontext); // Existing Opencast Activity module check. -$moduleid = \block_opencast\local\activitymodulemanager::get_module_for_episode($courseid, $episodeuuid, $ocinstanceid); +$moduleid = activitymodulemanager::get_module_for_episode($courseid, $episodeuuid, $ocinstanceid); if ($moduleid) { // Redirect to Opencast videos overview page. redirect($redirecturloverview, - get_string('addactivityepisode_moduleexists', 'block_opencast'), null, \core\output\notification::NOTIFY_WARNING); + get_string('addactivityepisode_moduleexists', 'block_opencast'), null, notification::NOTIFY_WARNING); } -$addactivityform = new \block_opencast\local\addactivityepisode_form(null, - array('episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); +$addactivityform = new addactivityepisode_form(null, + ['episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); if ($addactivityform->is_cancelled()) { redirect($redirecturloverview); @@ -110,7 +116,7 @@ } // Create the module. - $result = \block_opencast\local\activitymodulemanager::create_module_for_episode($courseid, $ocinstanceid, + $result = activitymodulemanager::create_module_for_episode($courseid, $ocinstanceid, $data->title, $episodeuuid, $sectionid, $introtext, $introformat, $availability, $data->allowdownload); // Check if the module was created successfully. @@ -121,7 +127,7 @@ redirect($redirecturlcourse, get_string('addactivityepisode_modulecreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_SUCCESS); + notification::NOTIFY_SUCCESS); // Form was submitted with first submit button. } else { @@ -129,7 +135,7 @@ redirect($redirecturloverview, get_string('addactivityepisode_modulecreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_SUCCESS); + notification::NOTIFY_SUCCESS); } // Otherwise. @@ -138,7 +144,7 @@ redirect($redirecturloverview, get_string('addactivityepisode_modulenotcreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_ERROR); + notification::NOTIFY_ERROR); } } diff --git a/addlti.php b/addlti.php index 405892e5..ff33b685 100644 --- a/addlti.php +++ b/addlti.php @@ -21,13 +21,20 @@ * @copyright 2020 Alexander Bias, Ulm University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ + +use block_opencast\local\addlti_form; +use block_opencast\local\apibridge; +use block_opencast\local\ltimodulemanager; +use core\output\notification; +use tool_opencast\local\settings_api; + require_once('../../config.php'); global $PAGE, $OUTPUT, $CFG, $USER; // Handle submitted parameters of the form. $courseid = required_param('courseid', PARAM_INT); -$ocinstanceid = optional_param('ocinstanceid', \tool_opencast\local\settings_api::get_default_ocinstance()->id, PARAM_INT); +$ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT); $submitbutton2 = optional_param('submitbutton2', '', PARAM_ALPHA); $seriesid = required_param('seriesid', PARAM_ALPHANUMEXT); @@ -52,7 +59,7 @@ $PAGE->navbar->add(get_string('addlti_addbuttontitle', 'block_opencast'), $baseurl); // Check if the LTI module feature is enabled and working. -if (\block_opencast\local\ltimodulemanager::is_enabled_and_working_for_series($ocinstanceid) == false) { +if (ltimodulemanager::is_enabled_and_working_for_series($ocinstanceid) == false) { throw new moodle_exception('addlti_errornotenabledorworking', 'block_opencast', $redirecturloverview); } @@ -61,19 +68,19 @@ require_capability('block/opencast:addlti', $coursecontext); // Existing LTI module check. -$moduleid = \block_opencast\local\ltimodulemanager::get_module_for_series($ocinstanceid, $courseid, $seriesid); +$moduleid = ltimodulemanager::get_module_for_series($ocinstanceid, $courseid, $seriesid); if ($moduleid) { // Redirect to Opencast videos overview page. redirect($redirecturloverview, - get_string('addlti_moduleexists', 'block_opencast'), null, \core\output\notification::NOTIFY_WARNING); + get_string('addlti_moduleexists', 'block_opencast'), null, notification::NOTIFY_WARNING); } // Use Add LTI form. -$addltiform = new \block_opencast\local\addlti_form(null, +$addltiform = new addlti_form(null, array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid, 'seriesid' => $seriesid)); // Get API bridge instance. -$apibridge = \block_opencast\local\apibridge::get_instance($ocinstanceid); +$apibridge = apibridge::get_instance($ocinstanceid); // Redirect if the form was cancelled. if ($addltiform->is_cancelled()) { @@ -118,7 +125,7 @@ } // Create the module. - $result = \block_opencast\local\ltimodulemanager::create_module_for_series($ocinstanceid, $courseid, + $result = ltimodulemanager::create_module_for_series($ocinstanceid, $courseid, $data->title, $data->seriesid, $sectionid, $introtext, $introformat, $availability); // Check if the module was created successfully. @@ -129,7 +136,7 @@ redirect($redirecturlcourse, get_string('addlti_modulecreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_SUCCESS); + notification::NOTIFY_SUCCESS); // Form was submitted with first submit button. } else { @@ -137,7 +144,7 @@ redirect($redirecturloverview, get_string('addlti_modulecreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_SUCCESS); + notification::NOTIFY_SUCCESS); } // Otherwise. @@ -146,7 +153,7 @@ redirect($redirecturloverview, get_string('addlti_modulenotcreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_ERROR); + notification::NOTIFY_ERROR); } } diff --git a/addltiepisode.php b/addltiepisode.php index b57d8239..082c0782 100644 --- a/addltiepisode.php +++ b/addltiepisode.php @@ -21,6 +21,12 @@ * @copyright 2020 Alexander Bias, Ulm University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ + +use block_opencast\local\addltiepisode_form; +use block_opencast\local\ltimodulemanager; +use core\output\notification; +use tool_opencast\local\settings_api; + require_once('../../config.php'); global $PAGE, $OUTPUT, $CFG; @@ -29,17 +35,17 @@ $episodeuuid = required_param('episodeuuid', PARAM_ALPHANUMEXT); $courseid = required_param('courseid', PARAM_INT); $submitbutton2 = optional_param('submitbutton2', '', PARAM_ALPHA); -$ocinstanceid = optional_param('ocinstanceid', \tool_opencast\local\settings_api::get_default_ocinstance()->id, PARAM_INT); +$ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT); // Set base URL. $baseurl = new moodle_url('/blocks/opencast/addltiepisode.php', - array('episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); + ['episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); $PAGE->set_url($baseurl); // Remember URLs for redirecting. $redirecturloverview = new moodle_url('/blocks/opencast/index.php', - array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); -$redirecturlcourse = new moodle_url('/course/view.php', array('id' => $courseid)); + ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); +$redirecturlcourse = new moodle_url('/course/view.php', ['id' => $courseid]); $redirecturlcancel = $redirecturloverview; // Require login and course membership. @@ -53,7 +59,7 @@ $PAGE->navbar->add(get_string('addltiepisode_addicontitle', 'block_opencast'), $baseurl); // Check if the LTI module feature is enabled and working. -if (\block_opencast\local\ltimodulemanager::is_enabled_and_working_for_episodes($ocinstanceid) == false) { +if (ltimodulemanager::is_enabled_and_working_for_episodes($ocinstanceid) == false) { throw new moodle_exception('addltiepisode_errornotenabledorworking', 'block_opencast', $redirecturloverview); } @@ -62,16 +68,16 @@ require_capability('block/opencast:addltiepisode', $coursecontext); // Existing LTI module check. -$moduleid = \block_opencast\local\ltimodulemanager::get_module_for_episode($ocinstanceid, $courseid, $episodeuuid); +$moduleid = ltimodulemanager::get_module_for_episode($ocinstanceid, $courseid, $episodeuuid); if ($moduleid) { // Redirect to Opencast videos overview page. redirect($redirecturloverview, - get_string('addltiepisode_moduleexists', 'block_opencast'), null, \core\output\notification::NOTIFY_WARNING); + get_string('addltiepisode_moduleexists', 'block_opencast'), null, notification::NOTIFY_WARNING); } // Use Add LTI form. -$addltiform = new \block_opencast\local\addltiepisode_form(null, - array('episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); +$addltiform = new addltiepisode_form(null, + ['episodeuuid' => $episodeuuid, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); // Redirect if the form was cancelled. if ($addltiform->is_cancelled()) { @@ -117,7 +123,7 @@ } // Create the module. - $result = \block_opencast\local\ltimodulemanager::create_module_for_episode($ocinstanceid, $courseid, + $result = ltimodulemanager::create_module_for_episode($ocinstanceid, $courseid, $data->title, $episodeuuid, $sectionid, $introtext, $introformat, $availability); // Check if the module was created successfully. @@ -128,7 +134,7 @@ redirect($redirecturlcourse, get_string('addltiepisode_modulecreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_SUCCESS); + notification::NOTIFY_SUCCESS); // Form was submitted with first submit button. } else { @@ -136,7 +142,7 @@ redirect($redirecturloverview, get_string('addltiepisode_modulecreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_SUCCESS); + notification::NOTIFY_SUCCESS); } // Otherwise. @@ -145,7 +151,7 @@ redirect($redirecturloverview, get_string('addltiepisode_modulenotcreated', 'block_opencast', $data->title), null, - \core\output\notification::NOTIFY_ERROR); + notification::NOTIFY_ERROR); } } diff --git a/addtranscription.php b/addtranscription.php index b6c65e2d..c663b7af 100644 --- a/addtranscription.php +++ b/addtranscription.php @@ -23,8 +23,11 @@ */ require_once('../../config.php'); +use block_opencast\local\addtranscription_form; use block_opencast\local\apibridge; use block_opencast\local\attachment_helper; +use core\output\notification; +use tool_opencast\local\settings_api; global $PAGE, $OUTPUT, $CFG, $SITE; @@ -32,13 +35,13 @@ $identifier = required_param('video_identifier', PARAM_ALPHANUMEXT); $courseid = required_param('courseid', PARAM_INT); -$ocinstanceid = optional_param('ocinstanceid', \tool_opencast\local\settings_api::get_default_ocinstance()->id, PARAM_INT); +$ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT); -$indexurl = new moodle_url('/blocks/opencast/index.php', array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); +$indexurl = new moodle_url('/blocks/opencast/index.php', ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); $redirecturl = new moodle_url('/blocks/opencast/managetranscriptions.php', - array('video_identifier' => $identifier, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); + ['video_identifier' => $identifier, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); $baseurl = new moodle_url('/blocks/opencast/addtranscriptions.php', - array('video_identifier' => $identifier, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); + ['video_identifier' => $identifier, 'courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); $PAGE->set_url($baseurl); require_login($courseid, false); @@ -59,11 +62,11 @@ if ($video->error || $video->video->processing_state != 'SUCCEEDED' || empty(get_config('block_opencast', 'transcriptionworkflow_' . $ocinstanceid))) { redirect($redirecturl, - get_string('unabletoaddnewtranscription', 'block_opencast'), null, \core\output\notification::NOTIFY_ERROR); + get_string('unabletoaddnewtranscription', 'block_opencast'), null, notification::NOTIFY_ERROR); } -$addtranscriptionform = new \block_opencast\local\addtranscription_form(null, - array('courseid' => $courseid, 'identifier' => $identifier, 'ocinstanceid' => $ocinstanceid)); +$addtranscriptionform = new addtranscription_form(null, + ['courseid' => $courseid, 'identifier' => $identifier, 'ocinstanceid' => $ocinstanceid]); if ($addtranscriptionform->is_cancelled()) { redirect($redirecturl); @@ -71,21 +74,21 @@ if ($data = $addtranscriptionform->get_data()) { $storedfile = $addtranscriptionform->save_stored_file('transcription_file', $coursecontext->id, - 'block_opencast', attachment_helper::OC_FILEAREA_ATTACHMENT, $data->transcription_file); + 'block_opencast', attachment_helper::OC_FILEAREA_ATTACHMENT, $data->transcription_file); $flavor = $data->transcription_flavor; if (isset($storedfile) && $storedfile && !empty($flavor)) { $success = attachment_helper::upload_single_transcription($storedfile, $flavor, $ocinstanceid, $identifier); $message = get_string('transcriptionuploadsuccessed', 'block_opencast'); - $status = \core\output\notification::NOTIFY_SUCCESS; + $status = notification::NOTIFY_SUCCESS; if (!$success) { $message = get_string('transcriptionuploadfailed', 'block_opencast'); - $status = \core\output\notification::NOTIFY_ERROR; + $status = notification::NOTIFY_ERROR; } attachment_helper::remove_single_transcription_file($storedfile->get_itemid()); redirect($redirecturl, $message, null, $status); } else { redirect($redirecturl, - get_string('missingtranscriptionuploadparams', 'block_opencast'), null, \core\output\notification::NOTIFY_ERROR); + get_string('missingtranscriptionuploadparams', 'block_opencast'), null, notification::NOTIFY_ERROR); } } diff --git a/addvideo.php b/addvideo.php index 0ae3a038..028d3245 100644 --- a/addvideo.php +++ b/addvideo.php @@ -23,7 +23,12 @@ */ require_once('../../config.php'); +use block_opencast\local\addvideo_form; +use block_opencast\local\apibridge; +use block_opencast\local\file_deletionmanager; use block_opencast\local\upload_helper; +use core\output\notification; +use tool_opencast\local\settings_api; global $PAGE, $OUTPUT, $CFG, $USER, $SITE, $DB; @@ -31,11 +36,11 @@ $courseid = required_param('courseid', PARAM_INT); $series = optional_param('series', null, PARAM_ALPHANUMEXT); -$ocinstanceid = optional_param('ocinstanceid', \tool_opencast\local\settings_api::get_default_ocinstance()->id, PARAM_INT); +$ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT); $baseurlparams = [ 'ocinstanceid' => $ocinstanceid, - 'courseid' => $courseid + 'courseid' => $courseid, ]; if ($series) { $baseurlparams['series'] = $series; @@ -45,10 +50,10 @@ $PAGE->set_url($baseurl); if ($courseid == $SITE->id && $series) { - $redirecturl = new moodle_url('/blocks/opencast/overview_videos.php', array('series' => $series, - 'ocinstanceid' => $ocinstanceid)); + $redirecturl = new moodle_url('/blocks/opencast/overview_videos.php', ['series' => $series, + 'ocinstanceid' => $ocinstanceid, ]); } else { - $redirecturl = new moodle_url('/blocks/opencast/index.php', array('courseid' => $courseid, 'ocinstanceid' => $ocinstanceid)); + $redirecturl = new moodle_url('/blocks/opencast/index.php', ['courseid' => $courseid, 'ocinstanceid' => $ocinstanceid]); } require_login($courseid, false); @@ -67,12 +72,12 @@ if ($courseid == $SITE->id) { // If upload initiated from overview page, check that capability is given in specific course or ownership. if (!$series) { - redirect(new moodle_url('/blocks/opencast/overview_videos.php', array('ocinstanceid' => $ocinstanceid, 'series' => null)), + redirect(new moodle_url('/blocks/opencast/overview_videos.php', ['ocinstanceid' => $ocinstanceid, 'series' => null]), get_string('addvideonotallowed', 'block_opencast'), null, - \core\output\notification::NOTIFY_ERROR); + notification::NOTIFY_ERROR); } - $records = $DB->get_records('tool_opencast_series', array('series' => $series, 'ocinstanceid' => $ocinstanceid)); + $records = $DB->get_records('tool_opencast_series', ['series' => $series, 'ocinstanceid' => $ocinstanceid]); $haspermission = false; foreach ($records as $record) { $cc = context_course::instance($record->courseid, IGNORE_MISSING); @@ -84,20 +89,20 @@ if (!$haspermission) { // Check if series is owned by user. - $apibridge = \block_opencast\local\apibridge::get_instance($ocinstanceid); + $apibridge = apibridge::get_instance($ocinstanceid); $ocseries = $apibridge->get_series_by_identifier($series); if (!$ocseries) { - redirect(new moodle_url('/blocks/opencast/overview_videos.php', array('ocinstanceid' => $ocinstanceid, - 'series' => $series)), + redirect(new moodle_url('/blocks/opencast/overview_videos.php', ['ocinstanceid' => $ocinstanceid, + 'series' => $series, ]), get_string('connection_failure', 'block_opencast'), null, - \core\output\notification::NOTIFY_ERROR); + notification::NOTIFY_ERROR); } if (!$apibridge->is_owner($ocseries->acl, $USER->id, $SITE->id)) { - redirect(new moodle_url('/blocks/opencast/overview_videos.php', array('ocinstanceid' => $ocinstanceid, - 'series' => $series)), + redirect(new moodle_url('/blocks/opencast/overview_videos.php', ['ocinstanceid' => $ocinstanceid, + 'series' => $series, ]), get_string('addvideonotallowed', 'block_opencast'), null, - \core\output\notification::NOTIFY_ERROR); + notification::NOTIFY_ERROR); } } } else { @@ -112,14 +117,14 @@ $usereventdefaults = (!empty($userdefaults['event'])) ? $userdefaults['event'] : []; if ($series) { - $addvideoform = new \block_opencast\local\addvideo_form(null, - array('courseid' => $courseid, 'metadata_catalog' => $metadatacatalog, - 'eventdefaults' => $usereventdefaults, 'ocinstanceid' => $ocinstanceid, 'series' => $series) + $addvideoform = new addvideo_form(null, + ['courseid' => $courseid, 'metadata_catalog' => $metadatacatalog, + 'eventdefaults' => $usereventdefaults, 'ocinstanceid' => $ocinstanceid, 'series' => $series, ] ); } else { - $addvideoform = new \block_opencast\local\addvideo_form(null, - array('courseid' => $courseid, 'metadata_catalog' => $metadatacatalog, - 'eventdefaults' => $usereventdefaults, 'ocinstanceid' => $ocinstanceid) + $addvideoform = new addvideo_form(null, + ['courseid' => $courseid, 'metadata_catalog' => $metadatacatalog, + 'eventdefaults' => $usereventdefaults, 'ocinstanceid' => $ocinstanceid, ] ); } @@ -147,10 +152,10 @@ } if (isset($storedfilepresenter) && $storedfilepresenter) { - \block_opencast\local\file_deletionmanager::track_draftitemid($coursecontext->id, $storedfilepresenter->get_itemid()); + file_deletionmanager::track_draftitemid($coursecontext->id, $storedfilepresenter->get_itemid()); } if (isset($storedfilepresentation) && $storedfilepresentation) { - \block_opencast\local\file_deletionmanager::track_draftitemid($coursecontext->id, $storedfilepresentation->get_itemid()); + file_deletionmanager::track_draftitemid($coursecontext->id, $storedfilepresentation->get_itemid()); } // Transcription files. @@ -166,14 +171,14 @@ $flavorelm = "transcription_flavor_{$transcriptionindex}"; if (property_exists($data, $fileelm) && property_exists($data, $flavorelm)) { $storedfile = $addvideoform->save_stored_file($fileelm, $coursecontext->id, - 'block_opencast', block_opencast\local\attachment_helper::OC_FILEAREA_ATTACHMENT, $data->{$fileelm}); + 'block_opencast', block_opencast\local\attachment_helper::OC_FILEAREA_ATTACHMENT, $data->{$fileelm}); $flavor = $data->{$flavorelm}; if (isset($storedfile) && $storedfile) { $transcriptions[] = [ 'file_itemid' => $storedfile->get_itemid(), 'file_id' => $storedfile->get_id(), 'file_contenhash' => $storedfile->get_contenthash(), - 'flavor' => $flavor + 'flavor' => $flavor, ]; } } @@ -183,10 +188,10 @@ $metadata = []; if (property_exists($data, 'series')) { - $metadata[] = array( + $metadata[] = [ 'id' => 'isPartOf', - 'value' => $data->series - ); + 'value' => $data->series, + ]; } $gettitle = true; // Make sure title (required) is added into metadata. @@ -199,11 +204,11 @@ $gettitle = false; } if ($field->name == 'subjects') { - !is_array($data->$id) ? $data->$id = array($data->$id) : $data->$id = $data->$id; + !is_array($data->$id) ? $data->$id = [$data->$id] : $data->$id = $data->$id; } $obj = [ 'id' => $id, - 'value' => $data->$id + 'value' => $data->$id, ]; $metadata[] = $obj; } @@ -213,7 +218,7 @@ if ($gettitle) { $titleobj = [ 'id' => 'title', - 'value' => $data->title ? $data->title : 'upload-task' + 'value' => $data->title ? $data->title : 'upload-task', ]; $metadata[] = $titleobj; } @@ -222,16 +227,16 @@ $sd->setTimestamp($data->startDate); $startdate = [ 'id' => 'startDate', - 'value' => $sd->format('Y-m-d') + 'value' => $sd->format('Y-m-d'), ]; $starttime = [ 'id' => 'startTime', - 'value' => $sd->format('H:i:s') . 'Z' + 'value' => $sd->format('H:i:s') . 'Z', ]; $metadata[] = $startdate; $metadata[] = $starttime; - $options = new \stdClass(); + $options = new stdClass(); $options->metadata = json_encode($metadata); $options->presenter = isset($storedfilepresenter) && $storedfilepresenter ? $storedfilepresenter->get_itemid() : ''; $options->presentation = isset($storedfilepresentation) && $storedfilepresentation ? $storedfilepresentation->get_itemid() : ''; @@ -239,7 +244,7 @@ $options->chunkupload_presentation = isset($chunkuploadpresentation) ? $chunkuploadpresentation : ''; // Prepare attachment object. - $attachments = new \stdClass(); + $attachments = new stdClass(); if (isset($transcriptions) && !empty($transcriptions)) { $attachments->transcriptions = $transcriptions; } @@ -247,9 +252,9 @@ $options->attachments = $attachments; // Prepare the visibility object. - $visibility = new \stdClass(); + $visibility = new stdClass(); $visibility->initialvisibilitystatus = !isset($data->initialvisibilitystatus) ? - \block_opencast_renderer::VISIBLE : $data->initialvisibilitystatus; + block_opencast_renderer::VISIBLE : $data->initialvisibilitystatus; $visibility->initialvisibilitygroups = !empty($data->initialvisibilitygroups) ? json_encode($data->initialvisibilitygroups) : null; // Check if the scheduled visibility is set. @@ -262,7 +267,7 @@ // Update all upload jobs. upload_helper::save_upload_jobs($ocinstanceid, $courseid, $options, $visibility); - redirect($redirecturl, get_string('uploadjobssaved', 'block_opencast'), null, \core\output\notification::NOTIFY_SUCCESS); + redirect($redirecturl, get_string('uploadjobssaved', 'block_opencast'), null, notification::NOTIFY_SUCCESS); } $PAGE->requires->js_call_amd('block_opencast/block_form_handler', 'init'); diff --git a/amd/src/block_form_handler.js b/amd/src/block_form_handler.js index 8bbaeebe..cc3d0f8b 100755 --- a/amd/src/block_form_handler.js +++ b/amd/src/block_form_handler.js @@ -21,7 +21,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -define(['jquery'], function($) { +define(['jquery'], function ($) { /** * Instantiate the window variable in order to work with Intervals * @@ -48,7 +48,7 @@ define(['jquery'], function($) { * */ function autocompletePrettifier() { - $('div[data-fieldtype="autocomplete"]').each(function(i, elm) { + $('div[data-fieldtype="autocomplete"]').each(function (i, elm) { var input = $(elm).find('input'); if (!input.hasClass('form-control')) { input.addClass('form-control'); @@ -94,17 +94,17 @@ define(['jquery'], function($) { * Initialise all of the modules for the opencast block. * */ - var init = function() { + var init = function () { // Toggle visibility of terms of use $('#termsofuse').hide(); - $('#termsofuse_toggle').on('click', function(e) { + $('#termsofuse_toggle').on('click', function (e) { $('#termsofuse').toggle(); e.preventDefault(); }); // Chunkupload. - $('.local_chunkupload input[type="file"]').on('change', function(e) { - setTimeout(function() { + $('.local_chunkupload input[type="file"]').on('change', function (e) { + setTimeout(function () { var span = $(e.currentTarget).siblings('label.chunkupload-label').find('.chunkupload-filename'); if (span.length) { setDefaultTitle($(span[0]).text()); @@ -112,15 +112,15 @@ define(['jquery'], function($) { }, 500); }); - $('.filepickerhidden').on('change', function(e) { - setTimeout(function() { + $('.filepickerhidden').on('change', function (e) { + setTimeout(function () { var filelist = $(e.currentTarget).parent().find('.filepicker-filelist'); var filename = getFilenameFromFilelist(filelist); setDefaultTitle(filename); }, 500); }); - $('.filepicker-filelist').on('drop', function(e) { + $('.filepicker-filelist').on('drop', function (e) { var filelist = e.currentTarget; var videoIdentifier = $(filelist).parent().siblings('.filepickerhidden').attr('name'); @@ -128,7 +128,7 @@ define(['jquery'], function($) { if (videoIdentifier == 'video_presenter') { $(filelist).addClass('presenter-uploading'); - window.presenterIntervalHandle = setInterval(function() { + window.presenterIntervalHandle = setInterval(function () { window.presenterRun = true; if (!$('.presenter-uploading').hasClass('dndupload-inprogress')) { window.presenterRun = false; @@ -137,7 +137,7 @@ define(['jquery'], function($) { }, 500); } else { $(filelist).addClass('presentation-uploading'); - window.presenterIntervalHandle = setInterval(function() { + window.presenterIntervalHandle = setInterval(function () { window.presentationRun = true; if (!$('.presentation-uploading').hasClass('dndupload-inprogress')) { window.presentationRun = false; @@ -146,16 +146,16 @@ define(['jquery'], function($) { }, 500); } - setTimeout(function() { + setTimeout(function () { var filename = getFilenameFromFilelist(filelist); setDefaultTitle(filename); }, 500); }); // Ensures that autocomplete fields are loaded properly after 1 sec! - setTimeout(function() { + setTimeout(function () { autocompletePrettifier(); - $('.moreless-actions').on('click', function() { // + $('.moreless-actions').on('click', function () { autocompletePrettifier(); }); }, 1000); @@ -165,4 +165,3 @@ define(['jquery'], function($) { init: init }; }); - diff --git a/amd/src/block_index.js b/amd/src/block_index.js index 198de1fc..36b6f891 100644 --- a/amd/src/block_index.js +++ b/amd/src/block_index.js @@ -22,8 +22,8 @@ */ define(['jquery', 'core/modal_factory', 'core/modal_events', - 'core/str', 'core/url', 'core/notification', 'core/toast', 'core/ajax'], - function($, ModalFactory, ModalEvents, str, url, Notification, Toast, Ajax) { + 'core/str', 'core/url', 'core/notification', 'core/toast', 'core/ajax'], + function ($, ModalFactory, ModalEvents, str, url, Notification, Toast, Ajax) { /** * Instantiate the window variable in order to work with Intervals * @@ -32,7 +32,7 @@ define(['jquery', 'core/modal_factory', 'core/modal_events', window.liveUpdateItemsWithError = []; window.liveUpdateState = null; - var pauseLiveUpdate = function(liveupdate) { + var pauseLiveUpdate = function (liveupdate) { if (!liveupdate.enabled) { return; } @@ -42,7 +42,7 @@ define(['jquery', 'core/modal_factory', 'core/modal_events', } }; - var resumeLiveUpdate = function(ocinstanceid, contextid, liveupdate) { + var resumeLiveUpdate = function (ocinstanceid, contextid, liveupdate) { if (!liveupdate.enabled) { return; } @@ -52,7 +52,7 @@ define(['jquery', 'core/modal_factory', 'core/modal_events', } }; - var initWorkflowModal = function(ocinstanceid, courseid, langstrings, contextid, liveupdate) { + var initWorkflowModal = function (ocinstanceid, courseid, langstrings, contextid, liveupdate) { if (document.getElementById('workflowsjson')) { var workflows = JSON.parse($('#workflowsjson').text()); var privacyinfohtml = null; @@ -66,7 +66,7 @@ define(['jquery', 'core/modal_factory', 'core/modal_events', privacyworkflows = JSON.parse($('#swprivacynoticewfds').text()); } - $('.start-workflow').on('click', function(e) { + $('.start-workflow').on('click', function (e) { e.preventDefault(); var clickedVideo = $(e.currentTarget); var select = '