Various forms of overrides Hi, my friends!

Sometimes, making an override of a contributed module consists only of: in template.php, copy the function we want to modify and change its prefix "theme" for "my_theme". But this is not enough.

Speaking of the Quiz module:

1. I need to modify the multichoice-alternative.tpl.php file. This file contains functions. But, there is only one foreach, and within it is what I want to change. How do I override it?

2. I need to modify the multichoice.classes.inc file. This file has functions without the prefix "theme". So, I can not replace "theme" for "my_theme" in order to make the override.

Help me!
Copy multichoice-alternative.tpl.php to your theme's templates folder. Make your changes in this file. 

In your theme's template.php file you are also allowed to create process and preprocess functions for any theme function. So, you could create 

function THEME_preprocess_multichoice_alternative(&amp;$variables) {, 

wherein you could add/subtract/alter any variable within $variables. This would allow you to pass such variables through to the multichoice-alternative.tpl.php file, which in your case now resides in your own theme's templates folder.

As to overriding the class, first see if what you need done can be done in the theme layer. If that fails you can always create your own class to inherit from class MultichoiceQuestion, make your changes, then look for the code instantiating instances of the parent class and replace with your own class. And if you do make a note so that when you upgrade the module you can make the changes again.

BTW, it is the norm in Drupal  to put more complex processing (PHP) in the default template process and preprocess functions instead of the template file, and to just put enough processing in the template file to print out the variables and do some conditional logic to assist with that.