Code Monkey home page Code Monkey logo

moodle-mod_collaborativefolders's Introduction

Collaborative folders

Build Status codecov

This Activity Module allows teachers to create folders in ownCloud, which may be allocated to groups of students who can then work collaboratively in these folders.

This plugin has originally been developed with ownCloud in mind, but works with Nextcloud just as well. For simplicity we will refer to both as "ownCloud".

Acknowledgement: This plugin was originally created by Information Systems students of the project seminar sciebo@Learnweb at the University of Münster in 2016-17; see https://github.com/pssl16 for an archive(!) of their great work. Learnweb (University of Münster) took over maintenance in 2017.

Installation

  1. Place this plugin at mod/collaborativefolders in your Moodle directory.
  2. Configure ownCloud and Moodle as described in https://docs.moodle.org/en/OAuth_2_Nextcloud_service. A repository and this plugin may share an issuer -- you do not need to configure two issuers for the same system!
  3. Also, make sure that a system account is connected.
  4. In the plugin settings at Site administration ► Plugins ► Activity modules ► collaborativefolders, select the issuer. You can also define what display name will be used to describe the remote system.

While the plugin is in use, the system account should not be changed, because it could result in synchronization problems. Activities that were generated beforehand would become unusable. Should the system account disconnect, make sure to re-connect the same one.

Teacher view

Firstly, teachers add a Collaborativefolders instance to a course. Upon creation, teachers choose an activity name for the course. Furthermore, teachers decide whether they have access to the collaborative folder(s); otherwise, they will be private for the students. This setting cannot be changed. Finally, teachers choose whether they want to activate groupmode, resulting in the creation of separate group folders in the cloud storage.

Folders will not be created automatically. They are created on-demand once a student requests access to them.

Student view

Before students can use a collaborative folder, they need to access it once via Moodle. This serves two purposes. First, we do not just create folders in their personal spaces without them knowing; second, they can only request access if they have sufficient permission (as determined by Moodle).

When an instance is first opened, students are prompted to authorise Moodle to access the remote cloud system.

Authorise Moodle to access the cloud system ("login")

After authorising Moodle via the OAuth 2 flow, they are able to request access to the folder. Access will be granted immediately. They are able to choose a name for that folder, too:

Choose a name to get access

Once the folder is shared, the view in Moodle changes, providing the name and a link to the actual folder.

Moodle provides a reference to the folder

From this point onwards, this student does not need to use Moodle to access the files -- they can also go through the remote system directly, as the folder is permanently shared with them. Offline work is possible, too (but will only be synchronised to the cloud folder once back online, of course).

The folder is permanently shared in the remote system

moodle-mod_collaborativefolders's People

Contributors

dagefoerde avatar davosmith avatar joneug avatar justusdieckmann avatar laur0r avatar ninaherrmann avatar walsidalw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-mod_collaborativefolders's Issues

Bug: share not created with long course name

When the course name is really long, the folder and, therefore, the whole share cannot be created.
To do:

  • research the exact length
  • find a strategy for dealing with Problems possible:
    • throw warning for the course creator (downside - course must be renamed)
    • change all occurrences of creating and finding shares to use the shortened course name

Improve pix

  • The cloud in icon.svg could be larger within the folder, in order to improve its visibility.
  • Other pictures are only relevant for README.md and should therefore be removed from pix/

[original reporter: @Dagefoerde]

Implement the privacy API

Moodle's privacy API enables plugins to report metadata about stored personal data, and provides facilities for export and deletion of data. We need to implement that.

Note that we do not need to implement export/deletion for files that are not stored in Moodle; i.e. we do not need to work on files in an ownCloud instance. Nevertheless, we need to declare what we store in Moodle, and what personal data we transmit to an ownCloud instance.

task realises rather late that no technical user is logged in

The task does lots of work even if no technical user is logged in. It is only when it tries to create the first folder in a loop that it realises that it does not even have the rights.

Is there a way to obtain some status page / api from ownCloud, that can be used to check whether someone is logged in AND actually still has access?

[original reporter: @Dagefoerde]

Fix access restrictions

If you create a collaborative folder with teacher-access and group-mode, students which are in no group at all can create a share for the teachers' root folder.
Additionally, we have to think about what should happen if:

  • Students are in multiple groups? (resolved)
  • Students change their group after the share is established?
  • What permissions do students have that are not in any group? (Expected: none. Actual: ??)
  • What should happen for groups that are created after the activity has been created? (see comment by @davosmith below)

[original reporter: @tobiasreischmann]

collaborativefolders_delete_instance could be broken

I once created and deleted a single instance. Afterwards, the admin's activities overview page showed mod_collaborativefolders with 1 instance, although there should be none. It is possible that collaborativefolders_delete_instance is broken.

I am actually unsure whether

