From: gustav_delius Date: Mon, 20 Mar 2006 20:59:46 +0000 (+0000) Subject: Moved the quiz constants into lib.php to keep things simple. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=75cd257be824d0287b73c4e0b59ddd9f55c01809;p=moodle.git Moved the quiz constants into lib.php to keep things simple. --- diff --git a/mod/quiz/backuplib.php b/mod/quiz/backuplib.php index b2c9a2c6c9..fc2093feca 100644 --- a/mod/quiz/backuplib.php +++ b/mod/quiz/backuplib.php @@ -105,7 +105,7 @@ //Insert necessary category ids to backup_ids table function insert_category_ids ($course,$backup_unique_code,$instances=null) { global $CFG; - include_once("$CFG->dirroot/mod/quiz/constants.php"); + include_once("$CFG->dirroot/mod/quiz/lib.php"); //Create missing categories and reasign orphaned questions fix_orphaned_questions($course); diff --git a/mod/quiz/constants.php b/mod/quiz/constants.php deleted file mode 100644 index f626064139..0000000000 --- a/mod/quiz/constants.php +++ /dev/null @@ -1,51 +0,0 @@ -review -* These constants help to extract the options -*/ -/** -* The first 6 bits refer to the time immediately after the attempt -*/ -define('QUIZ_REVIEW_IMMEDIATELY', 64-1); -/** -* the next 6 bits refer to the time after the attempt but while the quiz is open -*/ -define('QUIZ_REVIEW_OPEN', 4096-64); -/** -* the final 6 bits refer to the time after the quiz closes -*/ -define('QUIZ_REVIEW_CLOSED', 262144-4096); - -// within each group of 6 bits we determine what should be shown -define('QUIZ_REVIEW_RESPONSES', 1+64+4096); // Show responses -define('QUIZ_REVIEW_SCORES', 2*4161); // Show scores -define('QUIZ_REVIEW_FEEDBACK', 4*4161); // Show feedback -define('QUIZ_REVIEW_ANSWERS', 8*4161); // Show correct answers -// Some handling of worked solutions is already in the code but not yet fully supported -// and not switched on in the user interface. -define('QUIZ_REVIEW_SOLUTIONS', 16*4161); // Show solutions -// the 6th bit is as yet unused -/**#@-*/ - -/** -* If start and end date for the quiz are more than this many seconds apart -* they will be represented by two separate events in the calendar -*/ -define("QUIZ_MAX_EVENT_LENGTH", "432000"); // 5 days maximum - -?> diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index ebc8eed8db..de7a4d2218 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -13,6 +13,41 @@ require_once($CFG->libdir.'/pagelib.php'); require_once($CFG->dirroot.'/mod/quiz/constants.php'); +/// CONSTANTS /////////////////////////////////////////////////////////////////// + +/**#@+ + * The different review options are stored in the bits of $quiz->review + * These constants help to extract the options + */ +/** + * The first 6 bits refer to the time immediately after the attempt + */ +define('QUIZ_REVIEW_IMMEDIATELY', 64-1); +/** + * the next 6 bits refer to the time after the attempt but while the quiz is open + */ +define('QUIZ_REVIEW_OPEN', 4096-64); +/** + * the final 6 bits refer to the time after the quiz closes + */ +define('QUIZ_REVIEW_CLOSED', 262144-4096); + +// within each group of 6 bits we determine what should be shown +define('QUIZ_REVIEW_RESPONSES', 1+64+4096); // Show responses +define('QUIZ_REVIEW_SCORES', 2*4161); // Show scores +define('QUIZ_REVIEW_FEEDBACK', 4*4161); // Show feedback +define('QUIZ_REVIEW_ANSWERS', 8*4161); // Show correct answers +// Some handling of worked solutions is already in the code but not yet fully supported +// and not switched on in the user interface. +define('QUIZ_REVIEW_SOLUTIONS', 16*4161); // Show solutions +// the 6th bit is as yet unused +/**#@-*/ + +/** + * If start and end date for the quiz are more than this many seconds apart + * they will be represented by two separate events in the calendar + */ +define("QUIZ_MAX_EVENT_LENGTH", "432000"); // 5 days maximum /// FUNCTIONS ///////////////////////////////////////////////////////////////////