Bulk change of question penalty

Bulk change of question penalty

by Mike Jackson -
Number of replies: 4

I have imported hundreds of questions from a question bank, but all of the questions have the "penalty for each incorrect try" set to 100%, which means I can't use the interactive with multiple tries option. Is there a way to changethe penalty for all the questions in the bank to say 20%.

Alternatively is there away to set this for a quiz so that it overrides the question settings?

Average of ratings: -
In reply to Mike Jackson

Re: Bulk change of question penalty

by Mike Jackson -
I have not had any replies or suggestions. Can I use PHPmyadmin to go in and edit the question bank tables? If so, does anyone know where they are and what they are called?
In reply to Mike Jackson

Re: Bulk change of question penalty

by Jean-Michel Védrine -

Hello Mike,

Yes phpMyAdmin will work to do what you want. Penalties are in the (yourprefix)_question table (for most Moodle installations (yourprefix) is mdl if you didn't specify another prefix during Moodle's installation) in the penalty field. I suggest to only change it for questions where it is set to 100% using something like

UPDATE `mdl_question` SET `penalty`='0.3333333' WHERE `penalty`='1.0000000';

Of course change the 0.3333333 value to whatever you want.

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

Re: Bulk change of question penalty

by Mike Jackson -
Thanks, Jean-Michel! That sounds like it should work exactly as I want.
In reply to Jean-Michel Védrine

Re: Bulk change of question penalty

by Jaswinder Singh -
Picture of Testers Picture of Translators

Thanks Jean-Michel,

You are awesome.It really helped me a lot.

Thank again