|
|
|
@ -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) { |
|
|
|
|