-
Bug
-
Resolution: Fixed
-
Major
-
2.0
-
None
-
MOODLE_20_STABLE
-
MOODLE_21_STABLE
-
1/ globals in library files are very strongly discouraged - please use functions instead
2/ in is not acceptable to place initialisation code into library file with PHP functions
3/ the define("RANDOM", "random"); should have some prefix - I know no other library or module is dumb enough to do this, but it is not nice a all to have this in core code
4/ question_register_questiontype(new question_calculated_qtype()); in the middle of function definitions is horrible - we have real plugin infrastructure in place now, there is no need to do things like this any more
5/ the names of plugins should be always in language packs - preferable $string['pluginname'] in the corresponding lang pack - hardcoding them in get_name() is ugly
6/ the name of the question type classes should start with qtype_xxxx and qformat_yyyy for question formats - not sure is it is not too late this
7/ all functions in questionlib.php shoudl have prefix question (ex.:get_grade_options(), delete_attempt()) - we have only one global scope, with should not pollute it with such general function names
8/ etc.
The main problem here is that the whole structure of questions subsystem is very non-standard - now is the only time to fix things, we will not be able to break BC and fix sloppy designs of API in the next 10 years
- will be (partly) resolved by
-
MDL-20636 META: Question engine re-write
- Closed