diff --git a/main/exercice/admin.php b/main/exercice/admin.php
index 80eee049fa..24f6808618 100755
--- a/main/exercice/admin.php
+++ b/main/exercice/admin.php
@@ -429,6 +429,9 @@ echo '
';
if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid']))
echo '
'.Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'','32').'';
+if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) && !isset($_GET['editQuestion'])) {
+ echo '
'.Display::return_icon('back.png', get_lang('BackToExercisesList'),'','32').'';
+}
echo '
'.Display::return_icon('preview_view.png', get_lang('Preview'),'','32').'';
echo '
'.Display::return_icon('settings.png', get_lang('ModifyExercise'),'','32').'';
diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php
index aeb04b0800..7515e39626 100755
--- a/main/exercice/exercice.php
+++ b/main/exercice/exercice.php
@@ -800,7 +800,7 @@ if ($show == 'test') {
//Settings
//$actions = Display::url(Display::return_icon('edit.gif',get_lang('Edit'), array('width'=>'20px')), 'exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$row['id']);
- $actions = Display::url(Display::return_icon('edit.png',get_lang('Edit'),array('width' =>'22px')), 'admin.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'&edit_questions=1');
+ $actions = Display::url(Display::return_icon('edit.png',get_lang('Edit'),array('width' =>'22px')), 'admin.php?'.api_get_cidreq().'&exerciseId='.$row['id']);
$actions .='
' . Display :: return_icon('show_test_results.gif', get_lang('Results')).'';
diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php
index e887c387a2..8080010f63 100755
--- a/main/exercice/exercise.class.php
+++ b/main/exercice/exercise.class.php
@@ -495,13 +495,8 @@ class Exercise {
{
$this->results_disabled = false;
}
- function updateResultsDisabled($results_disabled)
- {
- if ($results_disabled==1){
- $this->results_disabled = true;
- } else {
- $this->results_disabled = false;
- }
+ function updateResultsDisabled($results_disabled) {
+ $this->results_disabled = intval($results_disabled);
}
@@ -900,7 +895,6 @@ class Exercise {
// test type
$radios = array();
$radios[] = FormValidator :: createElement ('radio', 'exerciseType', null, get_lang('QuestionsPerPageOne'),'2','onclick = "check_per_page_one() " ');
-
$radios[] = FormValidator :: createElement ('radio', 'exerciseType', null, get_lang('QuestionsPerPageAll'),'1',array('onclick' => 'check_per_page_all()', 'id'=>'OptionPageAll'));
$form -> addGroup($radios, null, get_lang('QuestionsPerPage'));
@@ -923,6 +917,7 @@ class Exercise {
$radios_results_disabled = array();
$radios_results_disabled[] = FormValidator :: createElement ('radio', 'results_disabled', null, get_lang('Yes'), '0', array('id'=>'result_disabled_0'));
$radios_results_disabled[] = FormValidator :: createElement ('radio', 'results_disabled', null, get_lang('No'), '1',array('id'=>'result_disabled_1','onclick' => 'check_results_disabled()'));
+ $radios_results_disabled[] = FormValidator :: createElement ('radio', 'results_disabled', null, get_lang('OnlyShowScore'), '2',array('id'=>'result_disabled_2','onclick' => 'check_results_disabled()'));
$form -> addGroup($radios_results_disabled, null, get_lang('ShowResultsToStudents'));
$random = array();
diff --git a/main/exercice/exercise_admin.php b/main/exercice/exercise_admin.php
index 0f7fb91b13..da1f9f5efe 100755
--- a/main/exercice/exercise_admin.php
+++ b/main/exercice/exercise_admin.php
@@ -162,14 +162,14 @@ $objExercise -> createForm ($form);
// VALIDATE FORM
if ($form->validate()) {
- $objExercise -> processCreation($form);
- if ($form -> getSubmitValue('edit') == 'true') {
- header('Location:exercice.php?message=ExerciseEdited&'.api_get_cidreq());
- exit;
+ $objExercise->processCreation($form);
+ if ($form->getSubmitValue('edit') == 'true') {
+ $message = 'ExerciseEdited';
} else {
- header('Location:admin.php?message=ExerciseAdded&exerciseId='.$objExercise->id);
- exit;
+ $message = 'ExerciseAdded';
}
+ header('Location:admin.php?message='.$message.'&exerciseId='.$objExercise->id);
+ exit;
} else {
// DISPLAY FORM
if (isset($_SESSION['gradebook'])) {
@@ -184,7 +184,12 @@ if ($form->validate()) {
Display::display_header($nameTools,get_lang('Exercise'));
echo '
';
if ($objExercise->feedbacktype==1)
diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php
index d5747794e5..799da09a82 100755
--- a/main/exercice/exercise_show.php
+++ b/main/exercice/exercise_show.php
@@ -213,7 +213,7 @@ if (!empty($track_exercise_info)) {
// if the results_disabled of the Quiz is 1 when block the script
$result_disabled = $track_exercise_info['results_disabled'];
- if (!(api_is_platform_admin() || api_is_course_admin()) ) {
+ if (!(api_is_platform_admin() || api_is_course_admin()) ) {
if ($result_disabled == 1) {
//api_not_allowed();
$show_results = false;
@@ -224,7 +224,15 @@ if (!empty($track_exercise_info)) {
';
}
- }
+ } elseif ($result_disabled == 2) {
+ $show_results = false;
+ if ($origin != 'learnpath') {
+ Display::display_warning_message(get_lang('ThankYouForPassingTheTest').'
'.(get_lang('BackToExercisesList')).'', false);
+ echo '
+
+ ';
+ }
+ }
}
} else {
Display::display_warning_message(get_lang('CantViewResults'));
@@ -494,6 +502,7 @@ if ($show_results) {
}
echo '
';
+
if ($is_allowedToEdit) {
echo '| ';
$name = "fckdiv".$questionId;
diff --git a/main/exercice/hotpotatoes.php b/main/exercice/hotpotatoes.php
index 74ece1d8eb..66be35ac26 100755
--- a/main/exercice/hotpotatoes.php
+++ b/main/exercice/hotpotatoes.php
@@ -181,7 +181,7 @@ if ((api_is_allowed_to_edit(null, true)) && (($finish == 0) || ($finish == 2)))
Display::display_header($nameTools, get_lang('Exercise'));
echo '';
if ($finish==2) { // If we are in the img upload process.
diff --git a/main/exercice/qti2.php b/main/exercice/qti2.php
index e21ac48955..3a49d7e4eb 100755
--- a/main/exercice/qti2.php
+++ b/main/exercice/qti2.php
@@ -37,7 +37,7 @@ $is_allowedToEdit = api_is_allowed_to_edit(null, true);
function ch_qti2_display_form() {
$name_tools = get_lang('ImportQtiQuiz');
$form = '';
$form .= ' |