MDL-20538 get rid of badly name-spaced constants from lib/questionlib.php.

Unfortunately, they are used all over the import/export code, so I cannot eliminate them completely. However, I was able to move them out of the core library.
This commit is contained in:
Tim Hunt
2011-06-09 19:27:36 +01:00
parent 6911fa130b
commit 55190d7e2c
5 changed files with 48 additions and 20 deletions
+24 -1
View File
@@ -27,6 +27,29 @@
defined('MOODLE_INTERNAL') || die();
/**#@+
* The core question types.
*
* These used to be in lib/questionlib.php, but are being deprecated. Copying
* them here to keep the import/export code working for now (there are 135
* references to these constants which I don't want to try to fix at the moment.)
*/
if (!defined('SHORTANSWER')) {
define("SHORTANSWER", "shortanswer");
define("TRUEFALSE", "truefalse");
define("MULTICHOICE", "multichoice");
define("RANDOM", "random");
define("MATCH", "match");
define("RANDOMSAMATCH", "randomsamatch");
define("DESCRIPTION", "description");
define("NUMERICAL", "numerical");
define("MULTIANSWER", "multianswer");
define("CALCULATED", "calculated");
define("ESSAY", "essay");
}
/**#@-*/
/**
* Base class for question import and export formats.
*
@@ -697,7 +720,7 @@ class qformat_default {
}
// do not export random questions
if ($question->qtype==RANDOM) {
if ($question->qtype == 'random') {
continue;
}