[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. 6
      main/exercice/freeanswer.class.php
  4. 14
      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
* @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 use the Database:: functions
@ -331,14 +331,14 @@ function display_hotspot_answer($answerId, $answer, $studentChoice, $answerComme
"#F7BDE2");
?>
<tr>
<td valign="top" align="left">
<td width="100px" valign="top" align="left">
<div style="width:100%;">
<div style="height:11px; width:11px; background-color:<?php echo $hotspot_colors[$answerId]; ?>; float:left; margin:3px;"></div>
<div><?php echo $answer ?></div>
</div>
</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
$my_choice = ($studentChoice)?get_lang('Correct'):get_lang('Fault'); echo $my_choice; ?>
</td>

@ -168,6 +168,10 @@ class FillBlanks extends Question
$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);

@ -49,7 +49,11 @@ class FreeAnswer extends Question {
*/
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)) {
$form -> setDefaults(array('weighting' => float_format($this->weighting, 1)));
} else {

@ -55,15 +55,27 @@ class HotSpot extends Question {
function createForm ($form) {
parent::createForm ($form);
global $text, $class;
if(!isset($_GET['editQuestion'])) {
$renderer = $form->defaultRenderer();
$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" />');
// 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');
$form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
$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) {

@ -325,7 +325,7 @@ if($modifyAnswers)
</td>
</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">
<!--
// Version check based upon the values entered above in "Globals"

@ -159,6 +159,7 @@ class Matching extends Question {
$group = array();
$group[] = FormValidator :: createElement ('style_submit_button', 'lessMatches', get_lang('DelElem'),'class="minus"');
$group[] = FormValidator :: createElement ('style_submit_button', 'moreMatches', get_lang('AddElem'),'class="plus"');
$form -> addGroup($group);
////////////////////////
@ -196,9 +197,15 @@ class Matching extends Question {
}
$form -> addElement ('html', '</table></div></div>');
$group = array();
$group[] = FormValidator :: createElement ('style_submit_button', 'lessOptions', get_lang('DelElem'),'class="minus"');
$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 -> setDefaults($defaults);
$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', '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;','submitQuestion');
$renderer->setElementTemplate('{element}','moreAnswers');
$form -> addElement ('html', '</div></div>');

@ -27,7 +27,7 @@
* It is included from the script admin.php
* @package dokeos.exercise
* @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
$objQuestion -> createAnswersForm ($form);
// submit button
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<div class="row"><div class="label">{label}</div><div class="formw">{element}</div></div>','submitQuestion');
// submit button is implemented in every question type
//$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
//$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', '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}','moreAnswers');

Loading…
Cancel
Save