GithubHelp home page GithubHelp logo

opencast-moodle / moodle-block_opencast Goto Github PK

View Code? Open in Web Editor NEW
20.0 14.0 27.0 3.65 MB

Block to manage Opencast publications in moodle

PHP 62.32% CSS 0.11% Gherkin 3.60% JavaScript 33.14% Mustache 0.83%
opencast moodle-block

moodle-block_opencast's People

Contributors

abias avatar aliyevtu avatar awagner avatar dagefoerde avatar ferishili avatar jojoob avatar joneug avatar justusdieckmann avatar laur0r avatar ninaherrmann avatar t-schroeder avatar tamaragunkel avatar taraghi avatar tobiasreischmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-block_opencast's Issues

Create admin setting for group name

  • Add an admin setting 'group_name' from type text. Use a heading section "Access Policies".
  • Change apibridge->create_acl_group() so that the group name from this setting is used as $params['name']. Since the static function api::get_course_acl_group_name from the repository plugin is only called here, this functionality can be moved to the block!
  • Allow placefolders [COURSEID] and [COURSENAME], which are automatically replaced by course->id and course->fullname. You can use str_replace() for that. (http://php.net/manual/de/function.str-replace.php)

Define which ACLs should be permanent and which should be removed to manage student access

Issue #22 requests to be able to manage to manage student access. To implement that it is needed to change the ACLs in Opencast. In the current block settings it is possible to define which ACLs are added to uploaded videos. This list could be extended with a checkbox to manage wether a rule is permanent (e.g. for admin or instructor access) or not (e.g. for student access).

Uploadlimit of course and site is not overriden by block

The problem is that get_user_max_upload_file_size, which is called frequently within the implementation of filemanager, sets the max upload size to the minimum out of php, site, course and module limit. This way the block is not able to override the other limits in the moodle site.

Scheduled Task interval for \block_opencast\task\process_upload_cron

I have seen that the default for \block_opencast\task\process_upload_cron is to run only every 24 hours at midnight whereas the default for \block_opencast\task\process_delete_cron is to run every single minute.

I am wondering if it shouldn't be at least the other way round (let the upload job run every minute and let the delete job run only at midnight) or even better let both jobs run every minute.

If anyone is able to tell me that there was a design goal for this default schedule, I would be curious to hear about it.
Otherwise, I would prepare a pull request to change both jobs to run every minute.

Allow to add additional ACL roles when uploading a video

  • Add a admin setting 'acl_roles' to the heading section "Access Policies".
  • The setting is represented by a table with two columns.
  • The first column contains the name of the role, e.g. ROLE_ADMIN or ROLE_GROUP_MOODLE_COURSE_[COURSEID].
  • The second column contains the name of the action, which the role gets assigned, e.g. read, write, annotate.
  • The admin should be allowed to enter arbitrary strings to both fields.
  • The admin should be allowed to enter and delete as many entries as he likes.
  • The first column is no primary key! It has to be possible to create the entries (ROLE_ADMIN, read) and (ROLE_ADMIN, write) without conflict!
  • These ACL configurations should then be used in apibridge->create_event(), apibridge->delete_acl_group_assigned() and apibridge->ensure_acl_group_assigned().
  • These roles column should again be able to use the placeholder [COURSEID]!

Add functionality to copy video to a courses series

Instead of only allowing to upload a new video, a teacher could be allowed to choose from all videos from other courses and copy single videos to the series of the current course. This way, old videos could be reused. Through copying the videos it is possible to apply different ACLs to the videos and to distinguish them for instance in the annotation tool.

Add a setting to restrict the uploadable video types

In https://github.com/unirz-tu-ilmenau/moodle-block_opencast/blob/master/classes/local/addvideo_form.php#L41, the block accepts the filetype group "video" for uploading. Looking at https://github.com/moodle/moodle/blob/master/lib/classes/filetypes.php, this group resolves to many filetypes and many of them might not be suitable or desired for uploading to Opencast.

Changing the video group to web_video would be an improvement, but you would still allow types like flv or swf which you most probably don't want to process in Opencast.

That's why I would propose to add an admin setting to the block to let the admin set a list of mimetypes which he want to allow for uploading. This can be realized with the Moodle mimetype chooser which is already used for example in mod_assign.

Edit event metadata during and / or after upload

Currently, the metadata for an event which is uploaded to Opencast with block_opencast is only generated automatically from the video filename as far as I see. And we all know the users / teachers who label their files just with non-speaking filenames or with some strange complex scheme which only they understand.

I would like to propose to add functionality...

  • ... which lets users set at least the title of the event manually. Don't rely on the fact that users know how to rename files in the Moodle filepicker. Show them a mandatory input field for the title of the uploaded videos instead.
  • ... which lets users change the event metadata after the video has been uploaded and processed if needed
  • ... which lets Moodle download the whole metadata catalog of Opencast and provide optional input fields for all metadata fields so that the whole catalog can be filled from within Moodle.

Create series without upload

Offer a button under the capability of an opencast admin, to directly create the opencast series with all ACLs without uploading a video.

Setting for series identifier

Add a setting to the overview block, which allows to select the corresponding opencast series from a dropdown. This should only be possible with a specific capability. For a lot of series in a system, we should think about something like a searchable dropdown.

Check if video exists

We should verify that the video exists which should be uploaded (during the upload process).
Otherwise an error will be thrown and the cron job will stop.

Improve Documentation

  • Which Opencast Role have to be assigned to the technical Moodle User.
  • Add recommendation towards: which Moodle capabilities should be assigned to which user.

Make creation of ACL Rules easier

Currently, it is pretty time consuming to create many ACL Rules.
We just created 16 Rules: 4 Roles and 4 Actions. Since you always have to click on "Add" and then scroll down again, it is not very easy to use. Following suggestion:
Remove the input form and replace it by a button, which adds a new line to the table.
This could also be done using Ajax.
Then the data is added directly in the table. We have to think about data validation here. It should not be possible to save empty roles.
Further, I would suggest to change the storage of actions from one in each line to a comma separated list. This does not necessarily change the way of data storage, but the way it is displayed.

Extend the list of events with additional metadata

Currently the list of events shows the date, start time and title of the events. This should be extended with the following data:

  • If the start and end time are not the same (this is the case with uploads) the end time should be shown as well.
  • If a location is given this should be shown as well.

phpunit test risky error:

Hello,
I've got the following "risky" error message during the phpunit test:

Moodle 3.5.1+ (Build: 20180831), ref: refs/heads/MOODLE_351+_STABLE
Php: 7.0.30.0.9.1, pgsql: 10.5 (Debian 10.5-1.pgdg90+1), OS: Linux 4.17.0-0.bpo.3-amd64 x86_64
PHPUnit 6.5.12 by Sebastian Bergmann and contributors.

  1. block_opencast_upload_testcase::test_upload
    This test printed output: proceed: 577000
    Job failed due to: moodle_exception: Username for Opencast API user is not setup correctly, go to settings of block opencast to fix this in /var/www/moodle/admin/tool/opencast/classes/local/api.php:93
    Stack trace:
    0 /var/www/moodle/blocks/opencast/classes/local/apibridge.php(466): tool_opencast\local\api->__construct()
    1 /var/www/moodle/blocks/opencast/classes/local/apibridge.php(499): block_opencast\local\apibridge->create_course_series('157000')
    2 /var/www/moodle/blocks/opencast/classes/local/upload_helper.php(304): block_opencast\local\apibridge->ensure_course_series_exists('157000')
    3 /var/www/moodle/blocks/opencast/classes/local/upload_helper.php(432): block_opencast\local\upload_helper->process_upload_job(Object(stdClass))
    4 /var/www/moodle/blocks/opencast/tests/upload_test.php(79): block_opencast\local\upload_helper->cron()
    5 [internal function]: block_opencast_upload_testcase->test_upload()
    6 /var/www/moodle/vendor/phpunit/phpunit/src/Framework/TestCase.php(1071): ReflectionMethod->invokeArgs(Object(block_opencast_upload_testcase), Array)
    7 /var/www/moodle/vendor/phpunit/phpunit/src/Framework/TestCase.php(939): PHPUnit\Framework\TestCase->runTest()
    8 /var/www/moodle/lib/phpunit/classes/advanced_testcase.php(80): PHPUnit\Framework\TestCase->runBare()
    9 /var/www/moodle/vendor/phpunit/phpunit/src/Framework/TestResult.php(698): advanced_testcase->runBare()
    10 /var/www/moodle/vendor/phpunit/phpunit/src/Framework/TestCase.php(894): PHPUnit\Framework\TestResult->run(Object(block_opencast_upload_testcase))
    11 /var/www/moodle/vendor/phpunit/phpunit/src/Framework/TestSuite.php(755): PHPUnit\Framework\TestCase->run(Object(PHPUnit\Framework\TestResult))
    12 /var/www/moodle/vendor/phpunit/phpunit/src/Framework/TestSuite.php(755): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
    13 /var/www/moodle/vendor/phpunit/phpunit/src/Framework/TestSuite.php(755): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
    14 /var/www/moodle/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(546): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
    15 /var/www/moodle/vendor/phpunit/phpunit/src/TextUI/Command.php(195): PHPUnit\TextUI\TestRunner->doRun(Object(PHPUnit\Framework\TestSuite), Array, true)
    16 /var/www/moodle/vendor/phpunit/phpunit/src/TextUI/Command.php(148): PHPUnit\TextUI\Command->run(Array, true)
    17 /var/www/moodle/vendor/phpunit/phpunit/phpunit(53): PHPUnit\TextUI\Command::main()
    18 {main}

Please could you have a look at this error.

Cheers,
Michael

Implement deleting videos in Opencast

It should be possible for users to delete uploaded videos from Opencast. In Opencast this is a two part process. First the video has to be retracted from everything and only then it can be deleted.

Configuration option for additional access policies

In Opencast one might have configured groups of users which should have access to every recording / video in the system. Therefore it would be useful to be able to configure access policies which are added to every recording / video that is being uploaded via the Opencast block in Moodle.

Add uploadjob rotation

Currently, the upload jobs selected for a cron run are not selected at random but ordered by id.
We experienced an error state at two of our upload jobs (see #28).
Since we set the maximum amount of upload jobs to two, every cron job these two upload jobs were processed. This way, no other job could be uploaded.
We should think about a rotation of the processed upload jobs, for instance ordered by a new field 'lastprocessed'.

Make content hashing / duplicate detection optional

At the moment the block checks whether a video has been uploaded before. If that is the case the access policy for the video is changed.

This should be optional as having the same video in multiple series is a use case.

PHP Warnings

You get a few warnings when uploading a video:

  • undefined property: line 365 ($event->newlycreated), upload_helper
  • try to get property of non-object: line 331 & 378 ($series->identifier), upload_helper

Create admin setting for series name

  • Add an admin setting 'series_name' from type text. Use a heading section "Access Policies".
  • Change apibridge->get_course_series() and apibridge->create_course_series() so that the series name from this setting is used as title]. Since the static function api::get_courses_series_title from the repository plugin is only called here, this functionality can be moved to the block!
  • Allow placefolders [COURSEID] and [COURSENAME], which are automatically replaced by course->id and course->fullname. You can use str_replace() for that. (http://php.net/manual/de/function.str-replace.php) See #6

Filter listed workflows in dropdown

Most workflows are just used for inclusions. These should not be used directly. Opencast has the notion of tags that determine in what situations running a particular workflow does make sense. In 5.x these are:

  • upload: Usable for uploaded media
  • schedule: Usable for scheduled events
  • archive: Usable for archived media
  • delete: Usable for deletion of events with publications
  • editor: Usable from the video editor

Before 5.x there was a -ng suffix for all but the last tag.

When querying /workflow/definitions.json the tag is represented as either:

// no tags
{ "tags": "" }

// one tag
{
  "tags": {
    "tag": "archive-ng"
  }
}

// two or more tags
{
  "tags": {
    "tag": ["schedule-ng", "upload-ng"]
  }
}

I would suggest to at least filter out the no tags case.

Allow visibility based on moodle groups

It is required by some of our teachers, to be able to restrict the visibility of a video based on the membership in moodle groups.
This could result in new ACL rules as G42_Learner (for the membership in the moodle group with id 42).

Rewrite workflow validation in admin settings

Since the resource we are requesting in validation is only accessible with admin rights, we should change the validation to use workflow/definitions.json. The access rights for this can be given through ROLE_UI_EVENTS_CREATE
With this we could also offer an dropdown for workflows.

Create admin setting for group creation

  • Add a setting group_creation as a checkbox to the admin settings. Use a heading section "Access Policies".
  • Change upload_helper->process_upload_job so that STATUS_CREATING_GROUP is skipped, if group_creation is false.

Inconsistent layout of overview page

A while ago this CSS rule was introduced to the boost theme:

// Minimum height required for a menu in a table inside a scrollable div.
.no-overflow > .generaltable {
    margin-bottom: 0;
    min-height: 10em;
}

But that CSS rule only applies to one of the two tables on the overview page:
min-height

In my opinion the two tables should either both have the min-height or none of them should have it.

Block config does not show default values

In the current version of the block, all default values, which are defined by the mform, are overriden and thus have no effect. This makes the plugin very difficult to setup.

Videos not deleted from moodledata

After a video has been uploaded it remains in the moodledata folder. Is this intended?

I think this plugin should locally delete the video file once it has been uploaded (or at latest once it has been successfully processed).

Custom Upload Limit for Opencast Block

The maximum upload limit of each filepicker is limited by a global setting, which is usually not that high.
For opencast videos it is important that videos up to some GB can be uploaded. For this reason an additional setting should be added, which allows to specify the maximum upload limit for opencast videos. This than has to be passed as a parameter to the creation of the filepicker in add_video.php.
There is an example for this parameter in the moodle docs: https://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms#Using_the_filepicker_element

Enable admins to copy the content of an existing series

As an administrator I want to be able to create a new series for a course and select an existing series to copy all or some content from. The user should be able to choose which videos to copy.

Duplicating the event in Opencast could be realised using a workflow, provided that Opencast includes this PR opencast/opencast#23

Video URLs in overview page

Hello,
we are wondering if you could add a column to the list of released videos at blocks/opencast/index.php that contains the URL to each video.
The reason we would like to have such a feature is that we don't trust our users to find the video they want to embed (in the Atto editor) via "Media", "Browse repositories..." and "Opencast".

Is this something you would consider?

If not, would you instead consider refactoring the way this table is generated in index.php: https://github.com/unirz-tu-ilmenau/moodle-block_opencast/blob/f5328cd42241ccf68f324873bf9c154ac9a2af84/index.php#L157-L194 so that the table is created by a method of the renderer and/or a template? This way we would be able to override the renderer or template in our theme and add the desired column this way.

Invalid order of upgrade savepoints

When upgrading from older versions an error is thrown:

-->block_opencast
++ 2018082800: Success (0.02 seconds) ++
Default exception handler: Cannot downgrade block_opencast from
2018082800 to 2018082800. Debug:
Error code: cannotdowngrade

  • line 361 of /lib/upgradelib.php: downgrade_exception thrown
  • line 118 of /blocks/opencast/db/upgrade.php: call to
    upgrade_block_savepoint()
  • line 1005 of /lib/upgradelib.php: call to xmldb_block_opencast_upgrade()
  • line 514 of /lib/upgradelib.php: call to upgrade_plugins_blocks()
  • line 1857 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 182 of /admin/cli/upgrade.php: call to upgrade_noncore()

!!! Cannot downgrade block_opencast from 2018082800 to 2018082800. !!!
!!
Error code: cannotdowngrade !!
!! Stack trace: * line 361 of /lib/upgradelib.php: downgrade_exception
thrown

  • line 118 of /blocks/opencast/db/upgrade.php: call to
    upgrade_block_savepoint()
  • line 1005 of /lib/upgradelib.php: call to xmldb_block_opencast_upgrade()
  • line 514 of /lib/upgradelib.php: call to upgrade_plugins_blocks()
  • line 1857 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 182 of /admin/cli/upgrade.php: call to upgrade_noncore()
    !!

This is due to an invalid order of savepoints within the upgradesteps.

Fix error state in upload jobs

If an upload job is uploaded to opencast the status of it is set to 27 -> uploaded. However, there are still some things to do. When the event in opencast is deleted before moodle has the chance to work on these jobs, it will enter an error state for these jobs. We should think about a way, how to escape such error states.
The described one should first of all set the upload job to failed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.