Moodle
  1. Moodle
  2. MDL-17229

Shortanswer questiontype refactoring

    Details

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

      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?

        Issue Links

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: