Thank you very much for working on this. As you can see from the number of votes on MDL-16478, a lot of people want this. Also, since your post in the general developer forum, I have seen two posts in the quiz forum asking for this.
Some code review comments:
(I wrote these in one order as a reviewed the code, the re-ordered them to put the more important ones first. I hope that does not make it incomprehensible.)
0. Generally it looks very good. (As you can tell from the very picky nature of most of the comments below.)
1. In the database, the userid and groupid columns should be nullable, and they should be foreign keys.
2. Also, I think that timeopen, etc. should be nullable, so you can distinguish between allowing a user to attempt the quiz with no close date or time limit (value 0) from not overriding the default (value null).
3. I have previously seen feature requests to have different passwords per-group. You might like to include that, but one of the nice things about your work is that it is easy to extend in future.
4. I don't like a single, multi-modal override.php script. It would be cleaner to have three short scripts overrides.php for the list. overrideedit.php for add/edit, and overridedelete.php for the delete confirmation and action.
5. I see you have coped with users in multiple groups by taking the most permissive overrides. That seems sensible to me.
6. In attemptlib.php. Is it really necessary to have a separate protected $override; ? Why not just overwrite the default values in $this->quiz with the appropriate overridden values. Wouldn't that simplify things? For example, it would no longer be necessary to make so many changes to accessrules.php (although, arguably the changes you made to use methods on quizobj rather than directly accessing $quiz are good - I just wonder if it really helps to have the word effective_ everywhere.
7. I don't like big long if statements like if (!$override) { in quiz_compute_effective_override. See http://www.refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html. To do that here, you probably need to break the big function into some smaller ones, which would be a good idea anyway.
8. You should not concatenate language string like
$overridename .= ' - '.groups_get_group_name($groupid).' ';
That does not work for languages that use a different word order. The correct approach is to make another language string with $a->thing placeholders that get subsituted by the bits.
9. In Moodle 2.0, you don't need code like
{code}
if ($events = $DB->get_records('event', array('modulename'=>'quiz', 'instance'=>$quiz->id, 'groupid'=>$groupid, 'userid'=>$userid))) {
foreach($events as $event) {
{code}
any more. Instead you can just do
$events = $DB->get_records('event', array('modulename'=>'quiz', 'instance'=>$quiz->id, 'groupid'=>$groupid, 'userid'=>$userid));
foreach($events as $event) {{code}}
since get_records throws an exception on error, and returns an empty array if no records are found.
10. I don't see any point in @global object PHP doc tags. They say nothing. It would be nice (but not essential, if you could delete them.) You also have some incomplete PHP doc comments, like @return bool with no description of what the bool means. Again, nice if you can fix those.
11. Again being picky, but I feel that quiz_compute_effective_override is not the best name for this function. What you are actually computing is the effective access settings.
12. Personally, I hate the ? : operator, and the Moodle coding style guidelines recommends against it. However, again I don't insist on you making the change.
Once again, this is very good quality code. I would like to get this into Moodle 2.0. I am not sure how much time I will have to contribute to that, but I will try my best, if you can address some of the above issues.
Can I suggest that we move future patches/discussion to MDL-16478, since that is actually the bug about implementing this in the quiz. This bug is about the Assignment module. Thanks.
Allowing per-group deadlines is critical for anyone who uses the same course to teach more than one group on slightly different timetables. Without it, the deadlines data in the gradebook is severey limited. I would imagine this applies to almost every school teacher using Moodle, so it's a big deal.