Moodle
  1. Moodle
  2. MDL-30135

qformat_xml methods trans_format and get_format should not be declared protected.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.2
    • Fix Version/s: 2.1.3
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      1. Review patch, and confirm it cannot break anything.

      2. Export some questions as Moodle XML and re-import, to verify there are no regressions.

      Show
      1. Review patch, and confirm it cannot break anything. 2. Export some questions as Moodle XML and re-import, to verify there are no regressions.
    • Workaround:
      Hide

      Currently we need to duplicate this code in the questiontype.php file of our qtypes wich is not a very good solution.

      Show
      Currently we need to duplicate this code in the questiontype.php file of our qtypes wich is not a very good solution.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      The 2 methods trans_format and get_format in the qformat_xml class in question/format/xml/format.php convert modle internal numerical code for formats to and from human readable format string.
      IMHO they should not be declared proctected because they are quite usefull in some third party qtypes to write the export_to_xml and import_from_xml methods

        Gliffy Diagrams

          Activity

          Hide
          Tim Hunt added a comment -

          You are right. I have some other changes pending in the format.php files, so I will do this next week.

          Show
          Tim Hunt added a comment - You are right. I have some other changes pending in the format.php files, so I will do this next week.
          Hide
          Aparup Banerjee added a comment -

          Thanks, this has been integrated.

          Show
          Aparup Banerjee added a comment - Thanks, this has been integrated.
          Hide
          Ankit Agarwal added a comment -

          Export - import works fine.
          All things looking good.
          Test passed
          Thanks

          Show
          Ankit Agarwal added a comment - Export - import works fine. All things looking good. Test passed Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Yes, you got this finally upstream, just in time for Moodle 2.2beta. Congrats and thanks!

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Yes, you got this finally upstream, just in time for Moodle 2.2beta. Congrats and thanks! Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: