Moodle plugins directory: Restriction by relative date | Moodle.org
Restriction by relative date
Availability restriction ::: availability_relativedate
Maintained by Renaat Debleu
Restrict module and section access based on a relative date.
Latest release:
1458 sites
665 downloads
52 fans
Current versions available: 6
Relative dates are experimental since Moodle 3.8 but are only implemented in the Assignment activity and the Weekly course format. If you want to use relative dates in other parts of a course, you can use this plugin.
This availability condition makes it easy to show modules or sections only x minutes/hours/days/weeks/months
- before/after course start date
- before/after course end date
- after user enrolment date
- after enrolment method end date
- after the completion of an activity
Using Restriction sets, it is easy to make a resource available for a limited relative time.
Check the global documentation about availability conditions : https://docs.moodle.org/en/Conditional_activities_settings
Installation:
- Unpack the zip file into the availability/condition/ directory. A new directory will be created called relativedate.
- Go to Site administration > Notifications to complete the plugin installation.
Useful links
Contributors
Renaat Debleu (Lead maintainer)
Please login to view contributors details and/or to contact them
The functionality you used was reported as a bug in one of our projects, so the plugin was updated to take the most recent enrollment as a starting point. Luckily this project is Open Source, so you can create a fork and modify line 222 of the classes/condition.php file to "restore" this bug.
R
Thanks for your plugin!
Teachers in my university ask me the following question... Could relative dates be linked to completion of another activity?
Regards
THX for the feedback. You mean something like 3 days after completing quiz 4?
Technically this seems possible to me. Although a lot of work would be needed to implement a cache for performance reasons.
But for the moment I do not see a lot of extra value in this link to completion of another activity. Completing an activity would become more a punishment than a achievement....
Can you provide some samples where this extra restriction could be used in a way students are encouraged instead of discouraged?
Of course, currently you can already combine restrictions: Quiz 4 is completed AND 4 weeks after course start date.
R
Did you try to use the "must not" setting? If I have a one year course, and I add an activity with the restriction: Student "must not" match the following "50 weeks after course start date", then students will be able to access the activity for 50 weeks, and the last 2 weeks the module will be restricted.
R
I think that the setting that you suggest would work only for fixed duration courses. It may seem odd, but in my university, the course duration varies from semester to semester. It generally is between 15 and 17 weeks. Due to the pandemic, this semester we have only 11 weeks. This is why I am looking for a restriction setting that is relative to the course end date.
Please let me know if I have not been clear in my explanation.
This plugin already restricts on course enddate, But there has to be a course enddate, otherwise the module would never be available (0 minus 3 days = ∞ - 3 = ∞). Therefore the enddate condition is not even shown to teachers if the course end date is not set. So when you set a course end date, you can add a "2 days before course end date" condition.
Is the moodlecourse | courseenddateenabled global configuaration setting enabled in your Moodle?
R
I have been able to achieve my goal by following your advice (using the "must not" setting). I initially got confused because of the message that appears below the section heading:
Not available unless:
From 5 July 2021, 12:00 (2 weeks after the course start date)
From 29 August 2021, 11:59 (1 week before the course end date)
Note that this section is available from the second week on till the penultimate course week. I think that I was expecting a message such as follows:
Not available unless:
From 5 July 2021, 12:00 (2 weeks after the course start date)
Until 29 August 2021, 11:59 (1 week before the course end date)
I am not sure if there is anything that you could do to improve this.
Awsome plugin!
How to add more than "51" in the select field. I need to go beyond 51 days in some cases.
Thank you
this seams to be exactly what i was looking for!
I have one question though, is it possible to add the Option
Make available after X days, since an other activity was availale?
I wanted to have an option, where I have dependencies not from the Start Date but regarding an activity. As an Example:
Acitity A is active beginning on the 12.March.
Activity B is activer 7 days, after activity A.
Thanks
Your idea seems nice, but very complex. What do you mean by "is active beginning"? Because of some date setting - the visibility - an availabitlity restriction changed? If you add a user to another group, can also be a reason why someone sees other resources.
Currently the plugin calculates course level dates, adding a calcullation on module level to pinpoint this 'active' date for every module will do no good for the performanc.
R