MDL-14406

Ensure 'length' field for description type questions is 0 and that
default for all questions is 0

Merged from STABLE_19
This commit is contained in:
thepurpleblob 2008-05-01 12:21:55 +00:00
parent 64fcd675f7
commit 3f5633df11
3 changed files with 8 additions and 0 deletions

View File

@ -392,6 +392,7 @@ class qformat_default {
}
return $category;
}
/**
* Return complete file within an array, one item per line
* @param string filename name of file
@ -474,6 +475,7 @@ class qformat_default {
$question->incorrectfeedback = '';
$question->answernumbering = 'abc';
$question->penalty = 0.1;
$question->length = 1;
// this option in case the questiontypes class wants
// to know where the data came from
@ -550,6 +552,7 @@ class qformat_default {
return $newfile;
}
/*******************
* EXPORT FUNCTIONS
*******************/
@ -703,6 +706,7 @@ class qformat_default {
fclose($fh);
return true;
}
/**
* get the category as a path (e.g., tom/dick/harry)
* @param int id the id of the most nested catgory

View File

@ -277,6 +277,8 @@ class qformat_gift extends qformat_default {
switch ($question->qtype) {
case DESCRIPTION:
$question->defaultgrade = 0;
$question->length = 0;
return $question;
break;
case ESSAY:

View File

@ -302,6 +302,8 @@ class qformat_xml extends qformat_default {
$qo = $this->import_headers( $question );
// header parts particular to shortanswer
$qo->qtype = DESCRIPTION;
$qo->defaultgrade = 0;
$qo->length = 0;
return $qo;
}