Issue Details (XML | Word | Printable)

Key: MDL-6591
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Petr Skoda
Reporter: Wen Hao Chuang
Votes: 18
Watchers: 14
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Optional assignment graded email notification

Created: 19/Sep/06 06:36 AM   Updated: 27/Feb/08 02:09 PM
Return to search
Component/s: Assignment
Affects Version/s: 1.8.4
Fix Version/s: 1.9

File Attachments: 1. Text File assgn_notification1.patch (10 kB)
2. Text File assign_emailgradespatch.txt (11 kB)
3. Text File ganderson assignmentlib.php.patch (3 kB)

Environment: any moodle system from 1.5.x to 1.9.x
Issue Links:
Relates
 

Participants: Ann Adamcik, Anthony Borrow, Gary Anderson, Martin Dougiamas, Michael Penney, Pablo López, Peter Kupfer, Petr Skoda, Ray Lawrence, Sarah Meadus, Wen Hao Chuang and Wen Hao Chuang
Security Level: None
Resolved date: 27/Feb/08
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
For more details, please see this discussion:

http://moodle.org/mod/forum/discuss.php?d=30405#247855

It would be great to have such option as it is a big problem here at SFSU too.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Michael Penney added a comment - 17/Nov/06 12:43 PM
In my opinion, the best solution would be to replace automatic notification with a manual notification, e.g. the teacher clicks a button to notify students of grades and comments.

Wen Hao Chuang added a comment - 18/Nov/06 02:27 AM
I second Michael's idea, but the button would probably be associated with each specific "assignment," and not "student"... For large classes like 500+ students it might not be a good idea to check a checkbox for each student in order to notify them by emails...

Sarah Meadus added a comment - 10/Jan/07 01:39 AM
I have faculty members asking for an easy way to turn this off and on as well. It would be great if that could be a feature.

Pablo López added a comment - 29/Jun/07 07:34 PM
I haven't thought about the best solution yet, but the configuration of this feature should definitely only be shown if "show grades to students" has been enabled in course configuration. If not, it should automatically be turned off.

It just doesn't make sense that students get a copy of their grades if you've disabled showing grades to students in the course configuration, don't you think?. I think this should be classified as a "functional" bug and not an improvement request.

This is happening right now in Moodle and is a really, really big annoyance, especially because I don't know if this feature is shown in the documentation and can lead to really undesirable situations between teachers and students.

All efforts are welcome, I'll try to give a hand when I can.

I read this affects "any moodle system from 1.5.x to 1.6.x". Has it been fixed?. If not, we should change the description and, I said, reconsider this as a a bug.


Ann Adamcik added a comment - 27/Oct/07 12:00 AM
I've put together a fix (for 1.8+) for this to do the following:

1. Turned off the automatic notification via cron.
2. Added a button at the bottom of the view submissions page 'Send email notices to students'.
3. When/if the instructor clicks the button, students will be sent the email notice that a grade or comment was posted/updated.

It's a manual process, rather than a config setting on the assignment. The 'send' function sends notices to everyone who's grade/comment was added/updated since the last time the instructor hit 'send'. There is not a 'send to selected students' feature.

As for the course 'show grades' setting, this seems to just affect whether or not the gradebook is shown to students - they can still see the grades and comments attached to their assignment submissions. The email notice that is sent from the assignment mod does not include the grade or comment. It just says that the teacher/grader has posted some feedback on your assignment submission, and includes a link to the submission, where they can view the grade.


Peter Kupfer added a comment - 24/Dec/07 08:34 AM
It would be nice also if in the profile settings, if a student set to leave e-mail enables for forums and disabled for grades because I would like for students to not have get e-mails they don't want about grade updates but I would still like them to get course information.

Wen Hao Chuang added a comment - 11/Jan/08 07:39 AM - edited
I'm trying out Ann's fix right now (she already attached the manual fix I believe), but is there any update on a more permanent fix (config type of fix) for this issue? Thanks!

Martin Dougiamas added a comment - 20/Feb/08 02:51 PM
I like Ann's idea - it's a good one and doesn't require any database changes.

Peter's user profile preference is not needed in 2.0 because we'll have the new messaging system. In that system all messages from Moodle (including ones like these) go through internal messaging, and each user can choose what to do with messages from each module. eg they might choose assignment notifications to go to SMS gateway, personal messages to be popups, and forum postings to emai).

We will definitely include this in 2.0. I'm undecided about getting it into 1.9 at this late stage.


Martin Dougiamas added a comment - 20/Feb/08 04:59 PM
Petr, can you please look at getting this into Moodle 1.9? It has a LOT of votes and the patch is done.

