Details

    • Testing Instructions:
      Hide

      Course forms & defaults

      1. Go to admin/settings.php?section=coursesettings, set "Course duration" to 6 months and save changes
      2. Set your default course format to topics
      3. Create a new course
      4. The default end date value should be startdate + 6 months
      5. Change the default course format in admin/settings.php?section=coursesettings to weekly
      6. Create a new course
      7. The default course end date should be startdate + (1 week for each section = numsections setting value)
      1. Go to an existing course without end date, end date should be disabled
      2. Set end date < start date and try to save changes
      3. The form server validation shouldn't allow you to do it
      4. Set the end date > start date
      5. You should be able to save changes
      6. Return to the form and check that your value is stored
      7. Uncheck end date and save changes
      8. Return to the form and check that there is no end date

      Course reset

      1. Using this same course used above (have both course start and end dates) go to 'Course administration' -> 'Reset'
      2. Just press 'Reset course'
      3. Check the course settings, the shouldn't have changed
      4. Go to 'Course administration' -> 'Reset' again
      5. Set course end date < the course current start date and press 'Reset course'
      6. You should see a form validation error
      7. Set course end date > the start date you noted down (the course current start date) and press 'Reset course'
      8. The process should finish, check that the course end date was reset in the course settings page
      9. Go to 'Course administration' -> 'Reset' again
      10. Enable end date as well and set a date lower than the reset start date. Press 'Reset course'
      11. Expect again a validation error
      12. Now set end date to be > than the reset start date and press 'Reset course'
      13. The reset should proceed and the new start and end dates should be visible in the course settings page
      14. Go to 'Course administration' -> 'Reset' again
      15. Set both end date and start date (start date < end date) and press 'Reset course'
      16. The reset should proceed and the new start and end dates should be visible in the course settings page
      17. 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)
      18. Go to 'Course administration' -> 'Reset' again
      19. 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'
      20. 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

      1. Backup a 31 course with a start date (will have a start date if you create it through 'Manage courses and categories' for example)
      2. 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
      3. 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
      1. Backup a master integration course with start date and no end date
      2. 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
      3. 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
      1. Backup a master integration course with start date and end date
      2. 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
      3. 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

      1. 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
      1. Call core_course_duplicate_course WS specifying a course with start and end date correctly set up (latest combination above should be ok)
      2. Go to the course and check that the start and end dates are the same than in the origin course

      Upload courses

      1. Prepare a simple csv to upload a course, something like this:
        • shortname,fullname,category
        • uploadedcourses1,Uploaded 1,1
      2. 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
      3. Check that the default end date date is after the start date (will depend on the default course format as before)
      4. 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
      5. Now restore end date value to be after the start date
      6. Press 'Upload courses', it should succeed
      7. 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
      8. Try to upload the course, you will see a red cross in the preview result as the enddate must be after the start date
      9. Update the csv to set the end date after the start date and start the upload process again
      10. Now it should succeed
      Show
      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
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-22078_master

      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

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  19 Vote for this issue
                  Watchers:
                  30 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    5/Dec/16