Why does my journal close @ 11pm now?

Why does my journal close @ 11pm now?

by Barron Koralesky -
Number of replies: 6

The journal used to close at midnight, however now it closes at 11pm.  My server time is correct and I set the moodle timezone variable to "Server's local time".

Any clues?  Thanks!

P.S.  When will the new assignment module (with the journal inside of it) come out?
Average of ratings: -
In reply to Barron Koralesky

Re: Why does my journal close @ 11pm now?

by Erlyn Baack -

Hi Barron,

I had a similar problem because of the recent time change where I live. Changing the admin variables wasn't enough.  It was necessary to edit the time in the personal profiles as well.  With both those adjustments, the time shows correctly again.

In reply to Erlyn Baack

Re: Why does my journal close @ 11pm now?

by Barron Koralesky -
hmmm...  Did you have to set them both to time relative to GMT?

Right now I set them both to "server's local time" and saved them to no avail.

This happened right after the time change, but I think a restart of Apache solved it.  However, this time I can't get rid of the 11pm rather than midnight submission issue.


In reply to Barron Koralesky

Re: Why does my journal close @ 11pm now?

by Erlyn Baack -
I set mine relative to GMT, both in the admin area and the personal profile area.  Changing only the admin area doesn't work for me.  I've not tried the server's local time.
In reply to Erlyn Baack

Re: Why does my journal close @ 11pm now?

by Barron Koralesky -

That seems like a pretty odd to me...  Does that mean that every student needs to change their time settings in their profile in order to see the time correctly?


In reply to Barron Koralesky

Re: Why does my journal close @ 11pm now?

by Erlyn Baack -
Sorry, I'm in over my head on this one except to say I couldn't get "teacher time" to show correctly until I adjusted both admin and personal profile.  There must be a better way of doing it, but that worked for me.  Even after that though, a student told me her time was one hour off.  I never looked into it after that as our class closes a week from tomorrow, and there are no quiz due dates that will be affected.  Some more experienced user should know for sure as I sure don't.  black eye
In reply to Erlyn Baack

Re: Why does my journal close @ 11pm now?

by Chris Myers -
I was able to override this by forcing the system and the end-users to be just in GMT-5. The thing is, that's not correct, so other times will be off by an hour.

It looks like the reason for this is because the finish time is hard-coded to be the start time plus (number of days x 24 hours) - so the timezone change won't take the extra hour (or conversely, the less hour when the timezones flip the other way) into account. There isn't an easy way around this, and would require a total recode of the Journal function, which I'm not capable of undertaking.

However, I was able to build a hack for the code (note that it is not a "pretty" hack.) Basically, I grab the "end time" of the journal and see if that time is 11:00 PM. If it is, then I add 1 hour to the end time, so Moodle will see the new "time" of midnight. Likewise, if the end time is 1:00 AM, it will subtract an hour. I'll post this code change below; we're running Moodle 1.9.x.

CAVEAT: I don't know if this will break other journal stuff or not, we'll have to find out. If it does, let me know and I'll look into it.

Chris


Edit /mod/journal/view.php, look for the code that says:
if ($journal->days) {
$timefinish = $timestart + (3600 * 24 * $journal->days);

(around line 60.) After this code, add the following lines of code:
$finish = userdate($timefinish);
if (strstr($finish,"11:00 PM")) {
$timefinish = $timefinish + 3600;
} else if (strstr($finish,"1:00 AM")) {
$timefinish = $timefinish - 3600;
}