Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Need to implement open/close date functionality
Comment | File | Size | Author |
---|---|---|---|
#16 | datetime.patch | 4.56 KB | gilcot |
#13 | quiz_newdate3.patch | 18.77 KB | seanbfuller |
#10 | quiz_newdate2.patch | 16.44 KB | seanbfuller |
Comments
Comment #1
webchickNeed to figure out some creative way of admins specifying a date and time on the form without them having to enter UNIX timestamps by hand. :P Will take a look to see how other modules achieve this.
Comment #2
webchickJust bumping this one so I don't forget.
Comment #3
webchickAnd actually, looks like event module would be a swell place to look for inspiration.
Comment #4
seanbfuller CreditAttribution: seanbfuller commentedChanged to a bug report as there is functionality here that currently does not work correctly. Things to fix:
Comment #5
webchickLet's also add to that that it should be optional to create a start/end date.
So if the dates can default to not filled, or there's a checkbox to say "limit test taking to the following" that's fine. It's kind of silly the way it is now with being _forced_ to dictate a start and end date.
Comment #6
nicholasThompson+1 for optional date range
Comment #7
seanbfuller CreditAttribution: seanbfuller commentedI have code that I think will work for all of this, but I'm currently suffering from trying to keep all these patches in the queue straight. I'll try to get my code fixed tomorrow.
Comment #8
ChrisKennedy CreditAttribution: ChrisKennedy commentedSubscribing. We've been thinking about this same issue for the Decisions module, so I would be interested in potentially using whatever solution you guys come up with.
Comment #9
seanbfuller CreditAttribution: seanbfuller commentedThis patch does the following:
I'll admit that the include is not ideal, but until drupal has better timezone calculation and dst support in core, I think it's the best we are going to do short of requiring that event.module be installed.
In the context of a global classroom environment, it seems important to take into account the user’s timezone for purposes of determining when a quiz is no longer available. Re-reading the comments above, I noticed that webchick mentioned being able to set a time on the quiz, as well. The current timezone functions should be able to handle this, but a few tweaks to it and the form would be required. Ideally, a core function called something like form_timestamp() would available in the future. (I’m not sure if there is a 5.0 function along these lines.)
If anyone has a better idea on handling this or suggestions, I’m all ears.
(Chris: Not sure if this would end up working for you or not.)
Comment #10
seanbfuller CreditAttribution: seanbfuller commentedLooks like I lost my patch from the previous post. Here it is.
Comment #11
seanbfuller CreditAttribution: seanbfuller commentedReviewing the patch, it looks like I missed a call to NOW(). I'm going to double check everything and possiblly put up a new patch tomorrow.
Comment #12
gilcot CreditAttribution: gilcot commentednot following all the issue will make me lost!
two month earlier (webchick @ http://drupal.org/node/73607 )
and now you are back to INT ? :-/
+1 for optional start/end date : it's a great thing imho
About TZ, Sean B Fuller noticed :
But i can remember that my Drupal users can set their TZ in a "Locale settings" from their profile, while the server (global) TZ is set via the configuration section (admin settings or something like that). I think core use the functionality (every user has time displayed according to it's timezone and his prefered format -not sure for the format, maybe it's global) for comments and for fora posts. note sure, but i'll put a look into those files. maybe webchick can suggest some place to look for that information ? he knows documentation better than us (i presume)
btw good job everybody. and think event module use the same tricks... i'll test the patch this w-e if i have some few time.
Comment #13
seanbfuller CreditAttribution: seanbfuller commentedUpdates version. I fixed one of the calls to NOW() that I had missed and replaced it with a call to time(). I also realized a few errors in my time, date and time zone calculations, so everything should be working now.
One thing I added was a message on the node_view for students that gives feedback on the availability of the quiz. If it is set to always, there is no feedback. If the quiz is not open yet, going to close, or closed, the student gets that message.
This was done because quizzes are set to close at midnight for the quiz author. For example, a teacher in GMT -5 sets a quiz to close on January 25th. The system sets a timestamp for that user based on midnight in GMT -5. A student in London (GMT 0) will get feedback that the quiz closes at 5:00 in the morning that day.
Please note that as DST is not accounted for in core, DST is not accounted for here. This is a dupal-wide issue that seems out of scope for this patch.
Everything seems to be working great now.
Comment #14
seanbfuller CreditAttribution: seanbfuller commentedCommitted to HEAD.
Comment #15
(not verified) CreditAttribution: commentedComment #16
gilcot CreditAttribution: gilcot commentedoffset is set to zero! should not :(
Comment #17
gilcot CreditAttribution: gilcot commentedjust another idea: do not only shout error when close date ealier than open date; swap them..