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 '