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

Source for file hotspot_save.inc.php

Documentation is available at hotspot_save.inc.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. *    This file generates the ActionScript code used by the HotSpot .swf
  23. *    @package dokeos.exercise
  24. *     @author Toon Keppens
  25. *     @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
  26. */
  27.  
  28.  
  29. include('exercise.class.php');
  30. include('question.class.php');
  31. include('answer.class.php');
  32. include('../inc/global.inc.php');
  33.  
  34. $questionId $_GET['questionId'];
  35. $answerId $_GET['answerId'];
  36.  
  37. if ($_GET['type'== "square" || $_GET['type'== "circle")
  38. {
  39.     $hotspot_type $_GET['type'];
  40.     $hotspot_coordinates $_GET['x'].";".$_GET['y']."|".$_GET['width']."|".$_GET['height'];
  41. }
  42. if ($_GET['type'== "poly")
  43. {
  44.     $hotspot_type $_GET['type'];
  45.     $tmp_coord explode(",",$_GET['co']);
  46.     $i 0;
  47.     $hotspot_coordinates "";
  48.     foreach ($tmp_coord as $coord)
  49.     {
  50.         if ($i%== 0)
  51.         {
  52.             $delimiter ";";
  53.         }
  54.         else
  55.         {
  56.             $delimiter "|";
  57.         }
  58.         $hotspot_coordinates .= $coord.$delimiter;
  59.         $i++;
  60.     }
  61.     $hotspot_coordinates substr($hotspot_coordinates,0,-2);
  62. }
  63. $sql "UPDATE `$TBL_ANSWER` SET `hotspot_coordinates` = '$hotspot_coordinates',`hotspot_type` = '$hotspot_type' WHERE `id` =$answerId AND `question_id` =$questionId LIMIT 1 ;";
  64. $result api_sql_query($sql,__FILE__,__LINE__);
  65. echo "done=done";
  66. ?>

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