Skip to content
  • Tim Hunt's avatar
    f3460297
    MDL-32188 question engine: behaviour static methods -> new classes · f3460297
    Tim Hunt authored
    It was always a bit of a hack to use static methods on the
    qbehaviour_whatever classes to return metadata about the behaviour. It
    is better design to have real qbehaviour_whatever_type classes to report
    that metadata, particularly now that we are planning to add more such.
    
    For example, inheritance works better with real classes. See, for
    example, the improvements in
    question_engine::get_behaviour_unused_display_options().
    
    This change has been implemented in a backwards-compatbile way. Old
    behaviours will continue to work. There will just be some developer debug
    output to prompt people to upgrade their code properly.
    f3460297
    MDL-32188 question engine: behaviour static methods -> new classes
    Tim Hunt authored
    It was always a bit of a hack to use static methods on the
    qbehaviour_whatever classes to return metadata about the behaviour. It
    is better design to have real qbehaviour_whatever_type classes to report
    that metadata, particularly now that we are planning to add more such.
    
    For example, inheritance works better with real classes. See, for
    example, the improvements in
    question_engine::get_behaviour_unused_display_options().
    
    This change has been implemented in a backwards-compatbile way. Old
    behaviours will continue to work. There will just be some developer debug
    output to prompt people to upgrade their code properly.
Loading