ewallah / moodle-availability_relativedate

Relative dates in Moodle
https://moodle.org/plugins/availability_relativedate
GNU General Public License v3.0
8 stars 7 forks source link

Does not take the student's enrollment date in Moodle 3.9.2+ #10

Closed dmata47 closed 3 years ago

dmata47 commented 4 years ago

Hi. Install the latest version of the 3.8+ plugin (2020110200) in Moodle 3.9.2+, it does not take the relative dates from when the student enrolled in the course, but since the plugin was updated or by the server date. Can you help me with this please.

ewallah commented 4 years ago

Hello dmata47,

the date you see is the date relative to your enrolment. For a student it will be different. Did you try the to enrol as a student to see his/her relative dates? Do not use the role change as this will keep on showing dates relative to your enrolment, you have to log in using another account.

R

dmata47 commented 4 years ago

Hello ewallah. Thanks for answering.

If you enter as a student logged in with your credentials (without changing the role) and you are not taking the relative date.

I can give you access to my test moodle as administrator so you can see it.

ewallah commented 4 years ago

Hello Dmata47,

I can only try to help solving the problem when I get a complete overview of the situation. I'm only interested in getting credentials for another site and signing another non-disclosure agreement if I am payed for a job.

What is the problem? Is the resource available when it should not be, or is the wrong reason (date) shown?

The calculation of relative dates can be very complex, as multiple enrolement plugins can be enabled with multiple instances. I have seen instances with multiple self group key enrolements, guest, manual, payment and auto enrolement enabled. So I need to know which situation you created.

R

dmata47 commented 4 years ago

Hello Ewallah, sorry for not describing the situation well, but English is not my mother tongue (I speak Spanish) and I must use google translator which does not help much.

The problem with the plugin is that when I put the students to see an activity from X number of days from the enrollment date, it does not take it, it shows the student that X number of days are missing to be able to see the activity and it never reaches that date, it is as if it is eternally updated with the date since when you see it.

In summary: even though a student has months enrolled in that course, and the activity is configured with your plugin so that they can see it (for example) 3 three days after enrollment, it will always show that there are three days left.

When I gave you the option so that you could enter my test moodle, my intention was that you could see the error for yourself, not that you sign any document for it.

It is only an empty moodle that I create to be able to recreate this error, since when migrating my Moodle from 3.7 to 3.9.2+ it affected the courses I had in it, and many students could not access their activities since they were blocked where they were restrictions with your plugin.

This bug occurs in two Moodle 3.9.2+, on two different servers.

To solve the problem, reinstall version 3.5+ (2020012800), and the restrictions worked, although it has a bug, it shows as administrator December 31, 1969 as the date from when it will be available (with the plugin restriction), although this does not affect its performance for students.

Thanks for your help.

ewallah commented 4 years ago

Hi dmata47,

Can you test the current main branch (https://github.com/ewallah/moodle-availability_relativedate/archive/main.zip)? Last question - what database are you using?

R

dmata47 commented 4 years ago

It works ewallah 👍 Although I see a bug, the administrator user (or creator of the restriction) is not shown the date from when it will be available, as if it were shown in previous versions, it only shows the text that precedes it. I leave you a screenshot: https://ibb.co/xCyzC9v

I have mariadb 10.3.24 on one server and mariadb 10.2.29 on the other.

ewallah commented 4 years ago

Hi dmata47,

THX for the update.

You could call this a bug, I can say that you ask the plugin to calculate something impossible: when an admin is not enrolled in a course, the plugin calculates 3 days before never. As far as I know, 3 days befor never is still never. This is the reason why administrators , managers and course creators do not see any date, and teachers see a date related to their enrolment. I think this is a better solution than posting a wrong day far back in the seventies (0 + 3 days) or sixties ( 0 - 2 years).

If you want dates, enrol yourself as an admin/manager/course creator with a certain start and end date set. This way you do not ask philosophical questions to simple plugin.

R

P.S. Currently I test the latest dev version. Feel free to test this version.

dmata47 commented 4 years ago

Hi Ewallah, I understand what you are saying regarding the date and you are right. I explained badly when I mentioned the date, what I meant is that it will be added in how many days the restriction was established as it was shown in previous versions, since this helps administrators to know the activities restricted by your plugin with just one view to the course. Anyway I see you added that text in this last version that you gave me, it was perfect. Is this version stable, or do I wait until you put it in the Moodle repository? Sorry for the inconvenience.

ewallah commented 3 years ago

Done