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

Shortanswer questiontype refactoring


    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • 1.9.3
    • Questions
    • None

      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?

            timhunt Tim Hunt
            oa_sychev Oleg Sychev
            0 Vote for this issue
            2 Start watching this issue


                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.