next up previous contents
Next: quiz/edit.php 題目編輯修改 Up: 試題編輯 Previous: 程式變動   Contents

edit_question_form.php 編輯格式修改

  1. 如果已經有輸入解答,不要再自動新增「空白」的解答選項輸入欄位。
    [root@dywang html]# diff -urNwbBE moodle/question/type/edit_question_form.php moodle23/question/type/edit_question_form.php 
    --- moodle/question/type/edit_question_form.php	2012-06-26 01:15:25.000000000 +0800
    +++ moodle23/question/type/edit_question_form.php	2014-04-28 10:46:50.721980397 +0800
    @@ -329,7 +329,7 @@
             } else {
                 $countanswers = 0;
             }
    -        if ($this->question->formoptions->repeatelements) {
    +        if ($this->question->formoptions->repeatelements and $countanswers == 0 ) { 
                 $repeatsatstart = max($minoptions, $countanswers + $addoptions);
             } else {
                 $repeatsatstart = $countanswers;
    
  2. 新增「倒扣」比例選項。
    @@ -395,6 +395,10 @@
                 0.2500000,
                 0.2000000,
                 0.1000000,
    +            0.0500000,
    +            0.0300000,
    +            0.0200000,
    +            0.0100000,
                 0.0000000
             );
             if (!empty($this->question->penalty) && !in_array($this->question->penalty, $penalties)) {
    
  3. 預設「倒扣」比例由 0.3333333 改為 0.2。
    @@ -409,7 +413,7 @@
                     get_string('penaltyforeachincorrecttry', 'question'), $penaltyoptions);
             $mform->addRule('penalty', null, 'required', null, 'client');
             $mform->addHelpButton('penalty', 'penaltyforeachincorrecttry', 'question');
    -        $mform->setDefault('penalty', 0.3333333);
    +        $mform->setDefault('penalty', 0.2); //dywang
     
             if (isset($this->question->hints)) {
                 $counthints = count($this->question->hints);
    



2017-08-04