|
|
|
|
@ -58,7 +58,12 @@ class HotSpot extends Question { |
|
|
|
|
if(!isset($_GET['editQuestion'])) |
|
|
|
|
{ |
|
|
|
|
$form->addElement('file','imageUpload',get_lang('UploadJpgPicture')); |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
$form->addRule('imageUpload', get_lang('OnlyJPG'), 'mimetype',array('image/jpeg','image/pjpeg','image/gif','image/png')); |
|
|
|
|
*/ |
|
|
|
|
$form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif')); |
|
|
|
|
|
|
|
|
|
$form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -68,8 +73,8 @@ class HotSpot extends Question { |
|
|
|
|
parent::processCreation ($form, $objExercise); |
|
|
|
|
if(!empty($file_info['tmp_name'])) |
|
|
|
|
{ |
|
|
|
|
$this->uploadPicture($file_info['tmp_name'], $file_info['name']); |
|
|
|
|
list($width,$height) = @getimagesize($file_info['tmp_name']); |
|
|
|
|
$this->uploadPicture($file_info['tmp_name'], $file_info['name']); |
|
|
|
|
list($width,$height) = @getimagesize($file_info['tmp_name']); |
|
|
|
|
if($width>=$height) { |
|
|
|
|
$this->resizePicture('width',544); |
|
|
|
|
} else { |
|
|
|
|
@ -94,4 +99,4 @@ class HotSpot extends Question { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
endif; |
|
|
|
|
?> |
|
|
|
|
?> |
|
|
|
|
|