Martin Dougiamas added a comment - 20/Feb/08 05:01 PM
I've not looked at the code other than a quick skim.

Petr Skoda added a comment - 20/Feb/08 05:27 PM
If I am reading it correctly the patch just removes one feature and replaces it with a different one which is not good, it must be configurable - I think there are still some free vars to store the setting, though it may collide with custom plugins

Looking at the code now


Gary Anderson added a comment - 20/Feb/08 08:00 PM
Here is my patch for this that I made for my school and it has been working well for quite some time. I think that it better gets at the problem than the first patch and works in both quick grade and standard mode.

Also, add the string to the assignment lang file:

$string['emailnotification'] = 'Send notification email';

--Gary


Petr Skoda added a comment - 20/Feb/08 09:48 PM
Gary I like your patch, here is a bit improved version that uses user preferences.

Petr Skoda added a comment - 21/Feb/08 02:57 AM
Patch based on Gary's code committed into cvs, it allows you to decide if mail should be sent or not, there are two settings - one for quickgrading the other for grading in pop-up, both are stored in user preferences.

Unfortunately the bulk sending of all notifications can not be implemented (requires integer mailed db field to track mailing status) without loosing of current functionality. Possible workaround is to not send any notifications and use forum for announcement when everything graded.

The hiding of grades can be done in new gradebook by specifying hidden until.

Please test, test, test and reopen in case of any problems or major objections

thanks everybody!


Gary Anderson added a comment - 21/Feb/08 05:00 AM
Petr:

I am going to reopen this and I am still studying the revised patch. At this point it is not sending the number of emails that I would expect and there are other critical problems.

Here are some things I would note:

1. There seem to be a number of other changes in mod/assignment/lib.php with this CVS update that do not have to do with email notification. This makes it difficult to isolate this problem and it may introduce other problems to a stable version.
2. While I like the idea of saving notification as a preference, the way it is done here is confusing and will result in emails not being sent when expected. In my original patch, teachers would click Send notification email only when they wanted email sent. That worked great, as teachers would normally just notify students of a significant assignment. Here, they need to save it as a preference which sticks with the teacher for all future assignments. And what is worse, if they save their preference after they have just entered grades, they will lose all those grades And, if they don't save preferences, it does not honor their Send notification email setting for that transaction, which is not what they would expect.
3. As I said, it does not seem to be sending out the quantity of emails that my tests suggest it should.

I would suggest that we revert immediately and apply just a grade notification patch to something that we know is stable. From the description of how we use it given above, I think that the retained setting should be the state that the teacher last used, rather than the current Save preference location.


Gary Anderson added a comment - 21/Feb/08 05:20 AM
Note: I was incorrect when I said that there were other CVS changes in this revision. I was reading the CVS view incorrectly. The other problems are still issues, but won't be as difficult to understand. I would still recommend reverting as I don't think the notification checkbox will be able to go where it is

Petr Skoda added a comment - 21/Feb/08 06:30 AM
hello,
I did test the code and it sends the emails the way it did before, the only difference is that if you uncheck the "send notification" it is not sent.

2/ I did understand what your patch does, but that is very different from Moodle 1.8. Problem with your solution is that teacher must click each time when he wants the email. If he returns back to that submission the submission may or may not be mailed - the options are the student gets 2, 1 or 0 emails depending on timing and what teacher selects. This could be solved if we had some room in submission table to track the mailing states properly.

I think the confusion comes from the label, maybe "Disable email notifications" and invert the switch?


Petr Skoda added a comment - 21/Feb/08 07:07 AM
Patch committed into cvs, please test it again.

Summary:

  • UI changes - added two checkboxes with "Disable email notifications" - in grading popup and quickgrading options
  • if somebody does not want notification after saving new grade or feedback - tick the checkbox

the rest works as before


Gary Anderson added a comment - 21/Feb/08 09:31 AM
A few things:

1. I think that the string should continue to be Send notification email. The double-negative will cause confusion. I know that I am confused now and was not before.
2. No problem with notifications being on by initial default as in 1.8, and the button can be checked. And I do agree with saving the user preferences.

