Moodle

Conditional Activites - add time to date restriction criteria

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Component/s: Conditional activities
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE

Description

It would be very useful to add a time field to the 'Only available from' and 'Only available until' date restriction criteria - similar to the Asssignment activity's 'Available from' and 'Due date' fields.

  1. MDL17925.patch
    01/Oct/09 1:56 PM
    3 kB
    Tim Lock
  2. patch.txt
    18/Jul/09 8:58 PM
    2 kB
    James Strong

Issue Links

Activity

Hide
James Strong added a comment -

Hi Sam,

See attached patch to implement this improvement. I remove the forced setting of availableuntil to 23:59:59 as this would override any time entered through the form.

Also, function show_time in lib/conditionlib.php probably doesn't need to do a check for whether to display a date or full date and time as the latter should always be displayed.

What do you think? This patch is mostly minor form and date display changes - the underlying implementation already supports time, so hopefully it's worth doing.

Cheers,
James

Show
James Strong added a comment - Hi Sam, See attached patch to implement this improvement. I remove the forced setting of availableuntil to 23:59:59 as this would override any time entered through the form. Also, function show_time in lib/conditionlib.php probably doesn't need to do a check for whether to display a date or full date and time as the latter should always be displayed. What do you think? This patch is mostly minor form and date display changes - the underlying implementation already supports time, so hopefully it's worth doing. Cheers, James
Hide
Sam Marshall added a comment -

Hi - thanks for your contribution.

I thought about this previously (and experimented with it), but am not at all sure about it and previously decided against.

In our institution we only ever use this feature based on days. I presume other places would do the same, if only for simplicity.

The problem with supporting times is that it makes it worse for people who only use days.

1) it's possible to incorrectly set a 'deadline' / close date - if your deadline is the 24th say, you might set the deadline to the 24th. In fact, you need to choose the 25th at 00:00.

I considered solving this by making the default time 23:59:59 , so that you still only had to select the day you actually wanted, and the time would already be set for you. Unfortunately it is not possible to set 23:59:59 with the time/date selector! So that idea went out the window.

2) we want to reduce screen clutter and keep things simple for students - so when these dates are displayed, it only displays a date and not a time.

(there is already complicated logic so that it will do this and still show times in different timezones, however this would need changing for your proposal, so that a deadline of 25th at 00:00:00 displays as the 24th with no time).

These problems are obviously not insurmountable but I kind of still don't like the idea of people having to select the 25th when they mean the 24th.

It would be different if the time part of the date selector offered an 'end of this day' option (allowing users to choose 23:59:59 without having to explicitly say so). So another possibility would be to add this option to the time selector dropdown. That might actually not be too hard...

I think this should maybe be discussed more widely to discuss what's best, e.g. can I add that option to the time selector or will it just confuse people, etc. Do you want to start a forum discussion or shall I?

Show
Sam Marshall added a comment - Hi - thanks for your contribution. I thought about this previously (and experimented with it), but am not at all sure about it and previously decided against. In our institution we only ever use this feature based on days. I presume other places would do the same, if only for simplicity. The problem with supporting times is that it makes it worse for people who only use days. 1) it's possible to incorrectly set a 'deadline' / close date - if your deadline is the 24th say, you might set the deadline to the 24th. In fact, you need to choose the 25th at 00:00. I considered solving this by making the default time 23:59:59 , so that you still only had to select the day you actually wanted, and the time would already be set for you. Unfortunately it is not possible to set 23:59:59 with the time/date selector! So that idea went out the window. 2) we want to reduce screen clutter and keep things simple for students - so when these dates are displayed, it only displays a date and not a time. (there is already complicated logic so that it will do this and still show times in different timezones, however this would need changing for your proposal, so that a deadline of 25th at 00:00:00 displays as the 24th with no time). These problems are obviously not insurmountable but I kind of still don't like the idea of people having to select the 25th when they mean the 24th. It would be different if the time part of the date selector offered an 'end of this day' option (allowing users to choose 23:59:59 without having to explicitly say so). So another possibility would be to add this option to the time selector dropdown. That might actually not be too hard... I think this should maybe be discussed more widely to discuss what's best, e.g. can I add that option to the time selector or will it just confuse people, etc. Do you want to start a forum discussion or shall I?
Hide
James Strong added a comment -

Hi Sam,

Thanks for reply and your good thoughts on this. The issue of the time selector dropdown you mention would be great to address to save confusion for all the areas it's used - e.g. assignment due date. One approach I've seen is to have a 'midnight' option in the dropdown which effectively sets to 23:59:59 - but the date time selector in Moodle has fields for each of hour and day so not so easy to add it in there - an advantage of having it in the dropdown is that by placing it after 23 it's clear it's not at the start of the day.

Re a forum discussion - sound good to me - where do you think would be best? If it's to discuss modification of the date time selector then I guess it's not strictly related to conditional activities. Happy for you to start this in the appropriate forum.

Show
James Strong added a comment - Hi Sam, Thanks for reply and your good thoughts on this. The issue of the time selector dropdown you mention would be great to address to save confusion for all the areas it's used - e.g. assignment due date. One approach I've seen is to have a 'midnight' option in the dropdown which effectively sets to 23:59:59 - but the date time selector in Moodle has fields for each of hour and day so not so easy to add it in there - an advantage of having it in the dropdown is that by placing it after 23 it's clear it's not at the start of the day. Re a forum discussion - sound good to me - where do you think would be best? If it's to discuss modification of the date time selector then I guess it's not strictly related to conditional activities. Happy for you to start this in the appropriate forum.
Hide
Tim Lock added a comment -

I have modified your patch James to work on Build: 20090928.

Such an convenient patch, just need midnight in the Date Time Selector list!

Show
Tim Lock added a comment - I have modified your patch James to work on Build: 20090928. Such an convenient patch, just need midnight in the Date Time Selector list!

People

Vote (9)
Watch (4)

Dates

  • Created:
    Updated: