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

Make question_edit_form more suitable for inheritance

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.3
    • Fix Version/s: None
    • Component/s: Questions
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      I'm glad to say, this is the last sub-task there for now.

      Well, the matter turns out more complicated. A goal is to create a default implementation of definition_inner function which can suit all questions with repeated answers blanks (at least to override with a parent call); it'll get particulars of questions answer's blank as an array from a special function, overrided in a question.

      Also there will be relevant set_data and validation things.

      Benefits:

      • huge code duplication reducing (6 qtypes can benefit from it)
      • less qtype-specific strings hardcoded in relevant classes, so qtypes forms are more open to inheritance
      • 5 less repeat_elements calls, so less code to modify for MDL-17064

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              oa_sychev Oleg Sychev
              Tester:
              Nobody
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: