[svn r10623] Adding label to upload field

http://www.dokeos.com/forum/viewtopic.php?t=7817
skala
Bart Mollet 18 years ago
parent 01df855aa5
commit c40dfc0755
  1. 54
      main/exercice/hotspot.class.php

@ -1,70 +1,70 @@
<?php // $Id: hotspot.class.php 10234 2006-12-26 <?php // $Id: hotspot.class.php 10234 2006-12-26
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A. Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent) Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL) Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert Copyright (c) Olivier Brouckaert
For a full list of contributors, see "credits.txt". For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt". The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. of the License, or (at your option) any later version.
See the GNU General Public License for more details. See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
============================================================================== ==============================================================================
*/ */
/** /**
============================================================================== ==============================================================================
* File containing the HotSpot class. * File containing the HotSpot class.
* *
* @author Eric Marguin * @author Eric Marguin
* @package dokeos.exercise * @package dokeos.exercise
============================================================================== ==============================================================================
*/ */
if(!class_exists('HotSpot')): if(!class_exists('HotSpot')):
/** /**
CLASS HotSpot CLASS HotSpot
* *
* This class allows to instantiate an object of type HotSpot (MULTIPLE CHOICE, UNIQUE ANSWER), * This class allows to instantiate an object of type HotSpot (MULTIPLE CHOICE, UNIQUE ANSWER),
* extending the class question * extending the class question
* *
* @author Eric Marguin * @author Eric Marguin
* @package dokeos.exercise * @package dokeos.exercise
**/ **/
class HotSpot extends Question { class HotSpot extends Question {
function HotSpot(){ function HotSpot(){
parent::question(); parent::question();
$this -> type = HOT_SPOT; $this -> type = HOT_SPOT;
} }
function display(){ function display(){
} }
function createForm ($form) { function createForm ($form) {
parent::createForm ($form); parent::createForm ($form);
if(!isset($_GET['editQuestion'])) if(!isset($_GET['editQuestion']))
{ {
$form->addElement('file','imageUpload'); $form->addElement('file','imageUpload',get_lang('UploadFile'));
$form->addRule('imageUpload', get_lang('OnlyJPG'), 'mimetype','image/jpeg'); $form->addRule('imageUpload', get_lang('OnlyJPG'), 'mimetype','image/jpeg');
$form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile'); $form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile');
} }
} }
function processCreation ($form, $objExercise) { function processCreation ($form, $objExercise) {
$file_info = $form -> getSubmitValue('imageUpload'); $file_info = $form -> getSubmitValue('imageUpload');
parent::processCreation ($form, $objExercise); parent::processCreation ($form, $objExercise);
if(!empty($file_info['tmp_name'])) if(!empty($file_info['tmp_name']))
{ {
@ -73,19 +73,19 @@ class HotSpot extends Question {
} }
echo '<script type="text/javascript">window.location.href="admin.php?hotspotadmin='.$this->id.'"</script>'; echo '<script type="text/javascript">window.location.href="admin.php?hotspotadmin='.$this->id.'"</script>';
} }
function createAnswersForm ($form) { function createAnswersForm ($form) {
// nothing // nothing
} }
function processAnswersCreation ($form) { function processAnswersCreation ($form) {
// nothing // nothing
} }
} }
endif; endif;

Loading…
Cancel
Save