[svn r20331] Save question button now is align with other buttons see FS#3991

skala
Julio Montoya 17 years ago
parent 7cc3614f4c
commit 15825b5255
  1. 6
      main/exercice/exercise_show.php
  2. 4
      main/exercice/fill_blanks.class.php
  3. 4
      main/exercice/freeanswer.class.php
  4. 12
      main/exercice/hotspot.class.php
  5. 2
      main/exercice/hotspot_admin.inc.php
  6. 7
      main/exercice/matching.class.php
  7. 6
      main/exercice/multiple_answer.class.php
  8. 11
      main/exercice/question_admin.inc.php
  9. 6
      main/exercice/unique_answer.class.php

@ -4,7 +4,7 @@
* *
* @package dokeos.exercise * @package dokeos.exercise
* @author Julio Montoya Armas Added switchable fill in blank option added * @author Julio Montoya Armas Added switchable fill in blank option added
* @version $Id: exercise_show.php 20305 2009-05-04 22:31:34Z iflorespaz $ * @version $Id: exercise_show.php 20331 2009-05-05 15:17:55Z juliomontoya $
* *
* @todo remove the debug code and use the general debug library * @todo remove the debug code and use the general debug library
* @todo use the Database:: functions * @todo use the Database:: functions
@ -331,14 +331,14 @@ function display_hotspot_answer($answerId, $answer, $studentChoice, $answerComme
"#F7BDE2"); "#F7BDE2");
?> ?>
<tr> <tr>
<td valign="top" align="left"> <td width="100px" valign="top" align="left">
<div style="width:100%;"> <div style="width:100%;">
<div style="height:11px; width:11px; background-color:<?php echo $hotspot_colors[$answerId]; ?>; float:left; margin:3px;"></div> <div style="height:11px; width:11px; background-color:<?php echo $hotspot_colors[$answerId]; ?>; float:left; margin:3px;"></div>
<div><?php echo $answer ?></div> <div><?php echo $answer ?></div>
</div> </div>
</td> </td>
<td valign="top" align="left"><?php echo $answerId; ?></td> <td valign="top" align="left"><?php echo $answerId; ?></td>
<td valign="top" align="left"> <td width="50px" style="padding-right:15px" valign="top" align="left">
<?php <?php
$my_choice = ($studentChoice)?get_lang('Correct'):get_lang('Fault'); echo $my_choice; ?> $my_choice = ($studentChoice)?get_lang('Correct'):get_lang('Fault'); echo $my_choice; ?>
</td> </td>

@ -168,6 +168,10 @@ class FillBlanks extends Question
$form -> addElement('html','<div id="blanks_weighting"></div>'); $form -> addElement('html','<div id="blanks_weighting"></div>');
global $text, $class;
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
$form -> setDefaults($defaults); $form -> setDefaults($defaults);

