diff --git a/main/exercise/admin.php b/main/exercise/admin.php index 996e18d8c8..d488b174d4 100755 --- a/main/exercise/admin.php +++ b/main/exercise/admin.php @@ -205,7 +205,7 @@ if ($editQuestion || $newQuestion || $modifyQuestion || $modifyAnswers) { if ($editQuestion) { // question not found if (!$objQuestion = Question::read($editQuestion)) { - api_not_allowed(); + api_not_allowed(true); } // saves the object into the session Session::write('objQuestion', $objQuestion); @@ -250,7 +250,7 @@ if (!empty($clone_question) && !empty($objExercise->id)) { $old_question_obj = Question::read($clone_question); $old_question_obj->question = $old_question_obj->question.' - '.get_lang('Copy'); - $new_id = $old_question_obj->duplicate(); + $new_id = $old_question_obj->duplicate(api_get_course_info()); $new_question_obj = Question::read($new_id); $new_question_obj->addToList($exerciseId); @@ -285,7 +285,7 @@ if (api_is_in_gradebook()) { ); } -$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); +$interbreadcrumb[] = array("url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises')); if (isset($_GET['newQuestion']) || isset($_GET['editQuestion'])) { $interbreadcrumb[] = [ "url" => "admin.php?exerciseId=".$objExercise->id.'&'.api_get_cidreq(), diff --git a/main/exercise/exercise.class.php b/main/exercise/exercise.class.php index 31ef1dd4f9..eddecd068e 100755 --- a/main/exercise/exercise.class.php +++ b/main/exercise/exercise.class.php @@ -5855,8 +5855,6 @@ class Exercise ''; $msg .= $open_question_list; $msg .= '

'; - - $msg1 = str_replace("#exercise#", $this->exercise, $msg); $msg = str_replace("#firstName#", $user_info['firstname'], $msg1); $msg1 = str_replace("#lastName#", $user_info['lastname'], $msg); diff --git a/main/exercise/exercise.php b/main/exercise/exercise.php index e624ac2791..04d2b64ba7 100644 --- a/main/exercise/exercise.php +++ b/main/exercise/exercise.php @@ -586,7 +586,6 @@ $tableRows = []; if (!empty($exerciseList)) { if ($origin != 'learnpath') { //avoid sending empty parameters - $myorigin = (empty($origin) ? '' : '&origin='.$origin); $mylpid = (empty($learnpath_id) ? '' : '&learnpath_id='.$learnpath_id); $mylpitemid = (empty($learnpath_item_id) ? '' : '&learnpath_item_id='.$learnpath_item_id); $i = 1; @@ -725,7 +724,7 @@ if (!empty($exerciseList)) { $class_tip = 'link_tooltip'; } - $url = $move.' + $url = $move.' '.Display::return_icon('quiz.png', $row['title']).' '.$title.' '; @@ -873,7 +872,14 @@ if (!empty($exerciseList)) { $actions .= ''. Display::return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_SMALL).''; - $actions .= Display::url(Display::return_icon('cd.gif', get_lang('CopyExercise')), '', array('onclick' => "javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToCopy'), ENT_QUOTES, $charset))." ".addslashes($row['title'])."?"."')) return false;", 'href' => 'exercise.php?'.api_get_cidreq().'&choice=copy_exercise&sec_token='.$token.'&exerciseId='.$row['id'])); + $actions .= Display::url( + Display::return_icon('cd.gif', get_lang('CopyExercise')), + '', + array( + 'onclick' => "javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToCopy'), ENT_QUOTES, $charset))." ".addslashes($row['title'])."?"."')) return false;", + 'href' => 'exercise.php?'.api_get_cidreq().'&choice=copy_exercise&sec_token='.$token.'&exerciseId='.$row['id'] + ) + ); } // Delete @@ -887,7 +893,10 @@ if (!empty($exerciseList)) { ICON_SIZE_SMALL ), '', - array('onclick' => "javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToDeleteJS'), ENT_QUOTES, $charset))." ".addslashes($row['title'])."?"."')) return false;", 'href' => 'exercise.php?'.api_get_cidreq().'&choice=delete&sec_token='.$token.'&exerciseId='.$row['id']) + array( + 'onclick' => "javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToDeleteJS'), ENT_QUOTES, $charset))." ".addslashes($row['title'])."?"."')) return false;", + 'href' => 'exercise.php?'.api_get_cidreq().'&choice=delete&sec_token='.$token.'&exerciseId='.$row['id'] + ) ); } else { $actions .= Display::return_icon( @@ -945,7 +954,7 @@ if (!empty($exerciseList)) { continue; } - $url = ''. + $url = ''. $cut_title.''; // Link of the exercise. diff --git a/main/exercise/exercise_reminder.php b/main/exercise/exercise_reminder.php index 716a250411..ed6b91309b 100755 --- a/main/exercise/exercise_reminder.php +++ b/main/exercise/exercise_reminder.php @@ -217,7 +217,7 @@ foreach ($question_list as $questionId) { $label_attributes['for'] = $check_id; $label_attributes['class'] = "checkbox"; $checkbox = Display::input('checkbox', 'remind_list['.$questionId.']', '', $attributes); - $url = 'exercise_submit.php?exerciseId='.$objExercise->id.'&num='.$counter.'&reminder=1'; + $url = 'exercise_submit.php?exerciseId='.$objExercise->id.'&num='.$counter.'&reminder=1&'.api_get_cidreq(); $counter++; if ($objExercise->type == ONE_PER_PAGE) { diff --git a/main/exercise/exercise_result.php b/main/exercise/exercise_result.php index d39edb3c13..204c4ed862 100755 --- a/main/exercise/exercise_result.php +++ b/main/exercise/exercise_result.php @@ -47,7 +47,7 @@ if (empty($objExercise)) { $objExercise = new Exercise(); $exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id); if (!empty($exercise_stat_info) && isset($exercise_stat_info['exe_exo_id'])) { - header("Location: overview.php?exerciseId=".$exercise_stat_info['exe_exo_id']); + header("Location: overview.php?exerciseId=".$exercise_stat_info['exe_exo_id'].'&'.api_get_cidreq()); exit; } api_not_allowed(); diff --git a/main/exercise/exercise_submit.php b/main/exercise/exercise_submit.php index c56f14c058..f9d23918ff 100755 --- a/main/exercise/exercise_submit.php +++ b/main/exercise/exercise_submit.php @@ -1254,7 +1254,7 @@ if (!empty($error)) { } '; - echo '
+ echo ' diff --git a/main/exercise/exercise_submit_modal.php b/main/exercise/exercise_submit_modal.php index d91ecf2442..573de42d36 100755 --- a/main/exercise/exercise_submit_modal.php +++ b/main/exercise/exercise_submit_modal.php @@ -110,7 +110,7 @@ if (empty($choice_value)) { // IMPORTANT //this is the real redirect function //echo 'window.location.href = "exercise_submit_modal.php?learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&hotspotcoord="+ hotspotcoord + "&hotspot="+ hotspot + "&choice="+ choice_js + "&exerciseId='.$exerciseId.'&num='.$questionNum.'&exerciseType='.$exerciseType.'&origin='.$origin.'&gradebook='.$gradebook.'";'; - echo ' url = "exercise_submit_modal.php?learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&hotspotcoord="+ hotspotcoord + "&hotspot="+ hotspot + "&choice="+ choice_js + "&exerciseId='.$exerciseId.'&num='.$questionNum.'&exerciseType='.$exerciseType.'&origin='.$origin.'&gradebook='.$gradebook.'";'; + echo ' url = "exercise_submit_modal.php?learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&hotspotcoord="+ hotspotcoord + "&hotspot="+ hotspot + "&choice="+ choice_js + "&exerciseId='.$exerciseId.'&num='.$questionNum.'&exerciseType='.$exerciseType.'&'.api_get_cidreq().'&gradebook='.$gradebook.'";'; echo "$('#global-modal .modal-body').load(url);"; echo ''; exit; @@ -599,7 +599,7 @@ if ($links != '') { } else { $questionNum++; echo ''; } diff --git a/main/exercise/hotspot_admin.inc.php b/main/exercise/hotspot_admin.inc.php index f4e7a5faca..af64a0438b 100755 --- a/main/exercise/hotspot_admin.inc.php +++ b/main/exercise/hotspot_admin.inc.php @@ -576,8 +576,7 @@ if ($modifyAnswers) { echo Display::return_message($msgErr, 'normal'); //main API } - $hotspot_admin_url = api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&hotspotadmin=' - .$modifyAnswers.'&exerciseId='.$exerciseId.'&'.api_get_cidreq(); + $hotspot_admin_url = api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&hotspotadmin='.$modifyAnswers.'&exerciseId='.$exerciseId; ?> diff --git a/main/exercise/overview.php b/main/exercise/overview.php index a0550720e6..379f595816 100755 --- a/main/exercise/overview.php +++ b/main/exercise/overview.php @@ -78,7 +78,7 @@ $edit_link = ''; if ($is_allowed_to_edit && $objExercise->sessionId == $sessionId) { $edit_link = Display::url( Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), - api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&id_session='.api_get_session_id().'&exerciseId='.$objExercise->id + api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id ); } $iconExercise = Display::return_icon('test-quiz.png', null, array(), ICON_SIZE_MEDIUM); diff --git a/main/exercise/question_list_admin.inc.php b/main/exercise/question_list_admin.inc.php index 8eadc97817..60abd62e84 100755 --- a/main/exercise/question_list_admin.inc.php +++ b/main/exercise/question_list_admin.inc.php @@ -246,7 +246,7 @@ if (!$inATest) { [], ICON_SIZE_TINY ), - api_get_self().'?'.api_get_cidreq() + api_get_self().'?'.api_get_cidreq().'&' .http_build_query([ 'exerciseId' => $exerciseId, 'deleteQuestion' => $id