dokeos-exercise
[ class tree: dokeos-exercise ] [ index: dokeos-exercise ] [ all elements ]

Source for file hotspot.class.php

Documentation is available at hotspot.class.php

  1. <?php
  2. /*
  3.     DOKEOS - elearning and course management software
  4.  
  5.     For a full list of contributors, see documentation/credits.html
  6.  
  7.     This program is free software; you can redistribute it and/or
  8.     modify it under the terms of the GNU General Public License
  9.     as published by the Free Software Foundation; either version 2
  10.     of the License, or (at your option) any later version.
  11.     See "documentation/licence.html" more details.
  12.  
  13.     Contact:
  14.         Dokeos
  15.         Rue des Palais 44 Paleizenstraat
  16.         B-1030 Brussels - Belgium
  17.         Tel. +32 (2) 211 34 56
  18. */
  19.  
  20.  
  21. /**
  22. *    File containing the HotSpot class.
  23. *    @package dokeos.exercise
  24. *     @author Eric Marguin
  25. *     @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
  26. */
  27.  
  28.  
  29. if(!class_exists('HotSpot')):
  30.  
  31. /**
  32.     CLASS HotSpot
  33.  *
  34.  *    This class allows to instantiate an object of type HotSpot (MULTIPLE CHOICE, UNIQUE ANSWER),
  35.  *    extending the class question
  36.  *
  37.  *    @author Eric Marguin
  38.  *    @package dokeos.exercise
  39.  ***/
  40.  
  41. class HotSpot extends Question {
  42.  
  43.     static $typePicture 'hotspot.gif';
  44.     static $explanationLangVar 'Hotspot';
  45.  
  46.  
  47.     function HotSpot(){
  48.         parent::question();
  49.         $this -> type = HOT_SPOT;
  50.     }
  51.  
  52.     function display(){
  53.  
  54.     }
  55.  
  56.     function createForm ($form{
  57.         parent::createForm ($form);
  58.         if(!isset($_GET['editQuestion']))
  59.         {
  60.             $form->addElement('file','imageUpload',get_lang('UploadJpgPicture'));
  61.             $form->addRule('imageUpload'get_lang('OnlyJPG')'mimetype',array('image/jpeg','image/pjpeg','image/gif','image/png'));
  62.             $form->addRule('imageUpload'get_lang('NoImage')'uploadedfile');
  63.         }
  64.     }
  65.  
  66.     function processCreation ($form$objExercise{
  67.         $file_info $form -> getSubmitValue('imageUpload');
  68.         parent::processCreation ($form$objExercise);
  69.         if(!empty($file_info['tmp_name']))
  70.         {
  71.             $this->uploadPicture($file_info['tmp_name']$file_info['name']);
  72.             list($width,$heightgetimagesize($file_info['tmp_name']);
  73.             if($width>=$height)
  74.                 $this->resizePicture('width',544);
  75.             else
  76.                 $this->resizePicture('height',408);
  77.             $this->save();
  78.         }
  79.     }
  80.  
  81.     function createAnswersForm ($form{
  82.  
  83.         // nothing
  84.  
  85.     }
  86.  
  87.     function processAnswersCreation ($form{
  88.  
  89.         // nothing
  90.  
  91.     }
  92.  
  93. }
  94.  
  95. endif;
  96. ?>

Documentation generated on Thu, 12 Jun 2008 13:39:19 -0500 by phpDocumentor 1.4.1