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

Modify the formchangedchecker javascript function to ignore form elements with the class "ignoredirty".

XMLWordPrintable

    • MOODLE_23_STABLE
    • MOODLE_23_STABLE
    • MDL-33874-master-2
    • Hide

      Initially check for regressions

      • Open a course page
      • Turn editing on
      • Add a new activity - I chose Page
      • Refresh the page
        • Confirm that the page refreshes and doesn't show any warnings
      • Set a title
      • Refresh the page
        • Confirm that you get a warning message
        • Reload the page anyway
      • Set a title but do not leave focus from the form element
      • Refresh the page
        • Confirm that you get a warning message
        • Reload the page anyway

      Testing a broken form

      • Add a new Assignment to the course
      • View the submitted assignments using the 'View/grade all submissions' link
      • Tick the 'Quick grading' checkbox at the bottom of the page
        • Confirm that the page warns you even though you haven't made any other changes
      • Edit mod/assign/gradingoptionsform.php and change the quickgrading checkbox to add the ignoredirty class:

        $mform->addElement('checkbox', 'quickgrading', get_string('quickgrading', 'assign'), '', array('class' => 'ignoredirty'));

      • Refresh the submitted assignments page
      • Tick the 'Quick grading' checkbox at the bottom of the page
        • Confirm that the page reloads without warning
      • Enter a grade for a student
      • Tick the 'Quick grading' checkbox at the bottom of the page
        • Confirm that you get a warning message this time
      • Edit mod/page/mod_form.php and change the name textbox to add the ignoredirty class:

        $mform->addElement('text', 'name', get_string('name'), array('size'=>'48', 'class' => 'ignoredirty'));

      • Add a new Page on a course
      • Set a title but do not leave focus from the form element
      • Refresh the page
        • Confirm that you do not get a warning message
      Show
      Initially check for regressions Open a course page Turn editing on Add a new activity - I chose Page Refresh the page Confirm that the page refreshes and doesn't show any warnings Set a title Refresh the page Confirm that you get a warning message Reload the page anyway Set a title but do not leave focus from the form element Refresh the page Confirm that you get a warning message Reload the page anyway Testing a broken form Add a new Assignment to the course View the submitted assignments using the 'View/grade all submissions' link Tick the 'Quick grading' checkbox at the bottom of the page Confirm that the page warns you even though you haven't made any other changes Edit mod/assign/gradingoptionsform.php and change the quickgrading checkbox to add the ignoredirty class: $mform->addElement('checkbox', 'quickgrading', get_string('quickgrading', 'assign'), '', array('class' => 'ignoredirty')); Refresh the submitted assignments page Tick the 'Quick grading' checkbox at the bottom of the page Confirm that the page reloads without warning Enter a grade for a student Tick the 'Quick grading' checkbox at the bottom of the page Confirm that you get a warning message this time Edit mod/page/mod_form.php and change the name textbox to add the ignoredirty class: $mform->addElement('text', 'name', get_string('name'), array('size'=>'48', 'class' => 'ignoredirty')); Add a new Page on a course Set a title but do not leave focus from the form element Refresh the page Confirm that you do not get a warning message

      In the assignment module (and probably elsewhere in Moodle) there are certain form elements that do not require dirty/change tracking. The dirty/change tracking is what prompts the "You have unsaved changes" dialog when you leave the page without submitting the form. In the assignment grading page it would be nice to disable this functionality for the selection checkboxes and the batch grading actions form.

            dobedobedoh Andrew Lyons
            damyon Damyon Wiese
            Dan Poltawski Dan Poltawski
            Sam Hemelryk Sam Hemelryk
            Frédéric Massart Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.