MDL-72553 qbank_customfields: Add custom fields for question types
Custom fields can now be added to question types. Site administrators can configure the custom fields and filed types available. Teachers and question creators can then use these fields for extra question metadata when creating questions. Question creators can control if the fields are displayed to students when they are taking a quiz or not. This features uses the core Moodle custom field API. Co-Authored-By: Matt Porritt <[email protected]> Co-Authored-By: Safat Shahin <[email protected]> Co-Authored-By: Marc-Alexandre Ghaly <[email protected]>
This commit is contained in:
committed by
Safat Shahin
co-authored by
Safat Shahin
Marc-Alexandre Ghaly
parent
51149a78cc
commit
556e2f1aec
@@ -377,6 +377,10 @@ function question_delete_question($questionid) {
|
||||
// Delete all tag instances.
|
||||
core_tag_tag::remove_all_item_tags('core_question', 'question', $question->id);
|
||||
|
||||
// Delete the custom filed data for the question.
|
||||
$customfieldhandler = qbank_customfields\customfield\question_handler::create();
|
||||
$customfieldhandler->delete_instance($question->id);
|
||||
|
||||
// Now recursively delete all child questions
|
||||
if ($children = $DB->get_records('question',
|
||||
array('parent' => $questionid), '', 'id, qtype')) {
|
||||
|
||||
Reference in New Issue
Block a user