if (!$collaborativefolders = $DB->get_record('collaborativefolders', array('id' => $id))) {
works as intended

    if (!$collaborativefolders = $DB->get_record('collaborativefolders', array('id' => $id))) {

not sure whether ! negates the full thing or only the assigned variable!

[original reporter: @Dagefoerde]

error/Could not upgrade oauth token

Hello,

when I connect with a moodle user (using oauth) and when I use collaborative folder; I have the following error message:
error/Could not upgrade oauth token

The "isteacher" capability name might be confusing

The name of the capability "isteacher" is not fortunate, and as a consequence it then requires a lot of additional comments and explanations in both code and the UI.

What about if it was called something like mod/collaborativefolders:restrictedaccess.

Also, I don't fully understand why it needed to be implemented in this "negative" way:

Note: This is a restriction, not a capability. Don't use for deciding what someone MAY do, consider as MAY NOT instead.

Although such capabilities exists in core too, they should still be used rarely as exceptions really. Would not it be cleaner if

  • mod/collaborativefolders:view was given to everyone as it is now (because it has an inbuilt behaviour used by the core) but it would represent the minimal /restricted level of access to the activity
  • there was another, something like "edit" or "manage" or so which would give the user the full access to the folder - and this one would be then granted to students only.

This existing negative logic makes things only confusing. What if someone sets the "mod/collaborativefolders:isteacher" as prohibited etc. - all such multiple negations make things unnecessary complicated imho.

However, I can see how whole this concept of "being a teacher" (which was abandoned around Moodle 1.7 times) is hard-coded in the module's internal APIs so I don't expect this would be actually addressed.

Store the ownCloud username after logging in

Immediately after a user authorises Moodle to use ownCloud in his/her name (using the "Log in" button), Moodle should fetch the ownCloud username and store it in the user's session via MUC.

Motivation:

  • The username is required to actually create shares by the system account (in order to know who to share it with). Right now, this results in an extra roundtrip for every share, because the plugin first asks for the username, an then creates the share. We can save this roundtrip.
  • In addition, the username can be displayed right next to the "log out" button, thus reassuring users that the plugin is operating in the correct account.

The system account is unable to connect to NextCloud, so folders for this activity will not be created. Please inform the administrator about this.

Hello,

when I connect with the moodle administrator (not using oauth) and when I use collaborative folder; I have the following error message:
The system account is unable to connect to NextCloud, so folders for this activity will not be created. Please inform the administrator about this.

Moodle 3.8.1+ (Build: 20200124)
Nextcloud 18.0.1

Log moodle apache:
[Thu Feb 27 15:51:41.725329 2020] [proxy_fcgi:error] [pid 1107:tid 139974150137600] [client ] AH01071: Got error 'PHP message: [client ] https://domaine Invalid Login Token: user Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36\n', referer: https://domaine/

After redirect, highlight the active folder

After creating/removing a share, the plugin redirects to the view.php using a specific anchor, in order to scroll to the folder that the plugin operated on (e.g. view.php?id=100#folder-1).

Similar to forum posts, we can use the anchor to highlight the folder in order to visually distinguish it from the other folders.

Verbindung zur Nextcloud klappt nicht

Hallo!
Wenn ich einen Collaborativfolder einrichten möchte erhalte ich die folgenden Fehlermeldung:

Unable to share the folder with you: WebDAV error code 403

Habt ihr eine Lösung dafür?

Viele Grüße
Friedhelm

Moodle users should be able to re-share to themselves

Maybe, somehow, their owncloud account is lost or they legitimately possess more than one owncloud account.
mod_collaborativefolders assumes that once a folder is shared with a user, that user will always retain access to that share. This is not correct in the above scenarios.

There currently is no way to re-share a collaborative folder.

Found this issue while thinking about #1 (comment).

[original reporter: @Dagefoerde]

Migrate to M3.3 OAuth API

The new API provides exactly what we need, including support for a technical user. Using it will help reduce continued development efforts on our side and makes it consistent with other Moodle Plugins.
Will resolve

  • #14
  • #15
  • #23
    ... as we hand off responsibility to the core API.

Also, this will remove

  • technicallogout.php
  • \event\technical_user_loggedout

Decouple from specific cloud service name.

We have some explicit references to ownCloud, e.g., in language strings that are presented to the user. This is problematic for two reasons:
a) This works well with any service that relies on a combination of OCS and WebDAV (I just successfully tested with Nextcloud 15 RC 1).
b) Private clouds might not be called "ownCloud" (in our place, sciebo).

  • 1. Turn the activity icon into something more neutral
  • 2. Remove explicit references to names from the UI or make the display name configurable

ad 2.: We could take the name from the issuer. But, for instance in the repository configuration, the issuer name is never displayed to users, so admins might expect it to be private. Instead, maybe provide a setting.

Logout-and-login of technical user could check whether the user account has changed

We could place a special file in the root of the technical user's owncloud file system, e.g. .moodle-mod_collaborativefolders. The content could create some hash. That hash could be checked on re-login and, if it differs, a notification could be shown to the administrator, hinting at a possible (!) error.

Also, should we provide options to handle this, e.g. lock all existing instances on demand? This would be useful and necessary if the account actually changed for legit reasons.

[original reporter: @Dagefoerde]

Enforce a folder structure that supports more than one application

The plugin uses the technical user ("System account") in order to manage folders. However, right now it assumes it works alone, and creates folders per instance in the root directory of the technical user. This may lead to problems if other plugins want to use the same account and might use the same folder structure.

Expected:
At the root level, the plugin should define a specific folder structure that is unique to this plugin (or, at least, very speaking), so that it does not conflict with other plugins. Folders per instance will be created below this folder structure, instead of at root level.

Issues in Moodle that cause problems for this plugin

Moodle has made some assumptions about external services that were valid for Facebook, Google, and Microsoft, but that do not apply to ownCloud/Nextcloud. These issues must be resolved before it is safe (or even possible) to deploy mod_collaborativefolders.

This list might grow and issues may be resolved. We try to keep it up to date with current Moodle progress. Any help in these tickets is much appreciated!

settings.php is not to be trusted

Currently, settings.php does weird stuff with parameters. However, it may be included in arbitrary places. I am also not sure if any capabilities are evaluated at all. This file must be carefully refactored to ensure that no weird side effects can happen while an administrator is not explicitly changing settings of mod_collaborativefolders

[original reporter: @Dagefoerde]

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.