Moodle Plugins directory: Upload notification | Moodle.org
Upload notification
Upload notification
This plugins allows students to receive a notification as soon as new material becomes uploaded. Optionally the new file can be included in the mail directly. For updated material a changelog will be displayed which includes the changed page for PDF documents.
License
Copyright (c) The Development Manager Ltd, Hendrik Wuerz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later 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.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Requirements
- Tested with Moodle 3.4+
- Requires the plugin
local_changeloglib
https://github.com/hwuerz/moodle-local_changeloglib
Installation
- Install the dependency local_changeloglib with the required command line tools (See readme.md in the changeloglib repository.)
- Clone the repo inside MOODLE_HOME/local/uploadnotification
cd path/to/moodle/home git clone https://github.com/hwuerz/moodle-local_uploadnotification.git local/uploadnotification
- Browse to Site Administration -> Notifications and allow the database upgrades to execute
- After installation define your admin settings to customize the plugin behaviour. See chapter Features of this document for more information.
Tests
This plugin provides tests for the main features. To run them please follow the next steps:
- Install PHPUnit on your system and configure moodle. See https://docs.moodle.org/dev/PHPUnit for more information.
- Install the plugin.
- Run the tests
cd /path/to/moodle/home php admin/tool/phpunit/cli/init.php vendor/bin/phpunit --group local_uploadnotification
Features
Mail delivery for new material
The plugin can inform your students as soon as new material is published in one of their courses. The delivered mail can optionally include the new file. These functions must be enabled by three parties: The moodle admin, the teacher and the student. The options for courses and for students are only visible if the admin has enabled the feature.
As a moodle admin follow these steps
- Go to
Site administration
->Plugins
->Local plugins
->Upload notification
- Set
Allow notification mail delivery
to yes. This will enable the mail delivery for course admins and students. If you set it to no, the delivery is completely disabled: No one can see the settings and no mails will be send in any case. - Set
Maximum filesize of mail attachments (in KB)
to 100000. This will allow attachments up to 10MB. If this value is zero, no attachments will be send.
Now the feature is visible for teachers and students. As a general rule: A mail will only be send if someone (teacher or student) has requested the delivery and no one has forbidden it.
As a teacher follow these steps
- Go to your course -> Open the course menu (where you can access the settings, turn editing on, ...) -> Click on the link
Uploadnotification
- You have three options for
Enable notification mail delivery for material uploads
No preferences
The default option. No mails will be send except the user requests them.Disable
No mails will be send for actions in this course. The student settings are ignored.Enable
Mails will be send except a user has disabled the delivery for himself.
- Set the check mark for
Allow email attachments
(this is the default). This will allow students to receive mails with attachments. As a teacher you can not force this to avoid unwanted traffic.
As a student follow these steps
- Click on your username and select
Preferences
- At
Miscellaneous
you find a linkUploadnotification
- All students have two settings:
Enable notification mail delivery for material uploads
with the same options as teachers.No preference
will only send mails if the course settings have enabled them.Enable
sends always mails except a teacher has disabled the feature for a course.Disable
will never allow the mail delivery to this student.Maximum filesize of mail attachments (in KB)
Insert a value greater zero to receive attachments up to this size. You can not request sizes which are greater than the limit of the moodle admin. The attachment will only be send if the teacher has not removed the check mark in his his course.
Changelog generation
The plugin can build a changelog for uploaded resources. It will include the timestamp of the update and the filename of the predecessor. At the moment only file resources are supported (no folders, pages, or others). For PDF documents, the plugin can detect the page number on which changes were performed.
Teachers can update material on two ways:
- Delete the old resource and upload the new document independently
- Edit the current resource and select a new file.
A file and its predecessor must be uploaded in the same course and section.
To enable the changelog, the moodle admin has to allow this feature. If he has deactivated it, teachers will not see the options in the course settings.
- Go to
Site administration
->Plugins
->Local plugins
->Upload notification
- Set
Allow automatic changelog generation in courses
on true. This will activate the feature for teachers. - Set
Allowed size of analysed files for the diff detection (in MB)
to 100. This will allow the plugin to search for differences on documents with maximum 100MB filesize. If you set this value to zero, a changelog can be generated, but the pages where changes are performed will not longer be identified. - Set
Enable the changelog in new courses by default
andEnable the diff detection in new courses by default
to true. This will activate the changelog and diff detection in all courses which have no custom settings.
As a teacher follow these steps to customize the behaviour in your course:
- Go to your course -> Open the course menu (where you can access the settings, turn editing on, ...) -> Click on the link
Uploadnotification
- Set
Display a changelog for updates
to true. This will print an information with the filename of the predecessor and the time of the change next to the new document. - Set
Detect differences in updates
to true. This will search for changed pages in the new document and add their numbers to the changelog. This feature only works for PDF documents which are smaller than the admin-limit. - Create a new PDF document in your course.
- Edit the new document and upload an update with a few changes.
- On the course page, the changelog will be displayed.
- Delete the updated resource and upload a version which was changed again a little bit. This upload must be in the same section as before.
- After a page reload (limitation of moodle because the upload was performed via ajax) the changelog is displayed again.
since we've updated to moodle 3.8 the plugin doesn't work properly. There's a course where messages are sent and another where no messages are sent, but both courses have the same settings. Is this due to the incompatibility or might there be another reason? Thanks for suggestions.
Regards, Anja
I have the same problem. "White Page" after installing your plugin.
I am sorry to hear that, but cannot confirm these issues here. Can you please do the following steps and let me know what comes out of it?
1. Uninstall the plugin (e.g., manually delete ......./local/uploadnotification and ....../local/changeloglib)
2. Check that Moodle now works flawlessly (no "white page")
3. Turn on debugging
4. Reinstall the plugin
5. Check if the "white page" has reappeared
6. Look at the server logs (near the end) of your web server and copy the error message. That should give a clue to what is wrong.
(then de-install the plugin and reset debugging to the previous level).
Thank you!
Is these plugins going to be updated to Moodle 3.9?
although the lead developer is no longer working with us, the plugin works without problems in our 3.9 (now 3.10) installation
See the description a few posts further up for debugging. As the lead developer has left the team, I need more information to check what might have gone wrong...
[Tue Nov 02 01:14:19.033933 2021] [proxy_fcgi:error] [pid 1160231:tid 140464824301312] [client 79.11.231.218:50806] AH01071: Got error 'PHP message: PHP Warning: require_once(/srv/infor/htdocs/moodle/local/uploadnotification/classes/../../changeloglib/classes/backup_lib.php): failed to open stream: No such file or directory in /srv/infor/htdocs/moodle/local/uploadnotification/classes/changelog.php on line 29
PHP message: PHP Fatal error: require_once(): Failed opening required '/srv/infor/htdocs/moodle/local/uploadnotification/classes/../../changeloglib/classes/backup_lib.php' (include_path='/srv/infor/htdocs/moodle/lib/pear:.:/usr/share/php') in /srv/infor/htdocs/moodle/local/uploadnotification/classes/changelog.php on line 29'
Install local_changeloglib (as linked in the article), and you should be fine.
I do not see any option to actually specify dependencies for plugins (there is a requirements section, but that does not enforce dependency checks)...
Viele Grüße,
Guido