diff --git a/main/exercice/fill_blanks.class.php b/main/exercice/fill_blanks.class.php index 275e15f59b..f9399dfde7 100644 --- a/main/exercice/fill_blanks.class.php +++ b/main/exercice/fill_blanks.class.php @@ -68,7 +68,7 @@ class FillBlanks extends Question $fck_attribute = array(); //$fck_attribute['Width'] = '348px'; $fck_attribute['Width'] = '100%'; - $fck_attribute['Height'] = '450px'; + $fck_attribute['Height'] = '350px'; $fck_attribute['ToolbarSet'] = 'Full'; diff --git a/main/exercice/freeanswer.class.php b/main/exercice/freeanswer.class.php index 3035192d05..86f6c0a406 100644 --- a/main/exercice/freeanswer.class.php +++ b/main/exercice/freeanswer.class.php @@ -47,20 +47,16 @@ class FreeAnswer extends Question { * function which redifines Question::createAnswersForm * @param the formvalidator instance */ - function createAnswersForm ($form) { - + function createAnswersForm ($form) + { $form -> addElement('text','weighting',get_lang('Weighting'),'size="5"'); - if(!empty($this->id)) - { - $form -> setDefaults(array('weighting' => $this->weighting)); - } - else { + if(!empty($this->id)) { + $form -> setDefaults(array('weighting' => float_format($this->weighting, 1))); + } else { $form -> setDefaults(array('weighting' => '10')); } - } - /** * abstract function which creates the form to create / edit the answers of the question * @param the formvalidator instance diff --git a/main/exercice/matching.class.php b/main/exercice/matching.class.php index a32b903411..d73cae1d38 100644 --- a/main/exercice/matching.class.php +++ b/main/exercice/matching.class.php @@ -74,25 +74,19 @@ class Matching extends Question { if(isset($_POST['moreOptions'])) $nb_options++; - } - else if(!empty($this -> id)) - { + } else if(!empty($this -> id)) { $answer = new Answer($this -> id); $answer -> read(); - if(count($answer->nbrAnswers)>0) - { + if(count($answer->nbrAnswers)>0) { $a_matches = $a_options = array(); $nb_matches = $nb_options = 0; for($i=1 ; $i<=$answer->nbrAnswers ; $i++){ - if($answer -> isCorrect($i)) - { + if ($answer -> isCorrect($i)) { $nb_matches++; - $defaults['answer['.$nb_matches.']'] = $answer -> selectAnswer($i); - $defaults['weighting['.$nb_matches.']'] = $answer -> selectWeighting($i); + $defaults['answer['.$nb_matches.']'] = $answer -> selectAnswer($i); + $defaults['weighting['.$nb_matches.']'] = float_format($answer -> selectWeighting($i),1); $defaults['matches['.$nb_matches.']'] = $answer -> correct[$i]; - } - else - { + } else { $nb_options++; $defaults['option['.$nb_options.']'] = $answer -> selectAnswer($i); } @@ -113,14 +107,9 @@ class Matching extends Question { $a_matches[$i] = chr(64+$i); // fill the array with A, B, C..... } - - - - $form -> addElement('hidden', 'nb_matches', $nb_matches); $form -> addElement('hidden', 'nb_options', $nb_options); - //////////////////////// // DISPLAY MATCHES //// ////////////////////// @@ -128,13 +117,13 @@ class Matching extends Question { $html='
+ | '.get_lang('Number').' | @@ -149,24 +138,21 @@ class Matching extends Question { |
---|---|---|
'); - $group = array(); $puce = FormValidator :: createElement ('text', null,null,'value="'.$i.'"'); $puce->freeze(); - $group[] = $puce; - $group[] = FormValidator :: createElement ('text', 'answer['.$i.']',null, 'size="30" style="margin-left: 0em;"'); - $group[] = FormValidator :: createElement ('select', 'matches['.$i.']',null,$a_matches); - $group[] = FormValidator :: createElement ('text', 'weighting['.$i.']',null, 'style="vertical-align:middle;margin-left: 0em;" size="2" value="10"'); + $group[] = $puce; + + $group[] = FormValidator :: createElement ('text', 'answer['.$i.']',null, 'size="40" style="margin-left: 0em;"'); + $group[] = FormValidator :: createElement ('select', 'matches['.$i.']',null,$a_matches); + $group[] = FormValidator :: createElement ('text', 'weighting['.$i.']',null, 'style="vertical-align:middle;margin-left: 0em;" size="5" value="10"'); $form -> addGroup($group, null, null, ' | '); - $form -> addElement ('html', ' |
+ | '.get_lang('Number').' | @@ -197,17 +181,14 @@ class Matching extends Question { |
---|---|---|
'); $group = array(); $puce = FormValidator :: createElement ('text', null,null,'value="'.chr(64+$i).'"'); $puce->freeze(); $group[] = $puce; - $group[] = FormValidator :: createElement ('text', 'option['.$i.']',null, 'size="30" style="margin-left: 0em;"'); + $group[] = FormValidator :: createElement ('text', 'option['.$i.']',null, 'size="40" style="margin-left: 0em;"'); $form -> addGroup($group, null, null, ' | '); $form -> addElement ('html', ' |