Default setting for NUMBER THE CHOICES? (Moodle 2.1.1)

Default setting for NUMBER THE CHOICES? (Moodle 2.1.1)

by Sam Mudle -
Number of replies: 9

Is there a way to set the default selected item on NUMBER THE CHOICES to A. B. C rather than lowercase a, b, c?

It's annoying to have to set this on every quiz question I write. I'm willing to hack the database to fix this.

Average of ratings: -
In reply to Sam Mudle

Re: Default setting for NUMBER THE CHOICES? (Moodle 2.1.1)

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

You can't do this in the database. You need to edit the code: https://github.com/moodle/moodle/blob/master/question/type/multichoice/edit_multichoice_form.php#L59

Change abc there to ABCD.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Default setting for NUMBER THE CHOICES? (Moodle 2.1.1)

by Sam Mudle -

Ah thank you kind sir!

big grin

In reply to Sam Mudle

Re: Default setting for NUMBER THE CHOICES? (Moodle 2.1.1)

by Azhar Ghani -

And, to put the default setting to "No Numbering"  (Moodle 1.9)??

In reply to Azhar Ghani

Re: Default setting for NUMBER THE CHOICES? (Moodle 2.1.1)

by Jean-Michel Védrine -

in the question/type/multichoice/edit_multichoice_form.php
change the line
$mform->setDefault('answernumbering', 'abc');
to
$mform->setDefault('answernumbering', 'none');

Just a side note Azhar : I see you have posted several messages in these forums in the last days asking for Moodle code customizations (and I have answered some of them big grin). In my opinion you should really think twice before doing so many changes to your Moodle files : it will be really painfull for you when you will want to upgrade your Moodle to a new version in a few months ! If I were you, I would certainly not do it (this is a lesson I have learned the hard way).

Average of ratings: Useful (1)
In reply to Jean-Michel Védrine

Re: Default setting for NUMBER THE CHOICES? (Moodle 2.1.1)

by Azhar Ghani -

Thanx Jean.. I am extremely grateful for your support and advice.. I don 't plan to upgrade in near future... In our environments 1.9 will be perfect

In reply to Jean-Michel Védrine

Re: Default setting for NUMBER THE CHOICES? (Moodle 2.1.1)

by Alexander Kuptsov -

Hello Sir,

I'm using Moodle 3.1

I did change to $mform->setDefault('answernumbering', 'none'); however it didn't work. Do you have any ideas why, please? I have to import a lot of questions in GIFT format and due to some reasons in my multiple choice questions the numbering should be set to 'No numbering' which means for me opening lots of windows and manually setting this.

Could you please tell me how to fix that? I'd so much appreciate it.

Thank you.


PS I see that the threat subtitle says that I'm using 2.1, but in fact it's 3.1.

In reply to Alexander Kuptsov

Re: Default setting for NUMBER THE CHOICES? (Moodle 2.1.1)

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

What do you mean it does not work? What exactly is happening?

In reply to Alexander Kuptsov

Re: Default setting for NUMBER THE CHOICES? (Moodle 2.1.1)

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

The default above is for the form used to add a question manually. If you are importing from GIFT or AIKEN, the default is set instead in the import code. Try changing https://github.com/moodle/moodle/blob/master/question/format.php#L627.