changing question defaults on import

Re: changing question defaults on import

by Tim Hunt -
Number of replies: 0
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That is a good suggestion. Although, if you do the import / export / import, you will end up with two copies of each question, one of which is wrong, which is not great.

So, and alternative would be to just directly create the necessary Moodle XML format file from scratch, then import that.

A more dangerous solution, if you have already imported these questions, would be to bulk-fix them in the database, by running a query like
    UPDATE mdl_qtype_essay_options SET attachments = 1
    WHERE questionid (SELECT id FROM mdl_question WHERE qtype = 'essay' and cateogry = 123)
That requires being able to find the right category, and this is dangerous because of you mess up this sort of thing, you can destroy your database.

Or, to answer your original question, you can change what defaults GIFT import uses, but only by editing this bit of Moodle code: https://github.com/moodle/moodle/blob/b3cfb01316b83869c50c4d22078e5fde283178c1/question/format/gift/format.php#L328