GithubHelp home page GithubHelp logo

moodle-local_listcoursefiles's Introduction

moodle-local_listcoursefiles

This extension allows teachers to view a list of all files in a course and to change the license for each file. It is also possible to download the files in a ZIP archive.

Adding a new license

Since Moodle version 3.9 you can add a custom license via Moodle's license manager in the Site administration.

Expired files

We are using this plugin at Technische Universität Berlin in order to conform to german law (§ 52a UrhG). Copyrighted texts have to be made unavailable after a course ends. Since only a few of our teachers upload copyrighted texts and we want our students to be able to view their old courses (and non-copyrighted files), we use this plugin as a solution.

Our teachers specify the license of each file (through this plugin or the Moodle file picker). That way, we can identify the copyrighted files and make only these unavailable. We replaced the default licenses from Moodle by "License unexamined", "Copyrighted (provided in accordance with §52a UrhG)", "Approved by author", "Open content", and "Public domain". "License unexamined" is the default license.

The files (documents) that are currently unavailable for students can be highlighted by the plugin. The following settings need to be defined in the config.php:

  • array $CFG->fileexpirylicenses which licenses (shortnames) expire
  • int $CFG->fileexpirydate when do files expire (unix time)
  • array $CFG->filemimetypes['document'] mime types of documents

Some modifications to the Moodle core are required to restrict the download of copyrighted files. Our patch for Moodle 3.2 can be found here: https://github.com/innocampus/patches/blob/master/Moodle32-Check-file-license-and-expiry-date.patch

moodle-local_listcoursefiles's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

moodle-local_listcoursefiles's Issues

Drop support for Moodle 3

Limit support to Moodle versions >=4.1.

Replace deprecated/old function calls and class uses to align with newer Moodle versions. (Example: \core_user\fields::get_name_fields instead of get_all_user_name_fields.

Update version number.

Update CI strategy matrix to reflect this.

Use core `license_manager` methods in the `licenses` class

We run into trouble here in line 50, when dealing with custom (i.e. non-core) licenses.

public static function get_available_licenses() {
global $CFG;
if (self::$licenses === null) {
self::$licenses = [];
$a = explode(',', $CFG->licenses);
foreach ($a as $license) {
self::$licenses[$license] = \get_string($license, 'license');
}
}
return self::$licenses;
}

Those do not have language strings, which causes debug messages in the get_string call and prevents their full names from being rendered.

The core license_manager handles most of the relevant license logic already (e.g. handling custom licenses or filtering only active licenses). We should probably use either the get_licenses or the get_active_licenses method in the function above, then simply map each license object returned to its fullname property.

Fails in Moodle 3.9

get_all_user_name_fields() is deprecated in Moodle 4.0 but the replacement \core_user\fields::get_name_fields() is not available in Moodle 3.9

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.