From: thepurpleblob Date: Thu, 1 May 2008 12:21:55 +0000 (+0000) Subject: MDL-14406 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3f5633df1140dad0543f9d62702e9473e073849f;p=moodle.git MDL-14406 Ensure 'length' field for description type questions is 0 and that default for all questions is 0 Merged from STABLE_19 --- diff --git a/question/format.php b/question/format.php index b8fad63be8..32dabeccb0 100644 --- a/question/format.php +++ b/question/format.php @@ -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 diff --git a/question/format/gift/format.php b/question/format/gift/format.php index fc144b5dc2..506efa5076 100755 --- a/question/format/gift/format.php +++ b/question/format/gift/format.php @@ -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: diff --git a/question/format/xml/format.php b/question/format/xml/format.php index e2e77039e5..6d1f3e4ee5 100755 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -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; }