diff --git a/main/exercice/admin.php b/main/exercice/admin.php index ae15e88b2d..3b893a6ebf 100755 --- a/main/exercice/admin.php +++ b/main/exercice/admin.php @@ -429,7 +429,7 @@ Display::display_header($nameTools,'Exercise'); echo '
'; echo Display::return_icon('preview.gif', get_lang('Preview')).''.get_lang('Preview').''; -echo Display::return_icon('edit.gif', get_lang('ModifyExercise')).''.get_lang('ModifyExercise').''; +echo Display::return_icon('edit.gif', get_lang('ModifyExercise')).''.get_lang('ModifyExercise').''; if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid'])) echo Display::return_icon('message_reply_forum.png', get_lang('GoBackToQuestionList')).' '.''.get_lang('GoBackToQuestionList').'
'; diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index 8ac90d5f7e..796859b7f8 100755 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -773,7 +773,7 @@ if (($is_allowedToEdit) and ($origin != 'learnpath')) { if ($_GET['show'] != 'result') { echo '' . Display :: return_icon('new_test.gif', get_lang('NewEx')) . get_lang('NewEx') . ''; echo '' . Display :: return_icon('question_add.gif', get_lang('AddQuestionToExercise')) . get_lang('AddQuestionToExercise') . ''; - echo '' . Display :: return_icon('jqz.gif', get_lang('ImportHotPotatoesQuiz')) . get_lang('ImportHotPotatoesQuiz') . ''; + echo '' . Display :: return_icon('jqz.gif', get_lang('ImportHotPotatoesQuiz')) . get_lang('ImportHotPotatoesQuiz') . ''; echo '' . Display :: return_icon('show_test_results.gif', get_lang('Results')) . get_lang('Results') . ''; } @@ -892,7 +892,7 @@ if ($show == 'test') { //echo ''; ?> - <?php echo api_htmlentities(get_lang('Edit'),ENT_QUOTES,$charset); ?> + <?php echo api_htmlentities(get_lang('Edit'),ENT_QUOTES,$charset); ?> - ')) return false;"> <?php echo api_htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?> + ')) return false;"> <?php echo api_htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?> - <?php echo api_htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?> + <?php echo api_htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?> - <?php echo api_htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?> + <?php echo api_htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?> "; @@ -1051,21 +1051,21 @@ if ($show == 'test') { > - <?php echo api_htmlentities(get_lang('Modify'),ENT_QUOTES,$charset); ?> + <?php echo api_htmlentities(get_lang('Modify'),ENT_QUOTES,$charset); ?> <?php echo api_htmlentities(get_lang('Edit'),ENT_QUOTES,$charset); ?> - ')) return false;"><?php echo api_htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?> + ')) return false;"><?php echo api_htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?> - <?php echo api_htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?> + <?php echo api_htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?> - <?php echo api_htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?> + <?php echo api_htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?> @@ -1297,12 +1297,12 @@ if ($_configuration['tracking_enabled'] && ($show == 'result')) { if ($revised) { //echo "".Display :: return_icon('edit.gif', get_lang('Edit')); //echo ' '; - $html_link.= "".Display :: return_icon('edit.gif', get_lang('Edit')); + $html_link.= "".Display :: return_icon('edit.gif', get_lang('Edit')); $html_link.= ' '; } else { //echo "".Display :: return_icon('quizz_small.gif', get_lang('Qualify')); //echo ' '; - $html_link.="".Display :: return_icon('quizz_small.gif', get_lang('Qualify')); + $html_link.="".Display :: return_icon('quizz_small.gif', get_lang('Qualify')); $html_link.=' '; } //echo ""; @@ -1310,19 +1310,19 @@ if ($_configuration['tracking_enabled'] && ($show == 'result')) { if (api_is_platform_admin() || $is_tutor) { //echo ' '.Display :: return_icon('delete.gif', get_lang('Delete')).''; //echo ' '; - $html_link.=' '.Display :: return_icon('delete.gif', get_lang('Delete')).''; + $html_link.=' '.Display :: return_icon('delete.gif', get_lang('Delete')).''; $html_link.=' '; } if ($is_allowedToEdit) { //echo ' ' .Display :: return_icon('history.gif', get_lang('ViewHistoryChange')).''; if ($filter==2){ - $html_link.=' ' .Display :: return_icon('history.gif', get_lang('ViewHistoryChange')).''; + $html_link.=' ' .Display :: return_icon('history.gif', get_lang('ViewHistoryChange')).''; } } } else { if ($revised) { //echo "" . get_lang('Show') . " "; - $html_link.="" . get_lang('Show') . " "; + $html_link.="" . get_lang('Show') . " "; } else { // echo ' ' . get_lang('NoResult'); diff --git a/main/exercice/exercice_submit.php b/main/exercice/exercice_submit.php index fb5dae463e..c88c876e1b 100755 --- a/main/exercice/exercice_submit.php +++ b/main/exercice/exercice_submit.php @@ -978,10 +978,10 @@ if ($origin != 'learnpath') { //so we are not in learnpath tool } // I'm in a preview mode -if (api_is_course_admin() && $origin != 'learnpath') { +if (api_is_course_admin() && $origin != 'learnpath') { echo '
'; echo Display :: return_icon('quiz.gif', get_lang('GoBackToEx')) . '' . get_lang('GoBackToEx') . ''; - echo Display :: return_icon('edit.gif', get_lang('ModifyExercise')) . '' . get_lang('ModifyExercise') . ''; + echo Display :: return_icon('edit.gif', get_lang('ModifyExercise')) . '' . get_lang('ModifyExercise') . ''; echo '
'; } //Timer control @@ -1094,7 +1094,7 @@ if (!empty ($error)) { $s2 = "&exerciseId=" . $exerciseId; } - $s .= "
+ $s .= " diff --git a/main/exercice/exercise_admin.php b/main/exercice/exercise_admin.php index 75613c552c..83de2d9c96 100755 --- a/main/exercice/exercise_admin.php +++ b/main/exercice/exercise_admin.php @@ -145,11 +145,11 @@ $objExercise = new Exercise(); * INIT FORM *********************/ if(isset($_GET['exerciseId'])) { - $form = new FormValidator('exercise_admin', 'post', api_get_self().'?exerciseId='.$_GET['exerciseId']); + $form = new FormValidator('exercise_admin', 'post', api_get_self().'?'.api_get_cidreq().'&exerciseId='.$_GET['exerciseId']); $objExercise -> read (intval($_GET['exerciseId'])); $form -> addElement ('hidden','edit','true'); } else { - $form = new FormValidator('exercise_admin'); + $form = new FormValidator('exercise_admin','post',api_get_self().'?'.api_get_cidreq()); $form -> addElement ('hidden','edit','false'); } diff --git a/main/exercice/exercise_result.php b/main/exercice/exercise_result.php index 622e4e3772..50ce26daf9 100755 --- a/main/exercice/exercise_result.php +++ b/main/exercice/exercise_result.php @@ -450,7 +450,7 @@ DISPLAY AND MAIN PROCESS if (api_is_course_admin() && $origin != 'learnpath') { echo '
'; echo Display::return_icon('quiz.gif', get_lang('GoBackToEx')).''.get_lang('GoBackToEx').''; - echo Display::return_icon('edit.gif', get_lang('ModifyExercise')).''.get_lang('ModifyExercise').''; + echo Display::return_icon('edit.gif', get_lang('ModifyExercise')).''.get_lang('ModifyExercise').''; echo '
'; } @@ -463,7 +463,7 @@ $exerciseTitle=api_parse_tex($exerciseTitle); - + diff --git a/main/exercice/feedback.php b/main/exercice/feedback.php index cbe22edf8d..f871295703 100755 --- a/main/exercice/feedback.php +++ b/main/exercice/feedback.php @@ -75,7 +75,7 @@ Display::display_header($nameTools,"Exercise"); echo " "; $ans = $objAnswerTmp->answer[$i]; - $form = new FormValidator('feedbackform','post',api_get_self()."?modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion); + $form = new FormValidator('feedbackform','post',api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion); $obj_registration_form = new HTML_QuickForm('frmRegistration', 'POST'); $renderer =& $obj_registration_form->defaultRenderer(); $renderer->setElementTemplate( diff --git a/main/exercice/hotpotatoes.php b/main/exercice/hotpotatoes.php index c45ae49ff6..6d527c0cb2 100755 --- a/main/exercice/hotpotatoes.php +++ b/main/exercice/hotpotatoes.php @@ -30,14 +30,14 @@ $language_file ='exercice'; // including the global Dokeos file -include('../inc/global.inc.php'); +require_once '../inc/global.inc.php'; // include additional libraries -include_once(api_get_path(LIBRARY_PATH).'fileUpload.lib.php'); -include_once(api_get_path(LIBRARY_PATH).'document.lib.php'); -include_once(api_get_path(LIBRARY_PATH).'fileManage.lib.php'); -include_once(api_get_path(LIBRARY_PATH)."pclzip/pclzip.lib.php"); -include("hotpotatoes.lib.php"); +require_once (api_get_path(LIBRARY_PATH).'fileUpload.lib.php'); +require_once (api_get_path(LIBRARY_PATH).'document.lib.php'); +require_once (api_get_path(LIBRARY_PATH).'fileManage.lib.php'); +require_once (api_get_path(LIBRARY_PATH)."pclzip/pclzip.lib.php"); +require_once 'hotpotatoes.lib.php'; // section (for the tabs) $this_section=SECTION_COURSES; @@ -222,7 +222,7 @@ if((api_is_allowed_to_edit(null,true)) && (($finish == 0) || ($finish == 2))) } if ($finish == 1) { /** ok -> send to main exercises page */ - header("Location: exercice.php"); + header('Location: exercice.php?'.api_get_cidreq()); exit; } @@ -246,7 +246,7 @@ if((api_is_allowed_to_edit(null,true)) && (($finish == 0) || ($finish == 2))) UPLOAD SECTION --------------------------------------*/ echo "\n", - "\n", + "\n", "\n", "\n", "\n", diff --git a/main/exercice/question.class.php b/main/exercice/question.class.php index ed31ad8fa7..3ad2cc9aea 100755 --- a/main/exercice/question.class.php +++ b/main/exercice/question.class.php @@ -20,10 +20,6 @@ define('MATCHING', 4); define('FREE_ANSWER', 5); define('HOT_SPOT', 6); define('HOT_SPOT_ORDER', 7); -define('HOT_SPOT_DELINEATION', 8); -define('MULTIPLE_ANSWER_COMBINATION', 9); - - /** CLASS QUESTION @@ -54,8 +50,7 @@ abstract class Question FILL_IN_BLANKS => array('fill_blanks.class.php' , 'FillBlanks'), MATCHING => array('matching.class.php' , 'Matching'), FREE_ANSWER => array('freeanswer.class.php' , 'FreeAnswer'), - HOT_SPOT => array('hotspot.class.php' , 'HotSpot'), - MULTIPLE_ANSWER_COMBINATION => array('multiple_answer_combination.class.php' , 'MultipleAnswerCombination'), + HOT_SPOT => array('hotspot.class.php' , 'HotSpot') ); /** @@ -89,11 +84,10 @@ abstract class Question $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); $TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION); $TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION); - $sql="SELECT question,description,ponderation,position,type,picture,level FROM $TBL_QUESTIONS WHERE id='".Database::escape_string($id)."'"; $result=Database::query($sql,__FILE__,__LINE__); - + // if the question has been found if($object=Database::fetch_object($result)) { @@ -1097,21 +1091,21 @@ abstract class Question eval('$explanation = get_lang('.$a_type[1].'::$explanationLangVar);'); echo '
  • '; echo ''; echo '
  • '; } echo '
  • '; echo '
    '; if ($feedbacktype==1) { - echo $url = ''; + echo $url = ''; } else { - echo $url = ''; + echo $url = ''; } echo Display::return_icon('database.png', get_lang('GetExistingQuestion'), ''); - echo '
    '; + echo '
    '; echo $url; echo get_lang('GetExistingQuestion'); echo ''; diff --git a/main/exercice/question_admin.inc.php b/main/exercice/question_admin.inc.php index 700026ce44..d14b3cf0de 100755 --- a/main/exercice/question_admin.inc.php +++ b/main/exercice/question_admin.inc.php @@ -52,7 +52,7 @@ if(!defined('ALLOWED_TO_INCLUDE')) if(isset($_GET['editQuestion'])) { $objQuestion = Question::read ($_GET['editQuestion']); - $action = api_get_self()."?modifyQuestion=".$modifyQuestion."&editQuestion=".$objQuestion->id; + $action = api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&editQuestion=".$objQuestion->id; if (isset($exerciseId) && !empty($exerciseId)) { @@ -67,7 +67,7 @@ if(isset($_GET['editQuestion'])) } else { $objQuestion = Question :: getInstance($_REQUEST['answerType']); - $action = api_get_self()."?modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion; + $action = api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion; } if(is_object($objQuestion)) diff --git a/main/exercice/question_create.php b/main/exercice/question_create.php index dcd240e4f7..edf6e6f612 100755 --- a/main/exercice/question_create.php +++ b/main/exercice/question_create.php @@ -51,7 +51,7 @@ $nameTools=get_lang('AddQuestionToExercise'); // The form -$form = new FormValidator('add_question','post'); +$form = new FormValidator('add_question','post',api_get_self().'?'.api_get_cidreq()); // form title $form->addElement('header','',get_lang('AddQuestionToExercise')); diff --git a/main/exercice/question_list_admin.inc.php b/main/exercice/question_list_admin.inc.php index 085a54cd1a..0cf225fe9e 100755 --- a/main/exercice/question_list_admin.inc.php +++ b/main/exercice/question_list_admin.inc.php @@ -114,10 +114,10 @@ if($nbrQuestions) { selectLevel(); ?> - <?php echo get_lang('Modify'); ?> - <?php echo get_lang('Delete'); ?> + <?php echo get_lang('Modify'); ?> + <?php echo get_lang('Delete'); ?> - <?php echo get_lang('MoveUp'); ?> + <?php echo get_lang('MoveUp'); ?> '; } @@ -127,7 +127,7 @@ if($nbrQuestions) { echo ''; } ?> - <?php echo get_lang('MoveDown'); ?> + <?php echo get_lang('MoveDown'); ?> addToList($recup); api_session_register('objExercise'); - header("Location: admin.php?exerciseId=$fromExercise"); + header("Location: admin.php?".api_get_cidreq()."&exerciseId=$fromExercise"); exit(); } else if( isset($_POST['recup']) && is_array($_POST['recup']) && $fromExercise) { $list_recup = $_POST['recup']; @@ -156,7 +156,7 @@ if($is_allowedToEdit) $objExercise->addToList($recup); } api_session_register('objExercise'); - header("Location: admin.php?exerciseId=$fromExercise"); + header("Location: admin.php?".api_get_cidreq()."&exerciseId=$fromExercise"); exit(); } }