Here's a patch which implements the available/viewable dates for 1.9 and should work on 1.8 too. To apply it:
patch -p0 < moodle19_data_dates.patch
The dates have been implemented like this:
- "Viewable" dates control when the entire activity can be viewed. If a user tries to access the activity outside of the viewable date range, they will get a message displaying the viewable from/to dates and will not be able to view or add/edit records.
- "Available for submission" dates control when records can be added/edited. If the database is accessed when it is not available, records can be viewed and comments can be made, but no adds/edits are permitted.
Note: This patch adds an if() block around some existing code but doesn't indent it, in order to keep the patch file simple and not add a big block of indented lines. If someone wants to commit this, the indentation should be fixed up.