@ -50,6 +50,10 @@ class FreeAnswer extends Question {
function createAnswersForm ($form) function createAnswersForm ($form)
{ {
$form -> addElement('text','weighting',get_lang('Weighting'),'size="5"'); $form -> addElement('text','weighting',get_lang('Weighting'),'size="5"');
global $text, $class;
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
if(!empty($this->id)) { if(!empty($this->id)) {
$form -> setDefaults(array('weighting' => float_format($this->weighting, 1))); $form -> setDefaults(array('weighting' => float_format($this->weighting, 1)));
} else { } else {

@ -55,15 +55,27 @@ class HotSpot extends Question {
function createForm ($form) { function createForm ($form) {
parent::createForm ($form); parent::createForm ($form);
global $text, $class;
if(!isset($_GET['editQuestion'])) { if(!isset($_GET['editQuestion'])) {
$renderer = $form->defaultRenderer(); $renderer = $form->defaultRenderer();
$form->addElement('html', '<div class="row"><div class="label"></div><div class="formw">'.get_lang('UploadJpgPicture').'</div></div>'); $form->addElement('html', '<div class="row"><div class="label"></div><div class="formw">'.get_lang('UploadJpgPicture').'</div></div>');
$form->addElement('file','imageUpload','<span class="form_required">*</span><img src="../img/hotspots.png" />'); $form->addElement('file','imageUpload','<span class="form_required">*</span><img src="../img/hotspots.png" />');
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
$renderer->setElementTemplate('<div class="row"><div class="label" style="margin-top:-30px;">{label}</div><div class="formw" >{element}</div></div>','imageUpload'); $renderer->setElementTemplate('<div class="row"><div class="label" style="margin-top:-30px;">{label}</div><div class="formw" >{element}</div></div>','imageUpload');
$form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif')); $form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
$form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile'); $form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile');
} else {
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
} }
} }
function processCreation ($form, $objExercise) { function processCreation ($form, $objExercise) {

@ -325,7 +325,7 @@ if($modifyAnswers)
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" valign="top" style="border:1px solid #4271b5;border-top:none"> <td colspan="2" valign="top" style="border:1px solid #ccc;border-top:none">
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
// Version check based upon the values entered above in "Globals" // Version check based upon the values entered above in "Globals"

@ -159,6 +159,7 @@ class Matching extends Question {
$group = array(); $group = array();
$group[] = FormValidator :: createElement ('style_submit_button', 'lessMatches', get_lang('DelElem'),'class="minus"'); $group[] = FormValidator :: createElement ('style_submit_button', 'lessMatches', get_lang('DelElem'),'class="minus"');
$group[] = FormValidator :: createElement ('style_submit_button', 'moreMatches', get_lang('AddElem'),'class="plus"'); $group[] = FormValidator :: createElement ('style_submit_button', 'moreMatches', get_lang('AddElem'),'class="plus"');
$form -> addGroup($group); $form -> addGroup($group);
//////////////////////// ////////////////////////
@ -196,9 +197,15 @@ class Matching extends Question {
} }
$form -> addElement ('html', '</table></div></div>'); $form -> addElement ('html', '</table></div></div>');
$group = array(); $group = array();
$group[] = FormValidator :: createElement ('style_submit_button', 'lessOptions', get_lang('DelElem'),'class="minus"'); $group[] = FormValidator :: createElement ('style_submit_button', 'lessOptions', get_lang('DelElem'),'class="minus"');
$group[] = FormValidator :: createElement ('style_submit_button', 'moreOptions',get_lang('AddElem'),'class="plus"'); $group[] = FormValidator :: createElement ('style_submit_button', 'moreOptions',get_lang('AddElem'),'class="plus"');
global $text, $class;
// setting the save button here and not in the question class.php
$group[] = FormValidator :: createElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
$form -> addGroup($group); $form -> addGroup($group);
$form -> setDefaults($defaults); $form -> setDefaults($defaults);
$form->setConstants(array('nb_matches' => $nb_matches,'nb_options' => $nb_options)); $form->setConstants(array('nb_matches' => $nb_matches,'nb_options' => $nb_options));

@ -152,7 +152,13 @@ class MultipleAnswer extends Question {
$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="minus"'); $form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"'); $form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
global $text, $class;
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
$renderer->setElementTemplate('{element}&nbsp;','lessAnswers'); $renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
$renderer->setElementTemplate('{element}&nbsp;','submitQuestion');
$renderer->setElementTemplate('{element}','moreAnswers'); $renderer->setElementTemplate('{element}','moreAnswers');
$form -> addElement ('html', '</div></div>'); $form -> addElement ('html', '</div></div>');

@ -27,7 +27,7 @@
* It is included from the script admin.php * It is included from the script admin.php
* @package dokeos.exercise * @package dokeos.exercise
* @author Olivier Brouckaert * @author Olivier Brouckaert
* @version $Id: question_admin.inc.php 19675 2009-04-09 08:46:51Z pcool $ * @version $Id: question_admin.inc.php 20331 2009-05-05 15:17:55Z juliomontoya $
*/ */
/* /*
@ -111,10 +111,11 @@ if(is_object($objQuestion))
// answer form elements // answer form elements
$objQuestion -> createAnswersForm ($form); $objQuestion -> createAnswersForm ($form);
// submit button // submit button is implemented in every question type
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
$renderer = $form->defaultRenderer(); //$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
$renderer->setElementTemplate('<div class="row"><div class="label">{label}</div><div class="formw">{element}</div></div>','submitQuestion'); //$renderer = $form->defaultRenderer();
//$renderer->setElementTemplate('<div class="row"><div class="label">{label}</div><div class="formw">{element}</div></div>','submitQuestion');
/********************** /**********************

@ -261,6 +261,12 @@ class UniqueAnswer extends Question {
$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="minus"'); $form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="minus"');
$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"'); $form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="plus"');
global $text, $class;
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
$renderer->setElementTemplate('{element}','submitQuestion');
$renderer->setElementTemplate('{element}&nbsp;','lessAnswers'); $renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
$renderer->setElementTemplate('{element}','moreAnswers'); $renderer->setElementTemplate('{element}','moreAnswers');

Loading…
Cancel
Save