From b4a7318f53508b7fe4fc5dba0394c7f39c0ff4ac Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 13 Aug 2015 17:56:19 -0500 Subject: [PATCH] Rename variables - refs BT#7448 --- main/exercice/exercise_report.php | 4 +--- main/exercice/exercise_show.php | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/main/exercice/exercise_report.php b/main/exercice/exercise_report.php index c5e2c681d4..bdea0e82e8 100755 --- a/main/exercice/exercise_report.php +++ b/main/exercice/exercise_report.php @@ -42,9 +42,7 @@ $TBL_TRACK_ATTEMPT = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT) $TBL_TRACK_ATTEMPT_RECORDING = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING); $TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW); -$allowCoachFeedbackExercises = api_get_setting( - 'allow_coach_feedback_exercises' -) == 'true'; +$allowCoachFeedbackExercises = api_get_setting('allow_coach_feedback_exercises') === 'true'; $course_id = api_get_course_int_id(); $exercise_id = isset($_REQUEST['exerciseId']) ? intval($_REQUEST['exerciseId']) : null; diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php index 4e6636e56c..f716eb8b76 100755 --- a/main/exercice/exercise_show.php +++ b/main/exercice/exercise_show.php @@ -64,14 +64,12 @@ if (api_is_course_session_coach( } } -$allowCoachFeedbackExercises = api_get_setting( - 'allow_coach_feedback_exercises' -) == 'true'; +$allowCoachFeedbackExercises = api_get_setting('allow_coach_feedback_exercises') === 'true'; $maxEditors = intval(api_get_setting('exercise_max_ckeditors_in_page')); $is_allowedToEdit = api_is_allowed_to_edit(null, true) || $is_courseTutor || api_is_session_admin() || api_is_drh() || api_is_student_boss(); -$isAllowedCoachToEdit = api_is_allowed_to_edit(false, true); -$isAllowedFeedback = false; +$isCoachAllowedToEdit = api_is_allowed_to_edit(false, true); +$isFeedbackAllowed = false; //Getting results from the exe_id. This variable also contain all the information about the exercise $track_exercise_info = ExerciseLib::get_exercise_track_exercise_info($id); @@ -520,16 +518,16 @@ foreach ($questionList as $questionId) { $locked == false && !api_is_drh() && !api_is_student_boss() && - $isAllowedCoachToEdit + $isCoachAllowedToEdit ) { - $isAllowedFeedback = true; - } else if (!$isAllowedCoachToEdit && $allowCoachFeedbackExercises) { - $isAllowedFeedback = true; + $isFeedbackAllowed = true; + } else if (!$isCoachAllowedToEdit && $allowCoachFeedbackExercises) { + $isFeedbackAllowed = true; } $marksname = ''; - if ($isAllowedFeedback) { + if ($isFeedbackAllowed) { $name = "fckdiv".$questionId; $marksname = "marksName".$questionId; if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION))) { @@ -593,7 +591,7 @@ foreach ($questionList as $questionId) { } } - if ($is_allowedToEdit && $isAllowedFeedback) { + if ($is_allowedToEdit && $isFeedbackAllowed) { if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION))) { $marksname = "marksName".$questionId; echo '