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

questionid_column_name and extra_answer_fields should be public to allow access from backup and restore classes

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.3, 2.2
    • 2.2.1, 2.3
    • Questions
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • Hide

      No one possible without hacking PHP, so better have this fixed in all 2.x

      Show
      No one possible without hacking PHP, so better have this fixed in all 2.x
    • Hide

      I really coudn't imagine what could go wrong from making previously protected method public. Thought you must be sure it is public in all subclasses (i.e. shortanswer in core). In my experience having public/protected mismatch leads to empty screen on previewing questions (or fatal error depending on you error-reporting level).

      So just run preview of one question of each core types in Moodle if you want to be extra sure. If a question is able to display itself, all is OK.

      Show
      I really coudn't imagine what could go wrong from making previously protected method public. Thought you must be sure it is public in all subclasses (i.e. shortanswer in core). In my experience having public/protected mismatch leads to empty screen on previewing questions (or fatal error depending on you error-reporting level). So just run preview of one question of each core types in Moodle if you want to be extra sure. If a question is able to display itself, all is OK.

    Description

      In Moodle 1.x backup/restore of question was handled by question type class, so having questionid_column_name() and extra_answer_fields() protected had a sense and don't interefere with anything.

      Now in Moodle 2.x backup/restore is handled by separate classes that nees access to extra_question_fields(), questionid_column_name() and extra_answer_fields() functions. So these methods really should be public now (if possible - starting from 2.0 or at least 2.1).

      Tim, if you want, we could provide a git branch with the change, but it's really rather trivial so you may prefer doing it by youself.

      Attachments

        Issue Links

          Activity

            People

              oa_sychev Oleg Sychev
              oa_sychev Oleg Sychev
              Tim Hunt Tim Hunt
              Aparup Banerjee Aparup Banerjee
              Ankit Agarwal Ankit Agarwal
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Jan/12