Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69918

Rewrite Form Change Checker in ES6

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      These testing instructions are mostly a smoke test. It would be impossible to test every form, but these represent a sample.

      Admin settings

      1. Log in as admin
      2. Navigate to Site administration -> Plugins -> Activity modules -> URL
      3. Refresh the page
        1. Confirm that you weren't shown a warning about form changes
      4. For each of the following, change the value and without clicking off the element, refresh the page:
        1. Frame height
        2. Include role names in parameters
        3. Available display options
        4. Display
        5. Confirm that you were shown a warning about form changes
          Note: The Password unmask field type does not currently fully support the Form change checker
          That is covered by a separate bug (MDL-71046)

      Feedback activity

      1. Create a new feedback activity
      2. Click on "Edit questions"
      3. Under 'Add question', choose "Short text answer"
        1. Confirm that you weren't shown a warning about form changes
      4. Fill in the form but do not press "Save question"
      5. Press the Refresh button
        1. Confirm that you were shown a warning about form changes
      6. Click cancel to stay on the page
      7. Click on "Dashboard" in the menu
        1. Confirm that you were shown a warning about form changes
      8. Click cancel to stay on the page
      9. Click on "Dashboard" in the menu
      10. Click okay to move away
        1. Confirm that you were moved away

      Editor autosave

      1. Login as a teacher/admin
      2. Navigate to a course
      3. From the dropdown menu, choose "Edit settings" for the course
      4. In the "Course summary" enter some text
      5. Wait for about 30 seconds until a notice underneath the editor states "Draft saved."
      6. Press the Refresh button on the page (confirm that you want to leave)
        1. Confirm that the value you had stored in the editor is restored
      7. Press the Refresh button on the page
        1. Confirm that you weren't shown a warning about form changes

      Data privacy

      1. Login as admin
      2. Navigate to Site administration -> Users -> Privacy and policies -> Data registry
      3. Press the "+" button for a Category to create a new category
      4. Type in a name
      5. Press the Refresh button on the page
        1. Confirm that you were shown a warning about form changes
      6. Press the cancel button
      7. Press the Refresh button on the page
        1. Confirm that you weren't shown a warning about form changes
      8. Press the "+" button for a Category to create a new category
      9. Type in a name
      10. Save changes
      11. Press the Refresh button on the page
        1. Confirm that you weren't shown a warning about form changes
      12. Press the "+" button for a Purpose to create a new Purpose
      13. Type in a namee
      14. Press the Refresh button on the page
        1. Confirm that you were shown a warning about form changes
      15. Press the cancel button
      16. Press the Refresh button on the page
        1. Confirm that you weren't shown a warning about form changes
      17. Press the "+" button for a Purpose to create a new category
      18. Type in a name and select a lawful base
      19. Save changes
      20. Press the Refresh button on the page
        1. Confirm that you weren't shown a warning about form changes
      21. Select a category and purpose but do not save changes
      22. Refresh the page
        1. Confirm that you were shown a warning about form changes

      Data policy

      1. Login as admin
      2. Navigate to Site administration -> Users -> Privacy and policies -> Policy settings
      3. Set "Site policy handler" to "Policies (tool_policy)"
      4. Save changes
      5. Navigate to Site administration -> Users -> Privacy and policies -> Manage policies
      6. Create a new policy:
        1. Name: MDL-69918
        2. Summary: Lorem ipsum
        3. Full policy: Lorem ipsum
        4. Policy status: Active
      7. Press Save
      8. Click on the "0 of x (0%)" link to view the list of users who have accepted it
      9. Press "Accept" for a user
      10. Type in a remark
      11. Press the Refresh button on the page
        1. Confirm that you were shown a warning about form changes
      12. Press the cancel button
      13. Press the Refresh button on the page
        1. Confirm that you weren't shown a warning about form changes
      14. Press "Accept" for a user
      15. Type in a remark
      16. Save changes
      17. Press the Refresh button on the page
        1. Confirm that you weren't shown a warning about form changes

      Course completion

      1. Login as an admin/teacher
      2. Create or open a course
      3. Edit course settings
      4. Set Completion tracking -> Enable completion tracking to "Yes"
      5. Save changes
      6. From the course cog menu, choose "Course completion"
      7. At the top click on the "Bulk edit activity completion" tab
      8. Press the Refresh button on the page
        1. Confirm that you weren't shown a warning about form changes
      9. Click on at least one checkbox (one/many/all)
      10. Press the Refresh button on the page
        1. Confirm that you were shown a warning about form changes
      11. At the top click on the "Default activity completion" tab
      12. Press the Refresh button on the page
        1. Confirm that you weren't shown a warning about form changes
      13. Click on at least one checkbox (one/many/all)
      14. Press the Refresh button on the page
        1. Confirm that you were shown a warning about form changes
      15. Press cancel to remain on the page
      16. Press the "Edit" button
        1. Confirm that the edit page was shown instead
        2. Confirm that you weren't shown a warning about form changes

      Grade setup

      1. Login as an admin/teacher
      2. Create a course or take an existing course
      3. Create an assignment
      4. Choose Grades in the left-hand menu
      5. Choose Setup
      6. Press the Refresh button on the page
        1. Confirm that you weren't shown a warning about form changes
      7. Click on at least one checkbox (one/many/all)
      8. Press the Refresh button on the page
        1. Confirm that you were shown a warning about form changes
      9. Choose the "View" tab"
      10. Turn editing on
      11. Press the Refresh button on the page
        1. Confirm that you weren't shown a warning about form changes
      12. Enter a value for one user but do not save changes
      13. Press the Refresh button on the page
        1. Confirm that you were shown a warning about form changes
      14. Press cancel to remain on the page
      15. Press the save changes button
        1. Confirm that the page refreshed
        2. Confirm that you weren't shown a warning about form changes

      Autocompletion

      1. Login as an admin/teacher
      2. Load a page
      3. From the cog, choose "Edit settings"
      4. Expand the "Tags" section
      5. Type a value into the "Tags":
        1. DO NOT click away, press enter, etc.
      6. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you were shown a warning about form changes
      7. Press cancel to remain on the page
      8. Press the save changes button
        1. Confirm that you weren't shown a warning about form changes

      Private files

      1. From the drawer navigation on the left choose "Private files"
      2. Upload a file
      3. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you were shown a warning about form changes
      4. Press cancel to remain on the page
      5. Press the save changes button
        1. Confirm that you weren't shown a warning about form changes
      6. Open your user Dashboard
      7. Choose "Manage private files"
      8. Upload a file
      9. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you were shown a warning about form changes
      10. Press cancel to remain on the page
      11. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you weren't shown a warning about form changes
      12. Choose "Manage private files"
      13. Upload a file
      14. Save changes
        1. Confirm that you weren't shown a warning about form changes
      15. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you weren't shown a warning about form changes

      File manager

      1. Login as an admin/teacher
      2. Load a page
      3. From the cog, choose "Edit settings"
      4. Upload an image to "Course image"
      5. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you were shown a warning about form changes
      6. Press "Save and display"
        1. Confirm that you weren't shown a warning about form changes
      7. Edit the course settings again
      8. Delete the file from the course image
      9. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you were shown a warning about form changes
      10. Press cancel to remain on the page
      11. Press "Save and display"
        1. Confirm that you weren't shown a warning about form changes

      Assignment grading

      1. Login as an admin/teacher
      2. Create a course or take an existing course and enrol some users
      3. Create an assignment
      4. Open the assignment and press "Grade users"
      5. Enter a grade, or some feedback
      6. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you were shown a warning about form changes
      7. Press cancel to remain on the page
      8. Save changes
        1. Confirm that you weren't shown a warning about form changes
      9. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you weren't shown a warning about form changes

      Relative dates

      1. Navigate to Site administration -> Development -> Experimental -> Experimental settings
      2. Enable course relative dates and save changes
      3. Navigate to Site administration -> Courses -> Add a new course
      4. Create a new course and set:
        1. Course full name: MDL-69918
        2. Course shortname: MDL-69918
        3. Relative dates mode: Yes
        4. Course start date: 1st March 2021 00:00
        5. Course end date: 1st March 2022 00:00
      5. Enrol some users in the course
      6. Create a new assignment
      7. View the assignment
      8. From the cog menu choose "User overrides"
      9. Choose a user
        1. Confirm that you weren't shown a warning about form changes
      10. Change the "Allow submissions from" date
      11. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you were shown a warning about form changes
      12. Press cancel to remain on the page
      13. Save changes
        1. Confirm that you weren't shown a warning about form changes

      Forum

      1. Login as a teacher or admin
      2. Navigate to a course
      3. Create a forum
      4. Create a new discussion
      5. View the discussion
      6. Click on the "Reply" button
      7. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you weren't shown a warning about form changes
      8. Click on the "Reply" button
      9. Enter a value but do not click "Post to forum"
      10. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you were shown a warning about form changes
      11. Press cancel to remain on the page
      12. Post to the forum
        1. Confirm that you weren't shown a warning about form changes
      13. Open the user menu and choose "User preferences"
      14. Choose "Forum preferences"
      15. Set the value "Use experimental nested discussion view" to "Yes"
      16. Save changes
      17. Repeat the above tests with the V2 UI

      Forum Part 2

      After completing the previous section:

      1. Open the forum to the discussion list
      2. From the forum cog menu choose "Forum summary report"
      3. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you weren't shown a warning about form changes
      4. Press the "Dates" button
      5. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you weren't shown a warning about form changes
      6. Press the "Dates" button
      7. Toggle one of the "Enable" checkboxes
      8. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you were shown a warning about form changes

      Quiz

      1. Create a new quiz:
        1. Set a time limit of 30 seconds
      2. Create a question in the quiz
      3. Attempt the quiz
      4. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you weren't shown a warning about form changes
      5. Choose a value for the question, but do not save it
      6. Press the Refresh button (Ctrl+R, F5, etc)
        1. Confirm that you were shown a warning about form changes
      7. Press cancel to remain on the page
      8. Wait 30 seconds for the quiz to time out
        1. Confirm that you weren't shown a warning about form changes
        2. Confirm that you were redirected to the review page
      9. Attempt the quiz again
      10. Select a value
      11. Submit your attempt
        1. Confirm that you weren't shown a warning about form changes
      Show
      These testing instructions are mostly a smoke test. It would be impossible to test every form, but these represent a sample. Admin settings Log in as admin Navigate to Site administration -> Plugins -> Activity modules -> URL Refresh the page Confirm that you weren't shown a warning about form changes For each of the following, change the value and without clicking off the element, refresh the page: Frame height Include role names in parameters Available display options Display Confirm that you were shown a warning about form changes Note: The Password unmask field type does not currently fully support the Form change checker That is covered by a separate bug ( MDL-71046 ) Feedback activity Create a new feedback activity Click on "Edit questions" Under 'Add question', choose "Short text answer" Confirm that you weren't shown a warning about form changes Fill in the form but do not press "Save question" Press the Refresh button Confirm that you were shown a warning about form changes Click cancel to stay on the page Click on "Dashboard" in the menu Confirm that you were shown a warning about form changes Click cancel to stay on the page Click on "Dashboard" in the menu Click okay to move away Confirm that you were moved away Editor autosave Login as a teacher/admin Navigate to a course From the dropdown menu, choose "Edit settings" for the course In the "Course summary" enter some text Wait for about 30 seconds until a notice underneath the editor states "Draft saved." Press the Refresh button on the page (confirm that you want to leave) Confirm that the value you had stored in the editor is restored Press the Refresh button on the page Confirm that you weren't shown a warning about form changes Data privacy Login as admin Navigate to Site administration -> Users -> Privacy and policies -> Data registry Press the "+" button for a Category to create a new category Type in a name Press the Refresh button on the page Confirm that you were shown a warning about form changes Press the cancel button Press the Refresh button on the page Confirm that you weren't shown a warning about form changes Press the "+" button for a Category to create a new category Type in a name Save changes Press the Refresh button on the page Confirm that you weren't shown a warning about form changes Press the "+" button for a Purpose to create a new Purpose Type in a namee Press the Refresh button on the page Confirm that you were shown a warning about form changes Press the cancel button Press the Refresh button on the page Confirm that you weren't shown a warning about form changes Press the "+" button for a Purpose to create a new category Type in a name and select a lawful base Save changes Press the Refresh button on the page Confirm that you weren't shown a warning about form changes Select a category and purpose but do not save changes Refresh the page Confirm that you were shown a warning about form changes Data policy Login as admin Navigate to Site administration -> Users -> Privacy and policies -> Policy settings Set "Site policy handler" to "Policies (tool_policy)" Save changes Navigate to Site administration -> Users -> Privacy and policies -> Manage policies Create a new policy: Name: MDL-69918 Summary: Lorem ipsum Full policy: Lorem ipsum Policy status: Active Press Save Click on the "0 of x (0%)" link to view the list of users who have accepted it Press "Accept" for a user Type in a remark Press the Refresh button on the page Confirm that you were shown a warning about form changes Press the cancel button Press the Refresh button on the page Confirm that you weren't shown a warning about form changes Press "Accept" for a user Type in a remark Save changes Press the Refresh button on the page Confirm that you weren't shown a warning about form changes Course completion Login as an admin/teacher Create or open a course Edit course settings Set Completion tracking -> Enable completion tracking to "Yes" Save changes From the course cog menu, choose "Course completion" At the top click on the "Bulk edit activity completion" tab Press the Refresh button on the page Confirm that you weren't shown a warning about form changes Click on at least one checkbox (one/many/all) Press the Refresh button on the page Confirm that you were shown a warning about form changes At the top click on the "Default activity completion" tab Press the Refresh button on the page Confirm that you weren't shown a warning about form changes Click on at least one checkbox (one/many/all) Press the Refresh button on the page Confirm that you were shown a warning about form changes Press cancel to remain on the page Press the "Edit" button Confirm that the edit page was shown instead Confirm that you weren't shown a warning about form changes Grade setup Login as an admin/teacher Create a course or take an existing course Create an assignment Choose Grades in the left-hand menu Choose Setup Press the Refresh button on the page Confirm that you weren't shown a warning about form changes Click on at least one checkbox (one/many/all) Press the Refresh button on the page Confirm that you were shown a warning about form changes Choose the "View" tab" Turn editing on Press the Refresh button on the page Confirm that you weren't shown a warning about form changes Enter a value for one user but do not save changes Press the Refresh button on the page Confirm that you were shown a warning about form changes Press cancel to remain on the page Press the save changes button Confirm that the page refreshed Confirm that you weren't shown a warning about form changes Autocompletion Login as an admin/teacher Load a page From the cog, choose "Edit settings" Expand the "Tags" section Type a value into the "Tags": DO NOT click away, press enter, etc. Press the Refresh button (Ctrl+R, F5, etc) Confirm that you were shown a warning about form changes Press cancel to remain on the page Press the save changes button Confirm that you weren't shown a warning about form changes Private files From the drawer navigation on the left choose "Private files" Upload a file Press the Refresh button (Ctrl+R, F5, etc) Confirm that you were shown a warning about form changes Press cancel to remain on the page Press the save changes button Confirm that you weren't shown a warning about form changes Open your user Dashboard Choose "Manage private files" Upload a file Press the Refresh button (Ctrl+R, F5, etc) Confirm that you were shown a warning about form changes Press cancel to remain on the page Press the Refresh button (Ctrl+R, F5, etc) Confirm that you weren't shown a warning about form changes Choose "Manage private files" Upload a file Save changes Confirm that you weren't shown a warning about form changes Press the Refresh button (Ctrl+R, F5, etc) Confirm that you weren't shown a warning about form changes File manager Login as an admin/teacher Load a page From the cog, choose "Edit settings" Upload an image to "Course image" Press the Refresh button (Ctrl+R, F5, etc) Confirm that you were shown a warning about form changes Press "Save and display" Confirm that you weren't shown a warning about form changes Edit the course settings again Delete the file from the course image Press the Refresh button (Ctrl+R, F5, etc) Confirm that you were shown a warning about form changes Press cancel to remain on the page Press "Save and display" Confirm that you weren't shown a warning about form changes Assignment grading Login as an admin/teacher Create a course or take an existing course and enrol some users Create an assignment Open the assignment and press "Grade users" Enter a grade, or some feedback Press the Refresh button (Ctrl+R, F5, etc) Confirm that you were shown a warning about form changes Press cancel to remain on the page Save changes Confirm that you weren't shown a warning about form changes Press the Refresh button (Ctrl+R, F5, etc) Confirm that you weren't shown a warning about form changes Relative dates Navigate to Site administration -> Development -> Experimental -> Experimental settings Enable course relative dates and save changes Navigate to Site administration -> Courses -> Add a new course Create a new course and set: Course full name: MDL-69918 Course shortname: MDL-69918 Relative dates mode: Yes Course start date: 1st March 2021 00:00 Course end date: 1st March 2022 00:00 Enrol some users in the course Create a new assignment View the assignment From the cog menu choose "User overrides" Choose a user Confirm that you weren't shown a warning about form changes Change the "Allow submissions from" date Press the Refresh button (Ctrl+R, F5, etc) Confirm that you were shown a warning about form changes Press cancel to remain on the page Save changes Confirm that you weren't shown a warning about form changes Forum Login as a teacher or admin Navigate to a course Create a forum Create a new discussion View the discussion Click on the "Reply" button Press the Refresh button (Ctrl+R, F5, etc) Confirm that you weren't shown a warning about form changes Click on the "Reply" button Enter a value but do not click "Post to forum" Press the Refresh button (Ctrl+R, F5, etc) Confirm that you were shown a warning about form changes Press cancel to remain on the page Post to the forum Confirm that you weren't shown a warning about form changes Open the user menu and choose "User preferences" Choose "Forum preferences" Set the value "Use experimental nested discussion view" to "Yes" Save changes Repeat the above tests with the V2 UI Forum Part 2 After completing the previous section: Open the forum to the discussion list From the forum cog menu choose "Forum summary report" Press the Refresh button (Ctrl+R, F5, etc) Confirm that you weren't shown a warning about form changes Press the "Dates" button Press the Refresh button (Ctrl+R, F5, etc) Confirm that you weren't shown a warning about form changes Press the "Dates" button Toggle one of the "Enable" checkboxes Press the Refresh button (Ctrl+R, F5, etc) Confirm that you were shown a warning about form changes Quiz Create a new quiz: Set a time limit of 30 seconds Create a question in the quiz Attempt the quiz Press the Refresh button (Ctrl+R, F5, etc) Confirm that you weren't shown a warning about form changes Choose a value for the question, but do not save it Press the Refresh button (Ctrl+R, F5, etc) Confirm that you were shown a warning about form changes Press cancel to remain on the page Wait 30 seconds for the quiz to time out Confirm that you weren't shown a warning about form changes Confirm that you were redirected to the review page Attempt the quiz again Select a value Submit your attempt Confirm that you weren't shown a warning about form changes
    • Affected Branches:
      MOODLE_311_STABLE
    • Pull Master Branch:
      MDL-69918-master
    • Story Points:
      0
    • Sprint:
      Internationals - 3.11 Sprint 7, Internationals - 3.11 Sprint 8, Internationals - 3.11 Sprint 9

      Description

      The Change Checker was written many years ago for YUI, but we should update it to use an ES6 module and provide a b/c layer as we move over.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Nicols
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Dongsheng Cai
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 6 hours
                  2d 6h