Details

    • Type: New Feature
    • Status: Waiting for peer review
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.9.8, 2.6.3, 2.7, 2.9
    • Fix Version/s: BACKEND
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide
      • Go to the page where you create a new course
      • See that there is an option to set end date
      • Try to create a course with end date before start date and see that it fails with error message
      • Try to create a course with end date after start date and see that it succeds
      • Try to create a course without end date and make sure it is possible
      • Backup and restore the course and see that end date are handled properly (should be respective to the new startdate)
      • Restore course from the backup made in previous version of moodle and make sure end date on the restored course is empty
      • Restore course with end date into another course and make sure the end date of the target course has not changed
      • Create csv file to use with upload courses tool and include enddate there, make sure it was respected
      • Make sure the default value for enddate in upload courses tool also works
      Show
      Go to the page where you create a new course See that there is an option to set end date Try to create a course with end date before start date and see that it fails with error message Try to create a course with end date after start date and see that it succeds Try to create a course without end date and make sure it is possible Backup and restore the course and see that end date are handled properly (should be respective to the new startdate) Restore course from the backup made in previous version of moodle and make sure end date on the restored course is empty Restore course with end date into another course and make sure the end date of the target course has not changed Create csv file to use with upload courses tool and include enddate there, make sure it was respected Make sure the default value for enddate in upload courses tool also works
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Create a Course End Date Value that when using the Weekly Format of a course, you can have the last week end sooner than a whole week. Example a 3 week course that starts on Jan 1, but ends of Jan 20, not Jan 21 which is what the weekly format will show.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            bfriesen B. Friesen added a comment -

            I'm definitely interested in a course end date. Not necessarily for this reason, but just for the sake of being able to identify courses that are over and should be closed.

            Show
            bfriesen B. Friesen added a comment - I'm definitely interested in a course end date. Not necessarily for this reason, but just for the sake of being able to identify courses that are over and should be closed.
            Hide
            lulrich Lorenz Ulrich added a comment -

            My +1 for this feature request for the same reason as B. Friesen. With a set end date it's much easier to do a date-based cleanup of courses.

            Show
            lulrich Lorenz Ulrich added a comment - My +1 for this feature request for the same reason as B. Friesen. With a set end date it's much easier to do a date-based cleanup of courses.
            Hide
            mileginy Mei Ling added a comment -

            why this new feature no more update and develop? Will it be included in version 2.6 route map ?

            Show
            mileginy Mei Ling added a comment - why this new feature no more update and develop? Will it be included in version 2.6 route map ?
            Hide
            georgi.samaras Georgi Samaras added a comment -

            I'm with B. Friesen and Lorenz Ulrich as well in that I'd like to see an End Date value to assist in upkeep regarding course closures.

            Show
            georgi.samaras Georgi Samaras added a comment - I'm with B. Friesen and Lorenz Ulrich as well in that I'd like to see an End Date value to assist in upkeep regarding course closures.
            Hide
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment -

            I would be interesting to add the end course date field to add advanced administration features.
            The cron can trigger an event that can be used by different modules like enrolment modules and local.

            Some actions can be done with that event:

            • Notify students that the course has ended
            • Syncronization with external databases (with grades)
            • Hide the course or make it not visible to students.
            • Clean up logs
            Show
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - I would be interesting to add the end course date field to add advanced administration features. The cron can trigger an event that can be used by different modules like enrolment modules and local. Some actions can be done with that event: Notify students that the course has ended Syncronization with external databases (with grades) Hide the course or make it not visible to students. Clean up logs
            Hide
            marina Marina Glancy added a comment -

            In my opinion this can be resolved by introducing custom course fields (MDL-18319) plus some custom plugin that runs cron to check for the ending courses and executes the necessary actions.

            Show
            marina Marina Glancy added a comment - In my opinion this can be resolved by introducing custom course fields ( MDL-18319 ) plus some custom plugin that runs cron to check for the ending courses and executes the necessary actions.
            Hide
            bfriesen B. Friesen added a comment -

            I'd love to see some movement on this. There doesn't seem to be much happening with MDL-18319, either.

            I still don't understand why something so obvious to me (and a few others) as an end date isn't included by default. There has to be some logic that I'm missing, here.

            Show
            bfriesen B. Friesen added a comment - I'd love to see some movement on this. There doesn't seem to be much happening with MDL-18319 , either. I still don't understand why something so obvious to me (and a few others) as an end date isn't included by default. There has to be some logic that I'm missing, here.
            Hide
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - - edited

            I've started working on that, but I don't have so much time.
            https://github.com/crazyserver/moodle/compare/MDL-22078_master

            Show
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - - edited I've started working on that, but I don't have so much time. https://github.com/crazyserver/moodle/compare/MDL-22078_master
            Hide
            marina Marina Glancy added a comment -

            Hi Pau, thanks for working on it. Just to notice that any new field in course table should be included in backup/restore process, web services, course create/update functions, and so on.

            Show
            marina Marina Glancy added a comment - Hi Pau, thanks for working on it. Just to notice that any new field in course table should be included in backup/restore process, web services, course create/update functions, and so on.
            Hide
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment -

            Yes, thank you!

            Show
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - Yes, thank you!
            Hide
            danielneis Daniel Neis added a comment -

            Hello,

            here is a patch to add this to course table as we already have start date,
            it seems that for "completeness" we can have end date.

            As custom course fields are too much complicated and not adopted yet,
            this is a simple version that might help people with reports and so.

            Hope that you like.

            Kind regards,
            Daniel

            Show
            danielneis Daniel Neis added a comment - Hello, here is a patch to add this to course table as we already have start date, it seems that for "completeness" we can have end date. As custom course fields are too much complicated and not adopted yet, this is a simple version that might help people with reports and so. Hope that you like. Kind regards, Daniel
            Hide
            cibot CiBoT added a comment -
            Show
            cibot CiBoT added a comment - Fails against automated checks. Checked MDL-22078 using repository: https://github.com/danielneis/moodle master (2 errors / 1 warnings) [branch: MDL-22078 | CI Job ] phplint (0/0) , php (2/1) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , More information about this report
            Hide
            danielneis Daniel Neis added a comment -

            Have fixed cibot warnings and errors.

            Show
            danielneis Daniel Neis added a comment - Have fixed cibot warnings and errors.
            Hide
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment -

            Sounds great Daniel Neis!!

            I would add a handler to cron that, when reaching the enddate it triggers the event and modules can use it to work over that.

            Thanks!!!

            Show
            pferre22 Pau Ferrer Ocaña (crazyserver) added a comment - Sounds great Daniel Neis !! I would add a handler to cron that, when reaching the enddate it triggers the event and modules can use it to work over that. Thanks!!!
            Hide
            marina Marina Glancy added a comment -

            Re last comment from Pau - let's do it in a separate issue that is blocked by this one. As well as making weeks format respect the end date. At the moment this field does not make any visible changes to the UI but it's a good start.

            Daniel, your code looks pretty good in general, this is not yet a complete peer review yet but I noticed that you have added a folder course/format/onetopic which is unrelated (and breaks a lot as well because moodle is looking for plugin there).

            Also unittests fail in tool_uploadcourse, which reminded me that the end date is not supported there.

            But the failure itself indicates another problem: if course is restored from backup that DOES NOT contain enddate (backup made before upgrade) - there is a warning.

            I guess you have not run unittests or behat tests on your branch but I will recommend you to do it to make sure that nothing else pops up.

            TIA

            Show
            marina Marina Glancy added a comment - Re last comment from Pau - let's do it in a separate issue that is blocked by this one. As well as making weeks format respect the end date. At the moment this field does not make any visible changes to the UI but it's a good start. Daniel, your code looks pretty good in general, this is not yet a complete peer review yet but I noticed that you have added a folder course/format/onetopic which is unrelated (and breaks a lot as well because moodle is looking for plugin there). Also unittests fail in tool_uploadcourse, which reminded me that the end date is not supported there. But the failure itself indicates another problem: if course is restored from backup that DOES NOT contain enddate (backup made before upgrade) - there is a warning. I guess you have not run unittests or behat tests on your branch but I will recommend you to do it to make sure that nothing else pops up. TIA
            Hide
            marina Marina Glancy added a comment -

            Daniel, please add enddate in some unittests assertions, for example in tool_uploadcourse_course_testcase and core_course_courselib_testcase
            you don't need to create new tests, just add enddate to one of existing ones

            Show
            marina Marina Glancy added a comment - Daniel, please add enddate in some unittests assertions, for example in tool_uploadcourse_course_testcase and core_course_courselib_testcase you don't need to create new tests, just add enddate to one of existing ones
            Hide
            danielneis Daniel Neis added a comment -

            Hello, Marina

            thanks for your review! =)

            I agree that is just a simple start and it sould be. Let's handle another uses of this field in other issues =)

            Sorry for the onetopic formato, just removed that.

            I've added the enddate support to upload course tool.

            Also added some enddate related assertions to admin/tool/uploadcourse/tests/course_test.php and course/tests/externallib_test.php

            I did not found any mention to startdate on core_course_courselib_testcase so i've not added enddate there.

            I will fix the restore when when there is no enddate on backup file and let you know.

            Another thing that I was thinking about is that we are using date_selector to start and enddates.
            It would be better to have datetime_selector like MDL-42842, MDL-41173, MDL-42844 and so.
            We could use this issue to solve that, must not be much work.

            Kind regards,
            Daniel

            Show
            danielneis Daniel Neis added a comment - Hello, Marina thanks for your review! =) I agree that is just a simple start and it sould be. Let's handle another uses of this field in other issues =) Sorry for the onetopic formato, just removed that. I've added the enddate support to upload course tool. Also added some enddate related assertions to admin/tool/uploadcourse/tests/course_test.php and course/tests/externallib_test.php I did not found any mention to startdate on core_course_courselib_testcase so i've not added enddate there. I will fix the restore when when there is no enddate on backup file and let you know. Another thing that I was thinking about is that we are using date_selector to start and enddates. It would be better to have datetime_selector like MDL-42842 , MDL-41173 , MDL-42844 and so. We could use this issue to solve that, must not be much work. Kind regards, Daniel
            Hide
            cibot CiBoT added a comment -
            Show
            cibot CiBoT added a comment - Fails against automated checks. Checked MDL-22078 using repository: https://github.com/danielneis/moodle master (2 errors / 2 warnings) [branch: MDL-22078 | CI Job ] phplint (0/0) , php (2/2) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , More information about this report
            Hide
            danielneis Daniel Neis added a comment - - edited

            Hello,

            I've fixed the restore with no enddate on backup file, and also made the field optional.

            Let me know if there is anything missing and if I should change the date_selector to date_time_selector.

            Kind regards,
            Daniel

            Show
            danielneis Daniel Neis added a comment - - edited Hello, I've fixed the restore with no enddate on backup file, and also made the field optional. Let me know if there is anything missing and if I should change the date_selector to date_time_selector. Kind regards, Daniel
            Hide
            cibot CiBoT added a comment -
            Show
            cibot CiBoT added a comment - Fails against automated checks. Checked MDL-22078 using repository: https://github.com/danielneis/moodle master (1 errors / 0 warnings) [branch: MDL-22078 | CI Job ] phplint (0/0) , php (0/0) , js (0/0) , css (0/0) , phpdoc (1/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , More information about this report
            Hide
            marina Marina Glancy added a comment -

            Thanks Daniel, either me or somebody else from hq will do a proper review soon.

            There is an issue about time in course start date - MDL-43648 , feel free to implement it under this ticket and we will close MDL-43648 when it's integrated.

            Show
            marina Marina Glancy added a comment - Thanks Daniel, either me or somebody else from hq will do a proper review soon. There is an issue about time in course start date - MDL-43648 , feel free to implement it under this ticket and we will close MDL-43648 when it's integrated.
            Hide
            marina Marina Glancy added a comment -

            uh-oh, Mark's in the hospital, I will assign it for peer review to somebody else shortly. Sorry for the delay!

            Show
            marina Marina Glancy added a comment - uh-oh, Mark's in the hospital, I will assign it for peer review to somebody else shortly. Sorry for the delay!

              People

              • Votes:
                13 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated: