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

Shortanswer questiontype refactoring

    XMLWordPrintable

    Details

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

      Description

      Tim, I just found that I was stupid, and my plugin would be much less in size (and easier to maintain) if I used inheritance from shortanswer instead of editing it's copy.

      Hovewer, shortanswer question isn't designed very well for inheritance, it requires many code duplication to simple tasks. There is no way question edit form can be useful when inherited.

      I would like to refactor both shortanswer classes (after we deal with MDL-17064) either by creating functions that will allow injections of new things in critical points, or by defining some options (such as additional fields in blanks and main options area) via functions/variables. It'll help me and any other maintainers of derivative question types, and It'll help Moodle too, since numerical and calculated questions are inherited from shortanswer, and there is much code duplication in the case.

      Are you interested in it?

        Attachments

          Issue Links

          There are no Sub-Tasks for this issue.

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: