type = HOT_SPOT; } function display(){ } function createForm ($form) { parent::createForm ($form); if(!isset($_GET['editQuestion'])) { $form->addElement('file','imageUpload',get_lang('UploadJpgPicture')); $form->addRule('imageUpload', get_lang('OnlyJPG'), 'mimetype',array('image/jpeg','image/pjpeg')); $form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile'); } } function processCreation ($form, $objExercise) { $file_info = $form -> getSubmitValue('imageUpload'); parent::processCreation ($form, $objExercise); if(!empty($file_info['tmp_name'])) { $this->uploadPicture($file_info['tmp_name'], $file_info['name']); $this->resizePicture('any',350); $this->save(); } } function createAnswersForm ($form) { // nothing } function processAnswersCreation ($form) { // nothing } } endif; ?>