Moodle
  1. Moodle
  2. MDL-29804

Clean up Feedback modules coding style

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2
    • Component/s: Feedback
    • Labels:
    • Testing Instructions:
      Hide

      These changes consist primarily of whitespace fixes and as such only a very little bit of code has changed.

      1. Test that you can still add/edit/delete feedback modules as an admin or teacher
      2. Test that as a student you can submit feedback
      3. Test the reporting as an admin/teacher

      Testing the issue with new function xxx_param_array()

      1. turn debug on for developer
      2. create a feedback and an item multichoice "Multiple choice - multiple answers" (checkbox) with two or more options
      3. go to complete this feedback and check one or more checkboxes
      4. while submitting no error should be raised
        The special changes are done in feedback/lib.php in functions feedback_check_values, feedback_create_values, feedback_update_values
        and in feedback/item/multichoice/lib.php in function item_array_to_string.
      Show
      These changes consist primarily of whitespace fixes and as such only a very little bit of code has changed. Test that you can still add/edit/delete feedback modules as an admin or teacher Test that as a student you can submit feedback Test the reporting as an admin/teacher Testing the issue with new function xxx_param_array() turn debug on for developer create a feedback and an item multichoice "Multiple choice - multiple answers" (checkbox) with two or more options go to complete this feedback and check one or more checkboxes while submitting no error should be raised The special changes are done in feedback/lib.php in functions feedback_check_values, feedback_create_values, feedback_update_values and in feedback/item/multichoice/lib.php in function item_array_to_string.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-29804_master
    • Rank:
      19313

      Description

      The feedback modules coding style needs to be cleaned up in the master branch.
      Things such as spacing, variable names and phpdocs can be improved.

      The coding style can be found in the docs: http://docs.moodle.org/dev/Coding_style
      Also worth looking at is Tim's code checker: https://github.com/timhunt/moodle-local_codechecker

        Issue Links

          Activity

          Hide
          Sam Hemelryk added a comment -

          Linking to the issue that lead to the creation of this issue MDL-19488

          Show
          Sam Hemelryk added a comment - Linking to the issue that lead to the creation of this issue MDL-19488
          Hide
          Andreas Grabs added a comment -

          Hi,
          I did start the cleaning the code at weekend. But now I have a question. Are there some common rules how to use public, private, protected in classes like moodle_forms or own classes?
          Thank you!
          Andreas

          Show
          Andreas Grabs added a comment - Hi, I did start the cleaning the code at weekend. But now I have a question. Are there some common rules how to use public, private, protected in classes like moodle_forms or own classes? Thank you! Andreas
          Hide
          Andreas Grabs added a comment -

          I have cleaned up the code on most places. I used the codechecker from Tim Hunt (great tool!!!).
          While I did this I found a new issue with the new restrictions of optional_params/optional_params_array. I just solved this along the way.
          Many files were changed.
          Have fun while you test all things
          Best regards
          Andreas

          Show
          Andreas Grabs added a comment - I have cleaned up the code on most places. I used the codechecker from Tim Hunt (great tool!!!). While I did this I found a new issue with the new restrictions of optional_params/optional_params_array. I just solved this along the way. Many files were changed. Have fun while you test all things Best regards Andreas
          Hide
          Sam Hemelryk added a comment -

          Thanks Andreas - changes look spot on and have now been integrated

          Show
          Sam Hemelryk added a comment - Thanks Andreas - changes look spot on and have now been integrated
          Hide
          Sam Hemelryk added a comment -

          Andreas could you please add some testing instructions for the code change you made to fix the param array issue you mentioned.

          Show
          Sam Hemelryk added a comment - Andreas could you please add some testing instructions for the code change you made to fix the param array issue you mentioned.
          Hide
          Ankit Agarwal added a comment -

          works perfectly!
          Thanks

          Show
          Ankit Agarwal added a comment - works perfectly! Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          And this has been sent upstream (already available @ git and cvs repos). Many, many thanks!

          Closing as fixed, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - And this has been sent upstream (already available @ git and cvs repos). Many, many thanks! Closing as fixed, ciao

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: