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

Improve the way that qbank plugins can modify the edit question form


    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.4, Future Dev
    • Questions

      In the question edit form,  question/type/edit_question_form.php

      Near the top of the form there is this old-style callback https://github.com/moodle/moodle/blob/master/question/type/edit_question_form.php#L214-L226, but only if you are editing an existing question, and since it is right at the top, you cannot control where your new fields go in relation to the other fields.

      it would help qbank plugins to manage and position their fields more easily. 

      So, it not moving a piece of code, but adding a new funcitionality.
      Here I propose to add a new plugin_feature for qbank plugins allowing them to introduce and manage any fields into the question edit form. 

      The proposal includes:

      • new class question_edit_handler_base.php to manage  instance_form_definition, instance_form_save and data
      • new function get_question_handler()  in plugin_features extending this class (or customfield_handler
      • Substituting customfieldhandler in edit_question_form by an array of form  handlers loaded form qbank plugins
      • Substituting customfieldhandler  in question/bank/editquestion/question.php this these handlers to take care of instance_form_before_set_data() and instance_form_save
      • A new helper get_all_qbank_plugin_features() into engine/bank.php to be able to consult features if any enabled plugins.

            Unassigned Unassigned
            ecastro Enrique Castro
            0 Vote for this issue
            4 Start watching this issue


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