123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
- /* For licensing terms, see /license.txt */
- /**
- * HotPotatoes administration.
- * @package chamilo.exercise
- * @author Istvan Mandak
- * @version $Id: adminhp.php 20089 2009-04-24 21:12:54Z cvargas1 $
- */
- /**
- * Code
- */
- require_once 'exercise.class.php';
- require_once 'question.class.php';
- require_once 'answer.class.php';
- // name of the language file that needs to be included
- $language_file='exercice';
- require_once '../inc/global.inc.php';
- $this_section=SECTION_COURSES;
- if (isset($_REQUEST["cancel"])) {
- if ($_REQUEST["cancel"]==get_lang('Cancel')) {
- header("Location: exercice.php");
- }
- }
- $newName = (!empty($_REQUEST['newName'])?$_REQUEST['newName']:'');
- $hotpotatoesName = (!empty($_REQUEST['hotpotatoesName'])?$_REQUEST['hotpotatoesName']:'');
- $is_allowedToEdit = api_is_allowed_to_edit(null,true);
- // document path
- $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
- // picture path
- $picturePath=$documentPath.'/images';
- // audio path
- $audioPath=$documentPath.'/audio';
- // Database table definitions
- if (!$is_allowedToEdit) {
- api_not_allowed(true);
- }
- if (isset($_SESSION['gradebook'])) {
- $gradebook= $_SESSION['gradebook'];
- }
- if (!empty($gradebook) && $gradebook=='view') {
- $interbreadcrumb[]= array (
- 'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
- 'name' => get_lang('ToolGradebook')
- );
- }
- $interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
- $nameTools = get_lang('adminHP');
- Display::display_header($nameTools,"Exercise");
- /** @todo probably wrong !!!! */
- require_once api_get_path(SYS_CODE_PATH).'exercice/hotpotatoes.lib.php';
- $urlMainExercise = api_get_path(WEB_CODE_PATH).'exercice/';
- ?>
- <h4>
- <?php echo $nameTools; ?>
- </h4>
- <?php
- if (isset($newName)) {
- if ($newName!="") {
- //alter database record for that test
- SetComment($hotpotatoesName,$newName);
- echo "<script type='text/javascript'>window.location='".$urlMainExercise."exercice.php'; </script>";
- }
- }
- echo "<form action=\"".$urlMainExercise."adminhp.php\" method='post' name='form1'>";
- echo "<input type=\"hidden\" name=\"hotpotatoesName\" value=\"$hotpotatoesName\">";
- echo "<input type=\"text\" name=\"newName\" value=\"";
- $lstrComment = "";
- $lstrComment = GetComment($hotpotatoesName);
- if ($lstrComment=="") {
- $lstrComment = GetQuizName($hotpotatoesName,$documentPath);
- }
- if ($lstrComment=="") {
- $lstrComment = basename($hotpotatoesName,$documentPath);
- }
- echo $lstrComment;
- echo "\" size=40> ";
- echo "<button type=\"submit\" class=\"save\" name=\"submit\" value=\"".get_lang('Ok')."\">".get_lang('Ok')."</button>";
- echo "<button type=\"button\" class=\"cancel\" name=\"cancel\" value=\"".get_lang('Cancel')."\" onclick=\"javascript:document.form1.newName.value='';\">".get_lang('Cancel')."</button>";
- echo "</form>";
- Display::display_footer();
|