[svn r22049] FS#2867 - The exercises tool: Eliminating the global variable $fck_attribute within the file multiple_answer.class.php.

skala
Ivan Tcholakov 17 years ago
parent 78d9d0faec
commit c5bd76007a
  1. 2
      main/exercice/matching.class.php
  2. 13
      main/exercice/multiple_answer.class.php
  3. 2
      main/inc/lib/fckeditor/toolbars/answer.php

@ -139,8 +139,6 @@ class Matching extends Question {
</tr>';
$form -> addElement ('html', $html);
//$form -> addElement ('html_editor', 'answer','<img src="../img/fill_field.png">','id="answer" cols="122" rows="6" onkeyup="updateBlanks(this)"');
for($i = 1 ; $i <= $nb_matches ; ++$i) {
$form -> addElement ('html', '<tr><td>');
$group = array();

@ -63,15 +63,6 @@ class MultipleAnswer extends Question {
*/
function createAnswersForm ($form) {
global $fck_attribute;
$fck_attribute = array();
//$fck_attribute['Width'] = '348px';
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '100px';
$fck_attribute['ToolbarSet'] = 'Answer';
$fck_attribute['Config']['ToolbarStartExpanded']='false';
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 2;
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
@ -140,9 +131,9 @@ class MultipleAnswer extends Question {
$form->addElement('checkbox', 'correct['.$i.']', null, null, 'class="checkbox" style="margin-left: 0em;"');
$boxes_names[] = 'correct['.$i.']';
$form->addElement('html_editor', 'answer['.$i.']',null, 'style="vertical-align:middle"');
$form->addElement('html_editor', 'answer['.$i.']',null, 'style="vertical-align:middle"', array('ToolbarSet' => 'Answer', 'Width' => '100%', 'Height' => '100'));
$form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle"');
$form->addElement('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle"', array('ToolbarSet' => 'Answer', 'Width' => '100%', 'Height' => '100'));
$form->addElement('text', 'weighting['.$i.']',null, 'style="vertical-align:middle;margin-left: 0em;" size="5" value="10"');
$form -> addElement ('html', '</tr>');
}

@ -23,7 +23,7 @@ $config['ToolbarSets']['Maximized'] = array(
// Sets how the editor's toolbar should start - expanded or collapsed.
// Possible values: true , false
//$config['ToolbarStartExpanded'] = true;
$config['ToolbarStartExpanded'] = false;
//This option sets the location of the toolbar.
// Possible values: 'In' , 'None' , 'Out:[TargetId]' , 'Out:[TargetWindow]([TargetId])'

Loading…
Cancel
Save