]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14406
authorthepurpleblob <thepurpleblob>
Thu, 1 May 2008 12:21:55 +0000 (12:21 +0000)
committerthepurpleblob <thepurpleblob>
Thu, 1 May 2008 12:21:55 +0000 (12:21 +0000)
Ensure 'length' field for description type questions is 0 and that
default for all questions is 0

Merged from STABLE_19

question/format.php
question/format/gift/format.php
question/format/xml/format.php

index b8fad63be8f030564091e054fc3f27b69e2b2d75..32dabeccb08432758fc86a41e68165433241c3cf 100644 (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
index fc144b5dc2c70fe1377f11b8c0f418ea0699baf0..506efa507656729a028c2f343d2a0161b6d0e785 100755 (executable)
@@ -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:
index e2e77039e54c17d50dda9a8d40b444b47fa00d5b..6d1f3e4ee5de75b0f34f4658b2e10bf110678bfb 100755 (executable)
@@ -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;
     }