Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.9.8, 2.6.3, 2.7, 2.9, 3.0.6, 3.1.2, 3.2
-
MOODLE_19_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
-
MOODLE_32_STABLE
-
MDL-22078_master -
Easy
-
Hide
Course forms & defaults
- Go to admin/settings.php?section=coursesettings, set "Course duration" to 6 months and save changes
- Set your default course format to topics
- Create a new course
- The default end date value should be startdate + 6 months
- Change the default course format in admin/settings.php?section=coursesettings to weekly
- Create a new course
- The default course end date should be startdate + (1 week for each section = numsections setting value)
- Go to an existing course without end date, end date should be disabled
- Set end date < start date and try to save changes
- The form server validation shouldn't allow you to do it
- Set the end date > start date
- You should be able to save changes
- Return to the form and check that your value is stored
- Uncheck end date and save changes
- Return to the form and check that there is no end date
Course reset
- Using this same course used above (have both course start and end dates) go to 'Course administration' -> 'Reset'
- Just press 'Reset course'
- Check the course settings, the shouldn't have changed
- Go to 'Course administration' -> 'Reset' again
- Set course end date < the course current start date and press 'Reset course'
- You should see a form validation error
- Set course end date > the start date you noted down (the course current start date) and press 'Reset course'
- The process should finish, check that the course end date was reset in the course settings page
- Go to 'Course administration' -> 'Reset' again
- Enable end date as well and set a date lower than the reset start date. Press 'Reset course'
- Expect again a validation error
- Now set end date to be > than the reset start date and press 'Reset course'
- The reset should proceed and the new start and end dates should be visible in the course settings page
- Go to 'Course administration' -> 'Reset' again
- Set both end date and start date (start date < end date) and press 'Reset course'
- The reset should proceed and the new start and end dates should be visible in the course settings page
- Note the current end date (you will need it a few steps later to check that the time shift has been applied to this end date value)
- Go to 'Course administration' -> 'Reset' again
- Set the start date, note the difference in days (or months or years) between the previous start date and the new one you set. Press 'Reset course'
- The reset should proceed and the new start date should be visible and end date should be the previous end date value + the difference between the previous start date and the new start date
Backup & restore
- Backup a 31 course with a start date (will have a start date if you create it through 'Manage courses and categories' for example)
- Restore it to master integration, go to the course settings page and check that the start date is the same than it was and there is no end date
- Restore it to master integration changing the start date, go to the course settings page and check that the start date is the one you set and there is no end date
- Backup a master integration course with start date and no end date
- Restore it to master integration, go to the course settings page and check that the start date is the same than it was and there is no end date
- Restore it to master integration changing the start date, go to the course settings page and check that the start date is the one you set and there is no end date
- Backup a master integration course with start date and end date
- Restore it to master integration, go to the course settings page and check that the start date is the same than it was and the end date is the same than it was
- Restore it to master integration changing the start date, go to the course settings page and check that the start date is the one you set and the end date has been updated according to the changed you applied to the start date (e.g. if you moved it 5 days in future end date should also be moved 5 days in future)
Web services & course API
- Call create_courses external function (you don't need to use web services, you can just call core_course_external::create_courses()) and try different startdate and enddate combinations:
- Set start date > end date -> KO
- Don't set start date, set end date -> KO
- Set start date, don't set end date -> OK
- Set start date < end date -> OK
- Call core_course_duplicate_course WS specifying a course with start and end date correctly set up (latest combination above should be ok)
- Go to the course and check that the start and end dates are the same than in the origin course
Upload courses
- Prepare a simple csv to upload a course, something like this:
- shortname,fullname,category
- uploadedcourses1,Uploaded 1,1
- Use upload course tool selecting "Create new courses, or update existing ones" as upload mode and "Update with CSV data and defaults" as update mode, move to the next form
- Check that the default end date date is after the start date (will depend on the default course format as before)
- In default course values section test the form validation, updating end date to be earlier than start date, you should see a form validation error
- Now restore end date value to be after the start date
- Press 'Upload courses', it should succeed
- Modify the csv to include a start date and an end date, for example
- shortname,fullname,category,startdate,enddate
- uploadedcourses2,Uploaded 2,1,10 June 2005,10 March 2005
- Try to upload the course, you will see a red cross in the preview result as the enddate must be after the start date
- Update the csv to set the end date after the start date and start the upload process again
- Now it should succeed
ShowCourse forms & defaults Go to admin/settings.php?section=coursesettings, set "Course duration" to 6 months and save changes Set your default course format to topics Create a new course The default end date value should be startdate + 6 months Change the default course format in admin/settings.php?section=coursesettings to weekly Create a new course The default course end date should be startdate + (1 week for each section = numsections setting value) Go to an existing course without end date, end date should be disabled Set end date < start date and try to save changes The form server validation shouldn't allow you to do it Set the end date > start date You should be able to save changes Return to the form and check that your value is stored Uncheck end date and save changes Return to the form and check that there is no end date Course reset Using this same course used above (have both course start and end dates) go to 'Course administration' -> 'Reset' Just press 'Reset course' Check the course settings, the shouldn't have changed Go to 'Course administration' -> 'Reset' again Set course end date < the course current start date and press 'Reset course' You should see a form validation error Set course end date > the start date you noted down (the course current start date) and press 'Reset course' The process should finish, check that the course end date was reset in the course settings page Go to 'Course administration' -> 'Reset' again Enable end date as well and set a date lower than the reset start date. Press 'Reset course' Expect again a validation error Now set end date to be > than the reset start date and press 'Reset course' The reset should proceed and the new start and end dates should be visible in the course settings page Go to 'Course administration' -> 'Reset' again Set both end date and start date (start date < end date) and press 'Reset course' The reset should proceed and the new start and end dates should be visible in the course settings page Note the current end date (you will need it a few steps later to check that the time shift has been applied to this end date value) Go to 'Course administration' -> 'Reset' again Set the start date, note the difference in days (or months or years) between the previous start date and the new one you set. Press 'Reset course' The reset should proceed and the new start date should be visible and end date should be the previous end date value + the difference between the previous start date and the new start date Backup & restore Backup a 31 course with a start date (will have a start date if you create it through 'Manage courses and categories' for example) Restore it to master integration, go to the course settings page and check that the start date is the same than it was and there is no end date Restore it to master integration changing the start date, go to the course settings page and check that the start date is the one you set and there is no end date Backup a master integration course with start date and no end date Restore it to master integration, go to the course settings page and check that the start date is the same than it was and there is no end date Restore it to master integration changing the start date, go to the course settings page and check that the start date is the one you set and there is no end date Backup a master integration course with start date and end date Restore it to master integration, go to the course settings page and check that the start date is the same than it was and the end date is the same than it was Restore it to master integration changing the start date, go to the course settings page and check that the start date is the one you set and the end date has been updated according to the changed you applied to the start date (e.g. if you moved it 5 days in future end date should also be moved 5 days in future) Web services & course API Call create_courses external function (you don't need to use web services, you can just call core_course_external::create_courses()) and try different startdate and enddate combinations: Set start date > end date -> KO Don't set start date, set end date -> KO Set start date, don't set end date -> OK Set start date < end date -> OK Call core_course_duplicate_course WS specifying a course with start and end date correctly set up (latest combination above should be ok) Go to the course and check that the start and end dates are the same than in the origin course Upload courses Prepare a simple csv to upload a course, something like this: shortname,fullname,category uploadedcourses1,Uploaded 1,1 Use upload course tool selecting "Create new courses, or update existing ones" as upload mode and "Update with CSV data and defaults" as update mode, move to the next form Check that the default end date date is after the start date (will depend on the default course format as before) In default course values section test the form validation, updating end date to be earlier than start date, you should see a form validation error Now restore end date value to be after the start date Press 'Upload courses', it should succeed Modify the csv to include a start date and an end date, for example shortname,fullname,category,startdate,enddate uploadedcourses2,Uploaded 2,1,10 June 2005,10 March 2005 Try to upload the course, you will see a red cross in the preview result as the enddate must be after the start date Update the csv to set the end date after the start date and start the upload process again Now it should succeed
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.
Attachments
Issue Links
- blocks
-
MDL-56251 Course in "Weeks" format can suggest the course end date automatically
-
- Closed
-
- has a non-specific relationship to
-
MDL-18319 Custom (optional) fields for course settings
-
- Closed
-
- has been marked as being related by
-
MDL-48762 Restrict access to course based on start and end date
-
- Closed
-
- is blocked by
-
MDL-55804 tool_uploadcourse doesn't apply default start date
-
- Closed
-
- will help resolve
-
MDL-51125 Display remaining time in course
-
- Closed
-