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

Source for file hotspot_updatescore.inc.php

Documentation is available at hotspot_updatescore.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 saves every click in the hotspot tool into track_e_hotspots
  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.  
  35. $courseCode   $_GET['coursecode'];
  36. $questionId   $_GET['questionId'];
  37. $coordinates  $_GET['coord'];
  38. $objExcercise $_SESSION['objExercise'];
  39. $hotspotId      $_GET['hotspotId'];
  40. $exerciseId   $objExcercise->selectId();
  41. if ($_GET['answerId'== "0"// click is NOT on a hotspot
  42. {
  43.     $hit 0;
  44.     $answerId $hotspotId;
  45.  
  46.     // remove from session
  47.     unset($_SESSION['exerciseResult'][$questionId][$answerId]);
  48.  
  49.     // Save clicking order
  50.     //$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['order'])+1;
  51.     //$_SESSION['exerciseResult'][$questionId]['order'][$answerOrderId] = $answerId;
  52. }
  53. else // user clicked ON a hotspot
  54. {
  55.     $hit 1;
  56.     $answerId $hotspotId;
  57.  
  58.     // Save into session
  59.     $_SESSION['exerciseResult'][$questionId][$answerId$hit;
  60.  
  61.     // Save clicking order
  62.     //$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['order'])+1;
  63.     //$_SESSION['exerciseResult'][$questionId]['order'][$answerOrderId] = $answerId;
  64. }
  65.  
  66. $TBL_TRACK_E_HOTSPOT   Database::get_statistic_table(STATISTIC_TRACK_E_HOTSPOTS);
  67.  
  68. // update db
  69. $update_id $_SESSION['exerciseResult'][$questionId]['ids'][$answerId];
  70. $sql "UPDATE $TBL_TRACK_E_HOTSPOT SET `coordinate` = '".$coordinates."' WHERE `id` =$update_id LIMIT 1 ;;";
  71. $result api_sql_query($sql,__FILE__,__LINE__);
  72. ?>

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