Added initialisation method for question object. Permits setting of default

values for required (but not imported) database fields.
Bug #4752
This commit is contained in:
thepurpleblob 2006-02-13 14:46:26 +00:00
parent acb0c2d93e
commit 42e5993199

View File

@ -138,6 +138,21 @@ class quiz_default_format {
}
function defaultquestion() {
// returns an "empty" question
// Somewhere to specify question parameters that are not handled
// by import but are required db fields.
// This should not be overridden.
$question = new stdClass();
$question->shuffleanswers = 0;
$question->defaultgrade = 1;
$question->image = "";
$question->usecase = 0;
$question->multiplier = array();
return $question;
}
function readquestion($lines) {
/// Given an array of lines known to define a question in
/// this format, this function converts it into a question