Q:

SQL statement to set numbering style for all multiple choice questions in a Moodle course

I'm looking for an SQL statement to remove the numbering of choices for all multiple choice questions in a Moodle question category.
(Changing "Number the choices?" from "a.,b.,c.,.." to "No numbering", for all questions in a course, or in a category.)
Any help would be greatly appreciated.

A:

I asked the same question on Moodle Developer Forums and got the answer from Stuart Mealor and Tim Hunt (Moodle in English: Useful SQL Queries?). In short, it is the following:
UPDATE mdl_qtype_multichoice_options
SET answernumbering = 'none'
WHERE questionid IN (SELECT id FROM mdl_question WHERE category = 123)

The table and field names might depend on the Moodle version. In 2.5.9, the following statement worked for me:
UPDATE mdl_question_multichoice
SET answernumbering = 'none'
WHERE question IN
    (SELECT id FROM mdl_question
     WHERE category = 7);

