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

When Completion conditions are locked, the radio buttons options should remain disabled

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-80818-402
    • MDL-80818-403
    • MDL-80818-main
    • Hide

      Moodle 4.3 and main/4.4

      1. As admin create a course with Completion tracking = Yes and enrol an student.
      2. Create a Page activity in the course and set Completion conditions = Add requirement - View activity.
      3. Log out as admin and log in as student.
      4. View the page created in step 2.
      5. Log out as student and log in as admin.
      6. Go to edit Page settings.
      7. Confirm there is a 'Unlock completion settings' button and a message.
      8. Confirm following elements are disabled.
        1. None
        2. Students must manually mark the activity as done
        3. Add requirements
        4. View the activity
      9. Click on 'Unlock completion settings' button
      10. Confirm following elements are enabled.
        1. None
        2. Students must manually mark the activity as done
        3. Add requirements
        4. View the activity
      11. Change Completion conditions to Students must manually mark the activity as done and Save changes.
      12. Go to Page settings.
      13. Confirm Completion conditions = Students must manually mark the activity as done.

      Moodle 4.2

      Setup: Apply following patch (also attached)

      diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php
      index e11a5da2998..3ded3a15891 100644
      --- a/course/moodleform_mod.php
      +++ b/course/moodleform_mod.php
      @@ -778,7 +778,7 @@ abstract class moodleform_mod extends moodleform {
                           // Only one gradeitem in this activity.
                           // We use the completionusegrade field here.
                           $mform->addElement(
      -                        'checkbox',
      +                        'radio',
                               'completionusegrade',
                               get_string('completionusegrade', 'completion'),
                               get_string('completionusegrade_desc', 'completion')
      @@ -788,13 +788,10 @@ abstract class moodleform_mod extends moodleform {
       
                           // Complete if the user has reached the pass grade.
                           $mform->addElement(
      -                        'checkbox',
      -                        'completionpassgrade', null,
      +                        'radio',
      +                        'completionusegrade', null,
                               get_string('completionpassgrade_desc', 'completion')
                           );
      -                    $mform->hideIf('completionpassgrade', 'completion', 'ne', COMPLETION_TRACKING_AUTOMATIC);
      -                    $mform->disabledIf('completionpassgrade', 'completionusegrade', 'notchecked');
      -                    $mform->addHelpButton('completionpassgrade', 'completionpassgrade', 'completion');
       
                           // The disabledIf logic differs between ratings and other grade items due to different field types.
                           if ($this->_features->rating) {

       

      1. As admin create a course with Completion tracking = Yes and enrol an student.
      2. Create an Assignment in the course and set Completion conditions = Student must view this activity to complete it.
      3. Log out as admin and log in as student.
      4. View the assignment created in step 2.
      5. Log out as student and log in as admin.
      6. Go to edit Page settings.
      7. Confirm there is a 'Unlock completion settings' button and a message.
      8. Confirm following elements are disabled.
        1. Student must view this activity to complete it
        2. Student must receive a grade to complete this activity
        3. Student must receive a passing grade to complete this activity
      9. Click on 'Unlock completion settings' button
      10. Confirm following elements are enabled.
        1. Student must view this activity to complete it
        2. Student must receive a grade to complete this activity
        3. Student must receive a passing grade to complete this activity
      Show
      Moodle 4.3 and main/4.4 As admin create a course with Completion tracking = Yes and enrol an student. Create a Page activity in the course and set Completion conditions = Add requirement - View activity. Log out as admin and log in as student. View the page created in step 2. Log out as student and log in as admin. Go to edit Page settings. Confirm there is a 'Unlock completion settings' button and a message. Confirm following elements are disabled . None Students must manually mark the activity as done Add requirements View the activity Click on 'Unlock completion settings' button Confirm following elements are enabled . None Students must manually mark the activity as done Add requirements View the activity Change Completion conditions to Students must manually mark the activity as done and Save changes. Go to Page settings. Confirm Completion conditions = Students must manually mark the activity as done. Moodle 4.2 Setup: Apply following patch (also attached) diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php index e11a5da2998..3ded3a15891 100644 --- a/course/moodleform_mod.php +++ b/course/moodleform_mod.php @@ - 778 , 7 + 778 , 7 @@ abstract class moodleform_mod extends moodleform {                       // Only one gradeitem in this activity.                       // We use the completionusegrade field here.                      $mform->addElement( -                         'checkbox' , +                         'radio' ,                           'completionusegrade' ,                          get_string( 'completionusegrade' , 'completion' ),                          get_string( 'completionusegrade_desc' , 'completion' ) @@ - 788 , 13 + 788 , 10 @@ abstract class moodleform_mod extends moodleform {                         // Complete if the user has reached the pass grade.                      $mform->addElement( -                         'checkbox' , -                         'completionpassgrade' , null , +                         'radio' , +                         'completionusegrade' , null ,                          get_string( 'completionpassgrade_desc' , 'completion' )                      ); -                    $mform->hideIf( 'completionpassgrade' , 'completion' , 'ne' , COMPLETION_TRACKING_AUTOMATIC); -                    $mform->disabledIf( 'completionpassgrade' , 'completionusegrade' , 'notchecked' ); -                    $mform->addHelpButton( 'completionpassgrade' , 'completionpassgrade' , 'completion' );                         // The disabledIf logic differs between ratings and other grade items due to different field types.                       if ($ this ->_features->rating) {   As admin create a course with Completion tracking = Yes and enrol an student. Create an Assignment in the course and set Completion conditions = Student must view this activity to complete it. Log out as admin and log in as student. View the assignment created in step 2. Log out as student and log in as admin. Go to edit Page settings. Confirm there is a 'Unlock completion settings' button and a message. Confirm  following elements are  disabled . Student must view this activity to complete it Student must receive a grade to complete this activity Student must receive a passing grade to complete this activity Click on 'Unlock completion settings' button Confirm  following elements are  enabled . Student must view this activity to complete it Student must receive a grade to complete this activity Student must receive a passing grade to complete this activity
    • 3
    • HQ 2024 Sprint I1.2 Moppies

      Current behavior

      When the completion conditions of an activity are locked, the radio button options remain active (Except the "None" option), allowing the user to modify the initially selected choice made during the activity's creation. While the system allows the form to be saved seamlessly, it neglects to retain the changes made by the user. Consequently, the user remains unaware that their modifications have not been captured or saved.

      Expected behavior

      When Completion conditions are locked, ALL radio buttons options should be disabled until the "Unlock completion settings" button is clicked.

        1. Captura de pantalla 2024-02-02 a las 17.33.22.png
          Captura de pantalla 2024-02-02 a las 17.33.22.png
          83 kB
        2. MDL-80818.patch
          2 kB
        3. MDL-80818-step08_402.png
          MDL-80818-step08_402.png
          73 kB
        4. MDL-80818-step08_403.png
          MDL-80818-step08_403.png
          60 kB
        5. MDL-80818-step08_main.png
          MDL-80818-step08_main.png
          61 kB
        6. MDL-80818-step10_402.png
          MDL-80818-step10_402.png
          62 kB
        7. MDL-80818-step10_403.png
          MDL-80818-step10_403.png
          47 kB
        8. MDL-80818-step10_main.png
          MDL-80818-step10_main.png
          48 kB
        9. MDL-80818-step13_403.png
          MDL-80818-step13_403.png
          23 kB
        10. MDL-80818-step13_main.png
          MDL-80818-step13_main.png
          24 kB
        11. Screenshot 2024-03-04 at 11.18.59.png
          Screenshot 2024-03-04 at 11.18.59.png
          189 kB
        12. Screenshot 2024-03-04 at 12.20.29.png
          Screenshot 2024-03-04 at 12.20.29.png
          180 kB

            amaia Amaia Anabitarte
            sabina.abellan@moodle.com Sabina Abellan
            David Cerezal David Cerezal
            Ferran Recio Ferran Recio
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 7 hours, 15 minutes
                7h 15m

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