3. The popup form is working as it should (except that checkbox should be reverted as per #1.) It sends out emails only when checked, and saves the last preference.

But there are major problems with the main grading page.

4. The issue is that the checkbox be part of the "Save preferences" form. Try entering a bunch of grades and comments, then change the state of the email notification and click "Save preferences". All of your grading is now gone. This is a bug in the previous configuration too, but it happens less often as soon enough teachers settle on those settings. The same will not be true for when the will send out notifications.
5. Another problem with it being on a different form is that when submitting grades, the last preferences is what is used for mailing rather than the current setting of the checkbox. The status of that box is not part of the post. I don't think (in fact I know), that teachers won't expect that. So, emails will go out at the wrong time.

The solution: put the checkbox in the main grading form as in the original patch. Save the preferred setting on submission as with the pop-up form. We won't be getting multiple emails because the cron only sends out notices after maxeditingtime has past and then just uses that last submission.


Petr Skoda added a comment - 21/Feb/08 04:53 PM
hmm, I agree the quickgrading options is not a good place

Petr Skoda added a comment - 21/Feb/08 05:19 PM
1/ I do not think so - there is no double negative, we had notification always on before, now you can disable it - new feature enabled, checkbox ticked
4/ and 5/ fixed

Anyway I was saying for a long time that assignment needs more work, some rewriting, improvements, new features etc, unfortunately I get to this mod each time just before the release and it is not possible to do any significant changes without db changes

assigning back to Martin so that he decides which label is best, thanks everybody


Gary Anderson added a comment - 21/Feb/08 07:01 PM
Thanks, Petr. I have tested the code and it now works as expected in terms of notifying at the correct conditions and retaining the setting last used.

A note to others testing this: Assignment notifications are sent out by the cron process. This means that notifications will not go out immediately. In addition, they are not sent out until the setting for maxeditingtime has passed since the last teacher edit (set from the Site administration->Block->Site policies and defaulting to 30 minutes). And, the assignment part of the cron is never called more than once a minute. So, if your cron runs every 10 minutes, you may not get notifications for more than 41 minutes. Unless you adjust for this, it may make testing difficult.

We can leave it up to our BDFL to decide on the wording issue, although I recommend that it be called "Send notification email" with the initial default to true for those transitioning from previous versions.


Petr Skoda added a comment - 21/Feb/08 07:34 PM
thanks Gary a lot, the label change is pretty trivial - I will leave this decision to MD

Petr Skoda added a comment - 21/Feb/08 07:34 PM
eh, we could even make it configurable in module settings

Anthony Borrow added a comment - 25/Feb/08 05:06 PM
Petr,

It looks like made this a module setting. I think ideally it should be per assignment (which puts it in the hands of the teacher). A module setting could determine the default. For now, making it a site wide module setting for the admin to decide may be good and improvements can be develop from there.

Looking at the patch, my only comment is a small disclaimer that perhaps we may want to include in the /lang/en_utf8/help/assignment/emailnotification.html file. Emails will only be sent to students with enabled email accounts. The control remains in the hands of the student. I just don't want folks thinking that it is actually sending emails to everyone. If the student disables email then it will not be sent and I think that should be clear in the help file so I reworded the text a little below:

Also, notify was spelled with an f - nofify in the patch file.

<p>Do you want to notify students with an enabled email address about assignment grades and feedback via email?</p>


Petr Skoda added a comment - 25/Feb/08 05:27 PM - edited
the code is already in cvs, the patch is outdated

Anthony Borrow added a comment - 25/Feb/08 05:34 PM
Petr - Ah, I didn't see the commits. In CVS, there is a typo - notify was spelled with an f (nofify).

Do you think we need the disclaimer to avoid confusion?

<p>Do you want to notify students with an enabled email address about assignment grades and feedback via email?</p>


Petr Skoda added a comment - 25/Feb/08 05:38 PM
The nofify typo is not there anymore, in fact the whole file was replaced.
I do not think we need the disclaimer now, though assignment should be imho rewritten a bit in 2.0

Ray Lawrence added a comment - 25/Feb/08 11:33 PM
+ 1 for this being a module setting.

The current option could really do with being on the quick grading page too.

Suggest update the label to "Disable feedback/grade notification emails" so that it's clear to teachers which email this relates to.


Martin Dougiamas added a comment - 26/Feb/08 10:43 PM
Sorry, but I think this setting under the feedback textbox would be better reversed to the positive as:

Send a notification message about my feedback

(As a rule we should always try and avoid "Disable X" settings)


Gary Anderson added a comment - 26/Feb/08 10:51 PM
Martin: I, of course agree. My only suggestion is that we use the original wording of my patch which was : "Send notification email". That has worked very well for us.

Petr Skoda added a comment - 27/Feb/08 04:31 AM
Added $string['enableemailnotification'] = 'Send feedback/grade notification emails';
  • email send when either email of grade changed
  • emails plural - general preference which applies to grading, looks better on quick grading imho because many emails my be sent after clicking "Save all my feedback"

Martin, please reopen or fix the lang files if you do not like it

Thanks everybody for all feedback, testing, patches and cooperation in general!


Martin Dougiamas added a comment - 27/Feb/08 02:09 PM
I fixed up some of the text and renamed the helpfile. Looking good, thanks!