I had been having trouble with the date selector not showing the entire range of dates. It was only showing today and "all". Looking at the code, I realized what the problem was. I have the course set to start on September 1, and when the date range is generated, it tests for whether the current date is greater than the start date:
(in moodle/course/lib.php)
while ($timemidnight > $course->startdate and $numdates < 365)
I had to set the startdate on 1 September since that is when the official coursework begins and the dates on the "weekly format" need to reflect that, but for two weeks prior to that I have been getting the students to sign up, upload their pictures and give their introductions. I thus would like the log to work "properly" even before the course begins.
This code exists just for cases when the startdate hasn't been established:
if (! $course->startdate) {
$course->startdate = $course->timecreated;
}
Could this condition also be added for cases such as mine?
if (! $course->startdate < $today) {
$course->startdate = $course->timecreated;
}
--Tom
Done:
if (!$course->startdate or ($course->startdate > $timenow)) {
$course->startdate = $course->timecreated;
}
if (!$course->startdate or ($course->startdate > $timenow)) {
$course->startdate = $course->timecreated;
}
Thanks, Martin!