Restriction by relative date icon

Restriction by relative date

Maintained by Renaat Debleu
Restrict module and section access based on a relative date.
Price option: Free

Supports Moodle 3.5-5.2 See all versions
Latest release: 2 months ago
Installations: 2453
Downloads (last 90 days): 946

Frankenstyle name: availability_relativedate

Comments

Product ratings and reviews are coming to Moodle Marketplace. Until then, existing comments remain available to read, but new posts have been disabled.

Hello Renaat,
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.
Hello Alessandro,
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
Hello Renaat,
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.
Hello Alessandro,
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
This is a great plugin and I use it all the time. I am only missing one feature: availability until a relative date. For example, allow students to access a course activity until a given number of days before the course end date. The relative date could be the date of the final exam, when I want the students not to be able to see any of the previous activities. Currently I do this my hiding all previous activities, which is laboriuos and prone to error.
Hello Jean-Roch,
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
Hi Renaat,
Thanks for your plugin!
Teachers in my university ask me the following question... Could relative dates be linked to completion of another activity?
Regards
Hi Armin,
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
Hi Renaat. We are using your plugin in some courses where the users are enrolled via 2 enrolment methods. The restriction by date should refer to the original enrolment date, but it seems to take the latest date. Is this the way how it should work from your side or are there any plans to take the original enrolment date in a future version? Thanks a lot!
tks so much
Hi Antonio, you can change the 52 in something else, but then you need to rebuild the YUI modules before it will appear in your platform, see https://docs.moodle.org/dev/YUI
Thanks for the answer. Could you confirm for me: is it in the "moodle-availability_relativedate-form.js" file that I should edit? In this case, I must change the value 52 in the section "html + = '';
for (i = 1; i <52; i ++) {
html + = '' + i + ''; "??? Thank you, as I have urgency in this
THX Antonio for your comments,
You can change the form.js source file and rebuild the YUI modules. Or you can suggest a new number (100 - 365 - ?) in the bug tracker and wait until it is implemented for you. I opted for choices between 1 and 51 to cover 51 weeks and to make the dropdown not too long. Any suggestion is welcome.

Excellent plugin, congratulations !! How can I do to increase the number of days to more than 50, as this is the limit that can be selected in the plugin for days, weeks or months
Hi faculdadeitaqua moodle.
I had a similar problem in the version that was solved in version 3.8+ (2020111000).
Do you have that version?