Skip to content

Improved plugin modularity #443

@andrewscaya

Description

@andrewscaya

Hello @mchurchward,

I'm currently working on a project for a university in Canada, and we were wondering if the mod_questionnaire project is open to getting rid of some of its hard-coded switches and constants that define the question types in a couple of places in the plugin's code (locallib.php and the question class), and replace them with a "registry object", which could be accessible through a new triggered event (Event API), once the module's initialization phase is completed. Since the configuration of the question types is already saved in one of the database tables, it would simply be a question of adding maybe two more fields to it, in order to store a FQCN and a template name for each question type. This would allow projects to extend the question types from other plugins (local plugins, for example), while avoiding to modify the code of this plugin, or having to apply patches on each upgrade (more easily maintainable code over time).

Are there any chances that such a PR would get merged? If so, we would have something for you very shortly.

Many thanks in advance!

Andrew

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions