Post teachers when students upload

Post teachers when students upload

by Pablo Etcheverry -
Number of replies: 6
Picture of Core developers
Hi!
    I couldn't make it work, so I suppose it doesn't exist... What about sending an e-mail to the teacher when a student uploads a file in an assignment? I've seen this feature working when the student gets graded... this would be the same, but triggered by another event.
TIA,
Pablo
Average of ratings: -
In reply to Pablo Etcheverry

Re: Post teachers when students upload

by Lauran de Bever -

I am lookingh for the same feature, now the teacher doesn't know, when a student uploads a new file

Do you have a solution yet?

In reply to Lauran de Bever

Re: Post teachers when students upload

by Brian Schmidt -
I'm looking for this same exact feature.  I'm assuming since there are no replies that one does not exist.  However, it's been a while, so I thought I'd bump this to see if anything has surfaced.
In reply to Brian Schmidt

Re: Post teachers when students upload

by Darren Smith -
It's in the dev version (page 2 when you create an upload assignment) so looks like it will be in the 1.5 release


Average of ratings: Useful (1)
In reply to Pablo Etcheverry

Re: Post teachers when students upload

by Richard Bartz -

If you just cant wait for 1.5...:

Here is what I did to get email notifications whenever assignments were submitted.  Quick and not very clean, but it works well for me.  It even tells me which course and which assignment...  Do this (AFTER YOU MAKE BACKUPS OF YOUR  ORIGINAL FILES, OF COURSE..!) :

In config.php add the following 3 variables anywhere in the file, using your own email address info, of course...:

// $adminemail is where you want the assignment notifications to go
$adminmail = "admin@mymoodle.org";
//$fromemail is whatever you want in the from line in the notifications
$fromemail = "noreply@mymoodle.org";
//$subject is whatever you want in the subject line
$subject = "MOODLE Lesson Submission";

Then in /mod/assignment/upload/php about line 75 find the following two lines:

if (insert_record("assignment_submissions", $newsubmission)) {
    print_heading(get_string("uploadsuccess", "assignment", $newfile_name) );

ADD these three lines immedately after and before the "} else {" line

// Notify the admin a submission is made
$message = "Assignment Submitted: $course->shortname: $assignment->name";
$temp = mail( $adminmail, $subject, $message, "From: " . $fromemail) or print "Could not send mail.";

You can modify the $message line if you want to say whatever you like, there are more variables that could be used!  That is it, whenever an assignment is uploaded, then an email will be sent to the address in your config.php file.

RDB

Average of ratings: Useful (1)
In reply to Richard Bartz

Re: Post teachers when students upload

by Brian Schmidt -

This is all excellent information.  Thank you to both you and Darren for the responses.  Very helpful!

I haven't had the chance to look at the code just yet, but how possible would it be to use a variable to grab the instructor's e-mail, rather than having it all get lumped and sent to the admin?