diff --git a/main/exercice/fill_blanks.class.php b/main/exercice/fill_blanks.class.php index c505e12244..6e8b84e53e 100644 --- a/main/exercice/fill_blanks.class.php +++ b/main/exercice/fill_blanks.class.php @@ -58,25 +58,56 @@ class FillBlanks extends Question { */ function createAnswersForm ($form) { + + + $defaults = array(); + + if(!empty($this->id)) + { + $objAnswer = new answer($this->id); + $a_answer = explode('::', $objAnswer->selectAnswer(1)); + $defaults['answer'] = $a_answer[0]; + $a_weightings = explode(',',$a_answer[1]); + } + else + { + $defaults['answer'] = get_lang('DefaultTextInBlanks'); + } + // javascript echo ' @@ -89,17 +120,6 @@ class FillBlanks extends Question { $form -> addRule ('answer',get_lang('GiveText'),'required'); $form -> addRule ('answer',get_lang('DefineBlanks'),'regex','/\[.*\]/'); - $defaults = array(); - - if(!empty($this->id)) - { - $objAnswer = new answer($this->id); - $defaults['answer'] = $objAnswer->selectAnswer(1); - } - else - { - $defaults['answer'] = get_lang('DefaultTextInBlanks'); - } $form -> addElement('html','
');