From 35313bc560541808343f577c8a40fd99fff60d21 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 10 Jul 2015 11:54:16 +0200 Subject: [PATCH] Minor - format code. --- main/exercice/exercise.class.php | 7 ++++++- main/exercice/exercise_report.php | 8 ++++++-- main/inc/lib/api.lib.php | 2 +- main/inc/lib/exercise.lib.php | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php index 18366f4b99..d96dff15ef 100755 --- a/main/exercice/exercise.class.php +++ b/main/exercice/exercise.class.php @@ -1608,6 +1608,7 @@ class Exercise // if we want to delete attempts before date $cleanResultBeforeDate // $cleanResultBeforeDate must be a valid UTC-0 date yyyy-mm-dd + if (!empty($cleanResultBeforeDate)) { $cleanResultBeforeDate = Database::escape_string($cleanResultBeforeDate); if (api_is_valid_date($cleanResultBeforeDate)) { @@ -1633,7 +1634,8 @@ class Exercise $i = 0; if (is_array($exe_list) && count($exe_list) > 0) { foreach ($exe_list as $item) { - $sql = "DELETE FROM $table_track_e_attempt WHERE exe_id = '".$item['exe_id']."'"; + $sql = "DELETE FROM $table_track_e_attempt + WHERE exe_id = '".$item['exe_id']."'"; Database::query($sql); $i++; } @@ -1901,6 +1903,9 @@ class Exercise /** * So the time control will work + * + * @param string $time_left + * @return string */ public function show_time_control_js($time_left) { diff --git a/main/exercice/exercise_report.php b/main/exercice/exercise_report.php index 4036637f9c..e47108e7e3 100755 --- a/main/exercice/exercise_report.php +++ b/main/exercice/exercise_report.php @@ -1,5 +1,6 @@ read($exercise_id)) { - $count = $objExerciseTmp->clean_results(true, $_GET['delete_before_date'].' 23:59:59'); + $count = $objExerciseTmp->clean_results( + true, + $_GET['delete_before_date'].' 23:59:59' + ); Display::display_confirmation_message(sprintf(get_lang('XResultsCleaned'), $count)); } } diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index 840d6e457d..a61a7fdb55 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -1847,7 +1847,7 @@ function api_format_course_array($course_data) $_course['department_name'] = $course_data['department_name']; $_course['department_url'] = $course_data['department_url']; - //Course password + // Course password $_course['registration_code'] = !empty($course_data['registration_code']) ? sha1($course_data['registration_code']) : null; $_course['disk_quota'] = $course_data['disk_quota']; $_course['course_public_url'] = api_get_path(WEB_COURSE_PATH).$course_data['directory'].'/index.php'; diff --git a/main/inc/lib/exercise.lib.php b/main/inc/lib/exercise.lib.php index f071941ead..f2899490d3 100644 --- a/main/inc/lib/exercise.lib.php +++ b/main/inc/lib/exercise.lib.php @@ -2446,7 +2446,7 @@ HTML; // only end is set $time_conditions .= " (start_time = '0000-00-00 00:00:00' AND end_time <> '0000-00-00 00:00:00' AND end_time > '$now') OR "; // nothing is set - $time_conditions .= " (start_time = '0000-00-00 00:00:00' AND end_time = '0000-00-00 00:00:00')) "; + $time_conditions .= " (start_time = '0000-00-00 00:00:00' AND end_time = '0000-00-00 00:00:00')) "; } $needle_where = !empty($search) ? " AND title LIKE '?' " : '';