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

Source for file adminhp.php

Documentation is available at adminhp.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. *    HotPotatoes administration.
  23. *    @package dokeos.exercise
  24. *     @author Istvan Mandak
  25. *     @version $Id: adminhp.php 13476 2007-10-12 11:38:16Z elixir_inter $
  26. */
  27.  
  28.  
  29.  
  30. include('exercise.class.php');
  31. include('question.class.php');
  32. include('answer.class.php');
  33.  
  34. include('exercise.lib.php');
  35.  
  36. // name of the language file that needs to be included
  37. $language_file='exercice';
  38.  
  39. include('../inc/global.inc.php');
  40. $this_section=SECTION_COURSES;
  41.  
  42. if(isset($_REQUEST["cancel"]))
  43. {
  44.     if($_REQUEST["cancel"]==get_lang('Cancel'))
  45.     {
  46.                 header("Location: exercice.php");
  47.     }
  48. }
  49.  
  50. //$is_courseAdmin = $_SESSION['is_courseAdmin'];
  51. $newName (!empty($_REQUEST['newName'])?$_REQUEST['newName']:'');
  52. $hotpotatoesName (!empty($_REQUEST['hotpotatoesName'])?$_REQUEST['hotpotatoesName']:'');
  53.  
  54. // answer types
  55. define(UNIQUE_ANSWER,    1);
  56. define(MULTIPLE_ANSWER,    2);
  57. define(FILL_IN_BLANKS,    3);
  58. define(MATCHING,        4);
  59. define(FREE_ANSWER,     5);
  60.  
  61. // allows script inclusions
  62. define(ALLOWED_TO_INCLUDE,1);
  63.  
  64. $is_allowedToEdit=api_is_allowed_to_edit();
  65.  
  66. // document path
  67. $documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
  68.  
  69. // picture path
  70. $picturePath=$documentPath.'/images';
  71.  
  72. // audio path
  73. $audioPath=$documentPath.'/audio';
  74.  
  75.  
  76.  
  77. // Database table definitions
  78. $TBL_EXERCICE_QUESTION        Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
  79. $TBL_EXERCICES                Database::get_course_table(TABLE_QUIZ_TEST);
  80. $TBL_QUESTIONS                Database::get_course_table(TABLE_QUIZ_QUESTION);
  81. $TBL_REPONSES                Database::get_course_table(TABLE_QUIZ_ANSWER);
  82. $TBL_DOCUMENT                Database::get_course_table(TABLE_DOCUMENT);
  83. $dbTable                    $TBL_DOCUMENT;
  84.  
  85. if(!$is_allowedToEdit)
  86. {
  87.     api_not_allowed(true);
  88. }
  89.  
  90. $interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
  91.  
  92. $nameTools get_lang('adminHP');
  93.  
  94. Display::display_header($nameTools,"Exercise");
  95.  
  96. /** @todo probably wrong !!!! */
  97. require_once(api_get_path(SYS_CODE_PATH).'/exercice/hotpotatoes.lib.php');
  98.  
  99. ?>
  100.  
  101. <h4>
  102.   <?php echo $nameTools?>
  103. </h4>
  104.  
  105. <?php
  106. if(isset($newName))
  107. {
  108.         if($newName!="")
  109.         {
  110.             //alter database record for that test
  111.             SetComment($hotpotatoesName,$newName);
  112.             echo "<script language='Javascript' type='text/javascript'> window.location='exercice.php'; </script>";
  113.         }
  114. }
  115.  
  116. echo "<form action=\"".api_get_self()."\" method='post' name='form1'>";
  117. echo "<input type=\"hidden\" name=\"hotpotatoesName\" value=\"$hotpotatoesName\">";
  118. echo "<input type=\"text\" name=\"newName\" value=\"";
  119.  
  120.  
  121. $lstrComment "";
  122. $lstrComment GetComment($hotpotatoesName);
  123. if($lstrComment=="")
  124.     $lstrComment GetQuizName($hotpotatoesName,$documentPath);
  125. if($lstrComment=="")
  126.     $lstrComment GetFileName($hotpotatoesName,$documentPath);
  127.  
  128. echo $lstrComment;
  129. echo "\" size=40>&nbsp;";
  130. echo "<input type=\"submit\" name=\"submit\" value=\"".get_lang('Ok')."\">&nbsp;";
  131. echo "<input type=\"button\" name=\"cancel\" value=\"".get_lang('Cancel')."\" onclick=\"javascript:document.form1.newName.value='';\">";
  132.  
  133. echo "</form>";
  134.  
  135. ?>
  136. <?php
  137.  
  138.  
  139. ?>

Documentation generated on Thu, 12 Jun 2008 12:54:47 -0500 by phpDocumentor 1.4.1